From f20cc4223661b2a06875747e47456b713c80584e Mon Sep 17 00:00:00 2001 From: Mohammod Al Amin Ashik Date: Thu, 25 Jun 2026 16:45:44 +0800 Subject: [PATCH] fix(ui): scroll-to + flash the target Settings section on every redirect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only the Security section highlighted on deep-link; other "open Settings" links dumped the user at the top of the page. Generalize the mechanism so any section can be targeted, and wire the existing redirects to the right one. - SettingsPage: replace the security-only `securityRef`/`flashSecurity` with a section-keyed registry (`registerSection`/`sectionFlashClass`) driven by `pendingSettingsSection`. The matching section scrolls into view + flashes the ring for 2.2s, then the pending value is cleared. Unknown/unmounted sections are dropped (no stale flash). Wrapped the redirect-target sections: Updates, Gateway, Workspaces, Security. - ConnectionCard "Port … change in Settings" → targets the Gateway section. - App update banner "Update now" → targets the Updates section (was top of page). - WorkspaceInstallPanel auth nudge already targets Security — unchanged. Test: App update-banner test now asserts the redirect sets `pendingSettingsSection = 'updates'`. Full TS suite green (224). Claude-Session: https://claude.ai/code/session_01Baan9JmzR43uxxRUh7CAMF Signed-off-by: Mohammod Al Amin Ashik --- apps/desktop/src/App.tsx | 4 ++ .../desktop/src/components/ConnectionCard.tsx | 9 +++- .../src/features/settings/SettingsPage.tsx | 47 ++++++++++++++----- tests/ts/components/App.test.tsx | 4 ++ 4 files changed, 49 insertions(+), 15 deletions(-) diff --git a/apps/desktop/src/App.tsx b/apps/desktop/src/App.tsx index b0d64656..94ca61b2 100644 --- a/apps/desktop/src/App.tsx +++ b/apps/desktop/src/App.tsx @@ -17,6 +17,7 @@ import { useAnalyticsEnabled, useActiveNav, useNavigateTo, + useSetPendingSettingsSection, } from '@/stores'; import { NAV_ZONES, NAV_SETTINGS } from '@/lib/navigation'; import { spaceAccentColor } from '@/lib/spaceAccent'; @@ -97,6 +98,7 @@ function AppContent() { const activeNav = useActiveNav(); const navigateTo = useNavigateTo(); + const setPendingSettingsSection = useSetPendingSettingsSection(); const [availableUpdate, setAvailableUpdate] = useState<{ version: string } | null>(null); // Auto-check for updates on startup (silent check after 5 seconds). @@ -348,6 +350,8 @@ function AppContent() {