Skip to main content

Module app

Module app 

Source
Expand description

App state and the top-level run loop.

Three stages today: Splash (figlet logo for ~3s or until first key), Triptych (the default read view, now backed by a live team snapshot from PR-UI-2), and QuitConfirm (a modal asking “really?”). Subsequent stacked PRs bolt on more modals and the layout variants from SPEC §3 — those wire in by adding Stage variants and dispatching from draw/handle_event, no rearchitecting.

Structs§

App

Enums§

SplitOrientation
Splitscreen orientation per detail-pane split (PR-UI-7 lift of PR-UI-6’s deferred Q1). Vertical subdivides side-by-side (Ctrl+|); Horizontal stacks top-to-bottom (Ctrl+-).
Stage

Functions§

draw
handle_event
refresh
Refresh the team snapshot + the focused agent’s pane capture + the mailbox tabs (PR-UI-3). Pulled out so tests can drive a single tick deterministically against MockPaneSource and MockMailboxSource without going through the event loop.
refresh_approvals
Approvals-only refresh. Extracted on the same shape as refresh_mailbox — PR-UI-5+ can call it on its own cadence (e.g. in response to a notify signal) without re-running the heavier paths. Errors degrade to “no pending” so the stripe just hides on a transient broker read failure.
refresh_mailbox
Mailbox-only refresh — extracted so PR-UI-4+ can call it on its own cadence (e.g. in response to a broker INSERT signal) without re-running the heavier compose + tmux capture path. PR-UI-3 just calls it from the main refresh once per tick.
render_to_buffer
Render the entire UI into a Buffer at fixed size — used by the snapshot tests. Mirrors draw exactly but doesn’t require a Terminal. Update both in lockstep when adding new stages.
run
sync_focused_pane_size_to
T-199: push the focused agent’s inner tmux pane to match the Detail rect teamctl-ui will draw into. No-op when: