Description
When opening ZenNotes on a vault with many notes, the previously-open tabs take a few seconds to appear. The window chrome and app shell render quickly, but the tab strip/editor surface stays blank until the full vault scan finishes.
Root cause
packages/app-core/src/store.ts restores the workspace in this order during init():
refreshVaultIndexes() — walks the vault and streams all note metadata.
prefetchInitialVisibleNotes() — preloads the visible note list.
restoreWorkspaceForVault() — finally reads the saved workspace snapshot and sets workspaceRestored = true.
Because restoreWorkspaceForVault validates tab paths against the complete notes index, it cannot paint the saved tabs until the entire vault listing is done. On large vaults that listing alone takes seconds, so the user sees an empty workspace for that whole time.
What should happen
The saved workspace snapshot is tiny compared to the notes index. The tab layout and active-tab paths should be restored immediately from the snapshot, and the full note index should refresh in the background. Missing/stale tabs can be pruned once the index arrives.
Description
When opening ZenNotes on a vault with many notes, the previously-open tabs take a few seconds to appear. The window chrome and app shell render quickly, but the tab strip/editor surface stays blank until the full vault scan finishes.
Root cause
packages/app-core/src/store.tsrestores the workspace in this order duringinit():refreshVaultIndexes()— walks the vault and streams all note metadata.prefetchInitialVisibleNotes()— preloads the visible note list.restoreWorkspaceForVault()— finally reads the saved workspace snapshot and sets workspaceRestored = true.Because
restoreWorkspaceForVaultvalidates tab paths against the complete notes index, it cannot paint the saved tabs until the entire vault listing is done. On large vaults that listing alone takes seconds, so the user sees an empty workspace for that whole time.What should happen
The saved workspace snapshot is tiny compared to the notes index. The tab layout and active-tab paths should be restored immediately from the snapshot, and the full note index should refresh in the background. Missing/stale tabs can be pruned once the index arrives.