Repository navigation
Launch the TUI on a fresh install and open on Add collection - #220
Conversation
`fnd tui` exited 1 when no index existed, so a new user could not reach the Settings UI to add their first collection. The app already copes with a missing index; only the CLI guard refused. - `prompt_and_rebuild_or_exit(missing_ok=True)` from `fnd tui`: an absent index launches the app. A stale schema still prompts; `fnd search` still refuses. - With no collections and no index, the app opens on Add collection. - An empty scope over a config that had no collections reseeds from `defaults.collection` on the next panel refresh, so the first collection (wizard or config file) is searched without a relaunch. Nothing is persisted, so later collections still seed on relaunch. - The main footer re-renders when its screen is active again: it was last rendered for the wizard's focus and offered `q` to the query bar. - A search with no searcher opens an index built by the CLI meanwhile.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Summary
A fresh install could not start the TUI:
fnd tuiexited 1 with "no index at ...", so the Settings UI was unreachable for adding the first collection. The app itself already opens without an index; the CLI guard was the only blocker.fnd tuipassesmissing_ok=Truetoprompt_and_rebuild_or_exit. An absent index launches; a stale schema still prompts;fnd searchstill refuses.FNDApppushesAddCollectionWizardon mount (as the README's Quick start already describes).ScopeController._seed_first_collectionsreseeds an empty scope fromdefaults.collectionwhen the config previously had no collections. Covers the wizard, the config-file editor and config recovery (all go throughrefresh_collections_panel). Never persists, so a later CLI-added collection still seeds on relaunch.screen_change_signalwhen the main screen is active again. It was rendered for the wizard's focus, so after Esc it showedq Quitwhileqtyped into the query bar.on_reindex_complete), rather than returning nothing until relaunch.invoked="tui"branch of_next_step.Test plan
tests/test_a_fresh_install_opens_on_add_collection.py: launch path, wizard on fresh install plus two controls (configured collection, existing index), footer after Esc, first-collection scope (and no state written), emptied-scope control, config-file reload with two collections, outside-built index. Each fails with its fix removed.make test-fastgreen;make batch-closegreen on the rebased tree.u, search finds the file with1/1 active; Esc from the wizard gives the query-bar footer andqquits.Parked (pre-existing, out of scope): deleting or renaming a collection does not prune its name from the scope selection.