feat(tui): E keybind on Question Dashboard exports bibliography#182
Merged
feat(tui): E keybind on Question Dashboard exports bibliography#182
Conversation
…sub-feature B of 3) Surfaces the existing `bib snapshot` write path as a single keystroke from the TUI. Pressing `E` on `Overlay::QuestionDashboard` opens a path-prompt overlay pre-filled with a slugified default (`what-is-the-role-of-attention.bib`); Enter writes the `.bib` + `.scitadel-bib.lock` sidecar via `scitadel_export::write_snapshot`, the same helper the CLI now goes through. Outcome surfaces as a status-bar toast (`exported: paper.bib (12 entries)` for ~30 frames; `export failed: <err>` for ~60). The slug helper, the typed `SnapshotFormat` enum, and the pure `write_snapshot` writer all live in `scitadel-export` so CLI + TUI produce byte-identical artifacts and verify can never disagree about the wire shape.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #135 (sub-feature B of 3)
Summary
Ekeybind onOverlay::QuestionDashboardthat opens a path-prompt overlay pre-filled with a slugified default (what-is-the-role-of-attention.bib); Enter writes the.bib+.scitadel-bib.locksidecar through the samescitadel_export::write_snapshothelper the CLI now uses.SnapshotFormat,write_snapshot,default_filename_for_format,sidecar_path_for,slugify) intoscitadel-exportso CLI + TUI emit byte-identical artifacts; refactorsbib_snapshotinscitadel-clito call through the new helper.exported: paper.bib (12 entries)for ~30 frames) and error (export failed: <err>for ~60 frames). Reuses the existing per-frame counter pattern (feat(tui): light mode + auto-detect (theme iter 2) #137) — no new toast subsystem.What landed
crates/scitadel-export/src/slug.rs— kebab-slug helper with diacritic folding, length cap, fallback for all-non-alpha input.crates/scitadel-export/src/snapshot.rs—write_snapshot(...)pure write helper +SnapshotFormatenum.crates/scitadel-tui/src/views/bib_export_prompt.rs— single-buffer path prompt with slugified default and centred modal renderer.crates/scitadel-tui/src/app.rs—Ehandler, layered overlay key dispatch (prompt eats keys before list controls),StatusToastslot, status-bar wiring, end-to-end tests.tests/vhs/tui-export-keybind.tape— VHS tape (uncrendered locally; vhs/ttyd not present).Test plan
cargo test --workspace --exclude scitadel-tui— all greencargo test -p scitadel-tui— 42 tests pass (4 new app::tests + 5 view tests + 9 slug/snapshot tests)just lint— fmt + clippy cleanscitadel tui→ Questions tab → Enter →E→ Enter → confirmpaper.bib+paper.bib.scitadel-bib.lockappear, toast shows entry count