Skip to main content

Module setup

Module setup 

Source
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§

BackgroundSnapshot
Background snapshot: user request, poll .ublx_tmp while running, and completion.
ContentMarqueeState
State for horizontal marquee when a list row label overflows (e.g. Duplicates/Lenses left pane).
ContentSort
Mode-aware content sort state.
CtrlChordState
After Ctrl+A, wait for a letter or show the Command Mode menu (see [crate::ui::ctrl_chord]).
DeltaViewData
Data for Delta mode: snapshot overview text and raw (created_ns, path) rows per delta type.
DuplicateLoadGate
Lazy-load duplicate groups when the user opens the Duplicates tab.
EnhancePolicyMenuState
After Space → Enhance policy: choose auto / manual batch Zahir for this directory subtree (local TOML).
FileDeleteConfirmState
Confirm delete for a snapshot file or folder (Yes / No).
LensConfirmState
Lens rename input and delete-lens confirmation.
LensExportGate
Background lens Markdown export (Command Mode + l).
LensMenuState
Lens menu (Add to lens) state.
MultiselectState
Multi-select in the middle pane (Ctrl+Space on contents; cleared when focus leaves the contents list).
OpenMenuState
Open (Terminal/GUI) menu state.
PDF
PanelState
List panels: categories, contents, focus, preview scroll, and highlight style.
QAMenuState
Quick Actions context menu state.
RightPaneAsync
RightPaneAsyncReady
Result from background right-pane resolve.
RightPaneContent
Text to show in the right pane for the current selection.
RightPaneContentDerived
SearchState
Search bar state.
SectionedPreview
Per-pane content from zahir JSON. Templates always present; metadata and writing only if keys exist.
SessionFlow
One-shot session coordination for ticks, editor handoff, and DB reload.
SessionReloadFlags
Snapshot table reload and one-shot dedup for the background full-enhance toast.
SessionTickFlags
First real frame vs later ticks; redraw after returning from external editor.
SettingsPaneState
Settings tab: bool/layout editor, raw TOML preview scroll, and path to the file being edited.
SnapshotEntryMeta
StartupPromptState
First-run flow when the per-root DB was new: pick root, optional prior roots, then prior-settings or enhance-all.
ThemeState
Theme selector and override.
ToastState
Toast notifications stack and per-operation consumed counts.
UblxState
Top-level TUI state. Menu and UI sub-states are grouped into nested structs.
UblxSwitchPickerState
Command Mode + p: pick another indexed root (re-exec ublx on that directory).
ViewData
Derived list data for this tick: filtered categories and contents (by index or owned), lengths for navigation. Scalability: snapshot mode uses ViewContents::SnapshotIndices so we keep a single copy of the list; no cloned row vec.
ViewerChrome
Help overlay and fullscreen right-pane preview.
ViewerDiskContentCache
Avoids re-reading the selected file every UI tick when path, category, size, and mtime match.
ViewerFindState
In-pane literal search (Shift+S): query, match byte ranges in haystack, current match index.
ViewerImageState
State for the image viewer in the right pane (ratatui-image, tiered downscale, optional background decode).
ZahirExportGate
Background flat Zahir JSON export (Command Mode + x).

Enums§

MainMode
Top-level mode. Tab bar order: Snapshot, Lenses (optional), Delta, Duplicates (optional), Settings.
PanelFocus
Which panel has focus (Categories or Contents; Metadata is read-only).
RightPaneMode
SettingsConfigScope
Which config file the Settings tab edits (~/.config/ublx/ublx.toml vs project ublx.toml).
SnapshotSortKey
Snapshot/Duplicates middle-pane sort key.
SortDirection
Middle-pane sort direction.
SpaceMenuKind
Which variant of the spacebar context menu is open (determines items and Enter behavior).
StartupPromptPhase
ViewContents
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§

DeltaRow
Raw delta row: (created_ns, path) from delta_log. Used to build display lines with dates preserved when filtering.