Fix database sidebar not appearing on client-side navigation

The subNavigation variable was being reactively assigned from page.data
in both shell.svelte and navigation.svelte, connected via bind:. This
competing reactive ownership caused the value to not update properly
during client-side navigation (only on full page refresh). Made
shell.svelte the single source of truth by removing the duplicate
reactive assignment from navigation.svelte and switching from bind: to
one-way prop passing.

https://claude.ai/code/session_012QCz2xVatAtJ3Q6FSp1cB4
This commit is contained in:
Claude
2026-03-29 05:38:57 +00:00
parent 67531aed56
commit 3dd288fd5d
2 changed files with 2 additions and 5 deletions
-3
View File
@@ -1,11 +1,8 @@
<script lang="ts">
import { page } from '$app/state';
import { getContext } from 'svelte';
import type { Writable } from 'svelte/store';
export let subNavigation;
$: subNavigation = page.data.subNavigation;
// We need to have this second variable, because we only want narrow
// to change automatically if we change from having a second side nav to
// not having one, not when the second side nav changes to a different value.
+2 -2
View File
@@ -235,14 +235,14 @@
project={activeProject}
progressCard={getProgressCard()}
avatar={navbarProps.avatar}
bind:subNavigation
{subNavigation}
bind:sideBarIsOpen={$isSidebarOpen}
bind:showAccountMenu
bind:state />
{/if}
{#if !$showOnboardingAnimation}
<SideNavigation bind:subNavigation />
<SideNavigation {subNavigation} />
{/if}
</div>