Skip to content

feat(tui): E keybind on Question Dashboard exports bibliography#182

Merged
gerchowl merged 2 commits intodevfrom
feat/135b-tui-export-keybind
Apr 28, 2026
Merged

feat(tui): E keybind on Question Dashboard exports bibliography#182
gerchowl merged 2 commits intodevfrom
feat/135b-tui-export-keybind

Conversation

@gerchowl
Copy link
Copy Markdown
Contributor

Refs #135 (sub-feature B of 3)

Summary

  • Adds E keybind on Overlay::QuestionDashboard that 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 through the same scitadel_export::write_snapshot helper the CLI now uses.
  • Lifts the snapshot write path (SnapshotFormat, write_snapshot, default_filename_for_format, sidecar_path_for, slugify) into scitadel-export so CLI + TUI emit byte-identical artifacts; refactors bib_snapshot in scitadel-cli to call through the new helper.
  • Status-bar toast on success (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.rswrite_snapshot(...) pure write helper + SnapshotFormat enum.
  • 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.rsE handler, layered overlay key dispatch (prompt eats keys before list controls), StatusToast slot, 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 green
  • cargo test -p scitadel-tui — 42 tests pass (4 new app::tests + 5 view tests + 9 slug/snapshot tests)
  • just lint — fmt + clippy clean
  • VHS tape rendered in CI (vhs/ttyd not on this machine; tape committed for CI/PR-review render)
  • Manual smoke: scitadel tui → Questions tab → Enter → E → Enter → confirm paper.bib + paper.bib.scitadel-bib.lock appear, toast shows entry count

gerchowl and others added 2 commits April 28, 2026 14:28
…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.
@gerchowl gerchowl merged commit d4bd08b into dev Apr 28, 2026
11 of 12 checks passed
@gerchowl gerchowl deleted the feat/135b-tui-export-keybind branch April 28, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant