From a86b907049f0a95846c02cc55ab5b0231e030bfa Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Wed, 10 Dec 2025 20:43:14 +0100 Subject: [PATCH] fix(shared-ui): fix reactivity in NavVisibilitySettings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The navigation visibility toggles in settings were not updating the UI reactively when toggled. This was because isRouteHidden() was a regular function that wasn't tracked by Svelte's reactivity system. Changed to use a $derived variable that directly accesses userSettings.nav.hiddenNavItems, which ensures the component re-renders when the settings change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../shared-ui/src/settings/NavVisibilitySettings.svelte | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/shared-ui/src/settings/NavVisibilitySettings.svelte b/packages/shared-ui/src/settings/NavVisibilitySettings.svelte index 2223bfa51..7b4cb4f53 100644 --- a/packages/shared-ui/src/settings/NavVisibilitySettings.svelte +++ b/packages/shared-ui/src/settings/NavVisibilitySettings.svelte @@ -28,10 +28,8 @@ // Check if there are any routes to configure const hasRoutes = $derived(hideableItems.length > 0); - function isRouteHidden(href: string): boolean { - const hidden = userSettings.getHiddenNavItemsForApp(appId); - return hidden.includes(href); - } + // Reactive: get hidden items from nav settings (triggers re-render when hiddenNavItems changes) + const hiddenItems = $derived(userSettings.nav.hiddenNavItems?.[appId] || []); async function handleToggle(href: string): Promise { await userSettings.toggleNavItemVisibility(appId, href); @@ -129,7 +127,7 @@
{#each hideableItems as item (item.href)} - {@const hidden = isRouteHidden(item.href)} + {@const hidden = hiddenItems.includes(item.href)} {@const iconPath = item.icon ? getIconPath(item.icon) : ''}