Expand description
3-panel TUI: categories (left), contents (middle), preview (right).
[crate::handlers::core::run_tui_session] drives the loop; work per tick is split into four phases (see classification below).
Action application (key → state changes) lives in crate::handlers::state_transitions.
Re-exports§
pub use crate::engine::db_ops::SnapshotTuiRow as TuiRow;
Structs§
- Background
Snapshot - Background snapshot: user request, poll
.ublx_tmpwhile running, and completion. - Content
Marquee State - State for horizontal marquee when a list row label overflows (e.g. Duplicates/Lenses left pane).
- Content
Sort - Mode-aware content sort state.
- Ctrl
Chord State - After Ctrl+A, wait for a letter or show the Command Mode menu (see [
crate::ui::ctrl_chord]). - Delta
View Data - Data for Delta mode: snapshot overview text and raw (
created_ns, path) rows per delta type. - Duplicate
Load Gate - Lazy-load duplicate groups when the user opens the Duplicates tab.
- Enhance
Policy Menu State - After Space → Enhance policy: choose auto / manual batch Zahir for this directory subtree (local TOML).
- File
Delete Confirm State - Confirm delete for a snapshot file or folder (Yes / No).
- Lens
Confirm State - Lens rename input and delete-lens confirmation.
- Lens
Export Gate - Background lens Markdown export (Command Mode +
l). - Lens
Menu State - Lens menu (Add to lens) state.
- Multiselect
State - Multi-select in the middle pane (Ctrl+Space on contents; cleared when focus leaves the contents list).
- Open
Menu State - Open (Terminal/GUI) menu state.
- Panel
State - List panels: categories, contents, focus, preview scroll, and highlight style.
- QAMenu
State - Quick Actions context menu state.
- Right
Pane Async - Right
Pane Async Ready - Result from background right-pane resolve.
- Right
Pane Content - Text to show in the right pane for the current selection.
- Right
Pane Content Derived - Search
State - Search bar state.
- Sectioned
Preview - Per-pane content from zahir JSON. Templates always present; metadata and writing only if keys exist.
- Session
Flow - One-shot session coordination for ticks, editor handoff, and DB reload.
- Session
Reload Flags - Snapshot table reload and one-shot dedup for the background full-enhance toast.
- Session
Tick Flags - First real frame vs later ticks; redraw after returning from external editor.
- Settings
Pane State - Settings tab: bool/layout editor, raw TOML preview scroll, and path to the file being edited.
- Snapshot
Entry Meta - Startup
Prompt State - First-run flow when the per-root DB was new: pick root, optional prior roots, then prior-settings or enhance-all.
- Theme
State - Theme selector and override.
- Toast
State - Toast notifications stack and per-operation consumed counts.
- Ublx
State - Top-level TUI state. Menu and UI sub-states are grouped into nested structs.
- Ublx
Switch Picker State - Command Mode +
p: pick another indexed root (re-execublxon that directory). - View
Data - Derived list data for this tick: filtered categories and contents (by index or owned), lengths for navigation.
Scalability: snapshot mode uses
ViewContents::SnapshotIndicesso we keep a single copy of the list; no cloned row vec. - Viewer
Chrome - Help overlay and fullscreen right-pane preview.
- Viewer
Disk Content Cache - Avoids re-reading the selected file every UI tick when path, category, size, and mtime match.
- Viewer
Find State - In-pane literal search (Shift+S): query, match byte ranges in haystack, current match index.
- Viewer
Image State - State for the image viewer in the right pane (
ratatui-image, tiered downscale, optional background decode). - Zahir
Export Gate - Background flat Zahir JSON export (Command Mode +
x).
Enums§
- Main
Mode - Top-level mode. Tab bar order: Snapshot, Lenses (optional), Delta, Duplicates (optional), Settings.
- Panel
Focus - Which panel has focus (Categories or Contents; Metadata is read-only).
- Right
Pane Mode - Settings
Config Scope - Which config file the Settings tab edits (
~/.config/ublx/ublx.tomlvs projectublx.toml). - Snapshot
Sort Key - Snapshot/Duplicates middle-pane sort key.
- Sort
Direction - Middle-pane sort direction.
- Space
Menu Kind - Which variant of the spacebar context menu is open (determines items and Enter behavior).
- Startup
Prompt Phase - View
Contents - Snapshot mode: indices into the single in-memory list (no copy). Delta mode: small owned vec.
Constants§
- CATEGORY_
DIRECTORY - Category string for directories in the snapshot (matches
crate::engine::db_ops::UblxDbCategory).
Type Aliases§
- Delta
Row - Raw delta row: (
created_ns, path) fromdelta_log. Used to build display lines with dates preserved when filtering.