Build the Mutt-style TUI shell and action model #17

Closed
opened 2026-08-09 19:10:31 +00:00 by hugo · 1 comment
Owner

Objective

Build the Mutt-inspired Ratatui application shell and UI state model in apps/tui.

Scope

  • Implement a responsive sidebar/main-pane layout with contextual help, status line and bottom prompt/command line.
  • Model browser, viewer, editor, dialog, help, command and locked modes without encoding storage rules.
  • Run the Crossterm event loop, resize handling, periodic UI ticks and asynchronous storage results without blocking input.
  • Enter and restore terminal raw/alternate-screen state safely on normal exit, error and panic.
  • Define a central UI action registry consumed by keyboard help and command mode.

Acceptance criteria

  • State-machine tests cover every legal mode transition and reject stale asynchronous results.
  • Layout tests cover narrow, normal and wide terminals with clear minimum-size behavior.
  • Terminal state is restored after every exit path.
  • The shell contains no repository, encryption, Git, OTP or entry parsing logic.

Prerequisites

Milestone 01 complete, including structured entry documents and authentication leases.

## Objective Build the Mutt-inspired Ratatui application shell and UI state model in `apps/tui`. ## Scope - Implement a responsive sidebar/main-pane layout with contextual help, status line and bottom prompt/command line. - Model browser, viewer, editor, dialog, help, command and locked modes without encoding storage rules. - Run the Crossterm event loop, resize handling, periodic UI ticks and asynchronous storage results without blocking input. - Enter and restore terminal raw/alternate-screen state safely on normal exit, error and panic. - Define a central UI action registry consumed by keyboard help and command mode. ## Acceptance criteria - State-machine tests cover every legal mode transition and reject stale asynchronous results. - Layout tests cover narrow, normal and wide terminals with clear minimum-size behavior. - Terminal state is restored after every exit path. - The shell contains no repository, encryption, Git, OTP or entry parsing logic. ## Prerequisites Milestone 01 complete, including structured entry documents and authentication leases.
hugo added this to the 02 - Mutt-style terminal UI milestone 2026-08-09 19:10:31 +00:00
hugo added the enhancement label 2026-08-09 19:10:31 +00:00
Author
Owner

Implemented in commit 42e6a82 and pushed to main.

Implementation:

  • Added a responsive Ratatui shell with sidebar/main layouts for narrow, normal, and wide terminals, plus minimum-size handling, status, contextual help, and prompt lines.
  • Added explicit browser, viewer, editor, dialog, help, command, and locked modes with validated transitions and safe overlay return behavior.
  • Added a central action registry shared by key dispatch, contextual help, and command metadata.
  • Added a nonblocking 250 ms event loop and an in-process background executor for typed storage results; generation tokens reject stale and duplicate completions.
  • Added guarded terminal initialization/restoration covering normal return, errors, initialization failure, and panic.
  • Startup configuration loading uses the crates/storage API; apps/tui contains no repository access, domain parsing, or external-process launch.

Verification:

  • cargo fmt --all -- --check
  • RUSTFLAGS="-D warnings" cargo check --workspace --all-targets
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace
  • 18 focused TUI tests pass, including transition, layout, async-staleness, action-registry, executor, and terminal-restoration coverage.
Implemented in commit 42e6a82 and pushed to main. Implementation: - Added a responsive Ratatui shell with sidebar/main layouts for narrow, normal, and wide terminals, plus minimum-size handling, status, contextual help, and prompt lines. - Added explicit browser, viewer, editor, dialog, help, command, and locked modes with validated transitions and safe overlay return behavior. - Added a central action registry shared by key dispatch, contextual help, and command metadata. - Added a nonblocking 250 ms event loop and an in-process background executor for typed storage results; generation tokens reject stale and duplicate completions. - Added guarded terminal initialization/restoration covering normal return, errors, initialization failure, and panic. - Startup configuration loading uses the crates/storage API; apps/tui contains no repository access, domain parsing, or external-process launch. Verification: - cargo fmt --all -- --check - RUSTFLAGS="-D warnings" cargo check --workspace --all-targets - cargo clippy --workspace --all-targets -- -D warnings - cargo test --workspace - 18 focused TUI tests pass, including transition, layout, async-staleness, action-registry, executor, and terminal-restoration coverage.
hugo closed this issue 2026-08-10 05:47:22 +00:00
Sign in to join this conversation.