feat(ui): auto-index a vault on open, no confirm dialog (#25) - #54
Conversation
Detect an unindexed or partly-indexed vault the moment it's opened — app launch (`boot`) and vault switch (`switchVault`) — and start the index immediately instead of waiting behind a manual Reindex click. The UX call in the issue goes to silent auto-start: no confirm dialog. The detector is the model-free embedding-coverage read already surfaced in `VaultInfo` (`notes_embedded`/`notes_total`, #26), so this needs no engine change — it's adapter sequencing over the existing `project`/`embed` ops: - notes_total == 0 never projected: run the fast, model-free `project` (tree + keyword search live in seconds), then `embed`. - notes_embedded < total projected but embedding didn't finish (a prior cancel/crash): resume only the trailing `embed`; the pending set is DB-derived and self-healing. - embedded == total (>0) index complete: left untouched, so reopening a vault is never busywork. The embed phase runs only when a real model is installed (`state.semantic`); without one a fresh vault still gets its keyword + graph index and nothing errors — the search caveat already reads "keyword-only for now". The run is silent like the trailing embed after a save: the progress meter and Cancel are the only chrome, no toast. Concurrency: a new module-local `indexingRun` handle tracks the in-flight background index (manual reindex, auto-index, or trailing embed). A vault switch cancels the departing run host-side (already) and chains the new vault's auto-index after that handle settles, so the fresh run never starts on a not-yet-cleared `reindexing` flag. autoIndexOnOpen reuses doReindex's vault-switch guards and adds a pre-embed root check so a switch mid-run never embeds the vault being left. Docs: mark #25 shipped in tasks.md and projection-embedding-split.md §9. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JuNkPDNLJchKqzkMciWMcz
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAutomatic indexing now runs on launch and vault switches, coordinates projection and embedding based on vault state, and tracks background runs to prevent stale-vault work during transitions. ChangesAutomatic indexing
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Detect an unindexed or partly-indexed vault the moment it's opened — app
launch (
boot) and vault switch (switchVault) — and start the indeximmediately instead of waiting behind a manual Reindex click. The UX call
in the issue goes to silent auto-start: no confirm dialog.
The detector is the model-free embedding-coverage read already surfaced in
VaultInfo(notes_embedded/notes_total, #26), so this needs no enginechange — it's adapter sequencing over the existing
project/embedops:project(tree + keyword search live inseconds), then
embed.cancel/crash): resume only the trailing
embed;the pending set is DB-derived and self-healing.
vault is never busywork.
The embed phase runs only when a real model is installed (
state.semantic);without one a fresh vault still gets its keyword + graph index and nothing
errors — the search caveat already reads "keyword-only for now". The run is
silent like the trailing embed after a save: the progress meter and Cancel
are the only chrome, no toast.
Concurrency: a new module-local
indexingRunhandle tracks the in-flightbackground index (manual reindex, auto-index, or trailing embed). A vault
switch cancels the departing run host-side (already) and chains the new
vault's auto-index after that handle settles, so the fresh run never starts
on a not-yet-cleared
reindexingflag. autoIndexOnOpen reuses doReindex'svault-switch guards and adds a pre-embed root check so a switch mid-run
never embeds the vault being left.
Docs: mark #25 shipped in tasks.md and projection-embedding-split.md §9.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01JuNkPDNLJchKqzkMciWMcz
Summary by CodeRabbit
New Features
Bug Fixes
Documentation