Skip to content

Commit 3dd288f

Browse files
committed
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
1 parent 67531ae commit 3dd288f

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

src/lib/layout/navigation.svelte

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
<script lang="ts">
2-
import { page } from '$app/state';
32
import { getContext } from 'svelte';
43
import type { Writable } from 'svelte/store';
54
65
export let subNavigation;
7-
8-
$: subNavigation = page.data.subNavigation;
96
// We need to have this second variable, because we only want narrow
107
// to change automatically if we change from having a second side nav to
118
// not having one, not when the second side nav changes to a different value.

src/lib/layout/shell.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,14 @@
235235
project={activeProject}
236236
progressCard={getProgressCard()}
237237
avatar={navbarProps.avatar}
238-
bind:subNavigation
238+
{subNavigation}
239239
bind:sideBarIsOpen={$isSidebarOpen}
240240
bind:showAccountMenu
241241
bind:state />
242242
{/if}
243243

244244
{#if !$showOnboardingAnimation}
245-
<SideNavigation bind:subNavigation />
245+
<SideNavigation {subNavigation} />
246246
{/if}
247247
</div>
248248

0 commit comments

Comments
 (0)