Skip to content

Startup is blocked by full vault index refresh before workspace tabs can paint #564

Description

@junereycasuga

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():

  1. refreshVaultIndexes() — walks the vault and streams all note metadata.
  2. prefetchInitialVisibleNotes() — preloads the visible note list.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions