From 3fdcc41d105a10f21fcb8337236a84650051a5cc Mon Sep 17 00:00:00 2001 From: bruno Date: Wed, 15 Jul 2026 08:10:01 -0400 Subject: [PATCH] fix: auto-refresh page when closing Settings with X closeSettings() now: - Refreshes the parent page (history.back + reload) - Handles tab navigation between settings sections - Falls back to /workspaces redirect if no history --- app/templates/settings.html | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/app/templates/settings.html b/app/templates/settings.html index 6e8d413..f86bae4 100644 --- a/app/templates/settings.html +++ b/app/templates/settings.html @@ -799,12 +799,26 @@ document.addEventListener('alpine:init', function() { } catch(e) {} }, closeSettings() { - // Go back to previous page, skipping any hash-only navigation - if (document.referrer && document.referrer.includes('/settings')) { - // Came from another settings tab — use history until we leave settings + // Refresh parent page after settings changes, then navigate back + if (window.opener && !window.opener.closed) { + window.opener.location.reload(); + window.close(); + return; + } + // If navigated directly to settings, redirect to workspaces (forces refresh) + if (!document.referrer || document.referrer === window.location.href) { + window.location.href = '/workspaces?ts=' + Date.now(); + return; + } + // Go back and force refresh + var prev = document.referrer; + if (prev && prev.includes('/settings')) { + // Came from another settings tab — go back two steps then refresh history.go(-2); + setTimeout(function() { window.location.reload(); }, 100); } else { history.back(); + setTimeout(function() { window.location.reload(); }, 100); } }, };