Repository navigation
Description
What happens
On launch the app restores the persisted tab state from webview localStorage verbatim. The Daily Journal tab (id: "daily-journal") is persisted with a fixed nodeId (a date). On any later day it reopens on that old date instead of today. Observed on a real Mac: Daily Journal opened on August 24, 2026 on 2026-10-13, and the user's typed nodes were created under date 2026-08-24.
Cause
packages/desktop-app/src/lib/stores/navigation.svelte.ts:createInitialTabState()builds thedaily-journaltab withnodeId: getTodayDateId()only when nothing is persisted.loadPersistedState()(called fromapp-shell.svelteonMount) replacesstatewith theTabPersistenceService.load()output unchanged.tab-persistence-service.tsstores it inlocalStorage['nodespace:tab-state'].loadPersistedState()does not re-resolve the Daily Journal tab to today, so the tab keeps whatever date was open when the state was last saved (also if the user paged with the arrows).- The tab title shows the raw date rather than "Today", consistent with a restored tab.
- The daemon creates the date node for whatever id the viewer asks for, which is why new nodes went under the old date.
Webview storage lives in ~/Library/WebKit/com.nodespace.desktop/..., so wiping ~/.nodespace does not reset it. Reproduced on a developer Mac: that localstorage.sqlite3 held {"version":1,"tabs":[{"id":"daily-journal","title":"2026-06-01","type":"node","content":{"nodeId":"2026-06-01","nodeType":"date"},...}]...}, which would open June 1.
Expected
After restoring, a Daily Journal tab (id === DAILY_JOURNAL_TAB_ID, content.nodeType === 'date') whose nodeId is not today (local date) is rewritten to today, with the title updated to match. A date tab that is not the Daily Journal is untouched. Optionally keep the restored date only if the app was last used the same calendar day.
Acceptance criteria
- Unit test in
tests/stores/navigation*.test.ts: a persisted daily-journal tab dated in the past shows today after load; a non-daily-journal date tab is untouched. - Midnight rollover (app left open overnight) considered separately, noted in the PR if not handled.
Why it matters
New entries land on an old date page, confusing, and it affects every user after the first day for the default tab.
Where
packages/desktop-app/src/lib/stores/navigation.svelte.ts (loadPersistedState), tab-persistence-service.ts.
Activity
mstomar125 commentedon Oct 20, 2026
Planned for core v0.3.9.