Expand description
Application state and event handling. App::handle is a pure-ish state
transition (no terminal IO) so the whole shell is unit-testable; rendering
reads the state in ui::draw. Per-screen state and handlers live in the
status, log, and diff submodules.
Modules§
- blast
- Blast radius of the selected file: which symbols the diff touches and who references them beyond the changed files. Computed against the language server on the runtime side; results land as events like enrichment.
- enrich
- Background enrichment of diff files: intra-line emphasis, whole-file
syntax highlight, and the scope index are CPU-heavy (hundreds of ms on
large files) and used to run inside
draw. They now run on the blocking pool; the pane renders plain until the result lands as an event. - logs
- The CI job-log view: a job’s log grouped into its real steps. Each line is
<timestamp> <text>(the REST log; the parser also toleratesgh’s<job>\t<step>\t<timestamp>form). No API exposes per-step log content, so lines are bucketed into the step metadata (name/status/timing from the jobs API) by timestamp: a line belongs to the last step whose start it’s at or after. Without step metadata (e.g. GitLab) it falls back to the runner’s##[group]markers. Folded by default; keymap-driven like the diff. - pr
- The PR review loop against the forge: pull the PR’s line comments into the local session (the same review UI everywhere) and push local comments and replies back out.
Structs§
- App
- CiRemote
- A git remote diffler can pull CI from: its name, the detected forge, and the remote URL the provider is built from.
- Comment
Jump - One row of the comments overview: where it anchors and what to show.
- Diff
View - File
Highlights - Per-line syntax spans for both sides of one file, keyed by the both-sides content hash so edits to either side invalidate naturally. Filled lazily by the renderer.
- File
Scope - Enclosing-definition index for one file’s new-side content, keyed by the both-sides hash so edits invalidate it. Drives the sticky scope breadcrumb.
- GitOp
- A network git op the main loop runs by shelling out, with the terminal kept
up: it spawns a blocking task so the event loop keeps drawing, and the
result returns as
AppEvent::GitDone. Set by a push/pull/fetch leaf. - LogView
- Open
Transient - An open transient awaiting its next key.
opened_atis a tick count so the which-key reveal timer never reads a wall clock in render. - Status
Message - Status
View - All state owned by the status screen.
Enums§
- Branch
Action - What selecting a branch in the branch list does.
- CiRequest
- What the main loop should fetch from the CI provider off-thread. Mirrors
GitOp/pending_git: set by the app, taken once by the loop, result returned as anAppEvent. - Comment
Line - One display line of a comment block.
- DiffRow
- One terminal row of the selected file’s diff body. Indices point into the
model the view renders; the row list is rebuilt whenever the selected
file, the model, or the session change, so they never dangle. The
filefield always equals the selected file index, kept so the shareddiff_renderand anchor helpers read it unchanged. - Diff
Source - Flow
- What the main loop should do after an event.
- InputOp
- What an input modal does with its buffer on submit.
- Modal
- Pane
- Which pane has the keyboard: the file sidebar or the diff body.
- Pending
Op - Deferred operation a modal confirms, kept as data (not a closure) so
App::handlestays a pure state transition. - Refresh
State - Lifecycle of the off-thread repo refresh: changes queue while a worker runs, so bursts collapse into at most one follow-up run.
- Row
- One cursor-addressable row of the status screen: section headers, directory
rows, file rows, and — when a file is expanded inline — hunk headers and
diff lines, plus the trailing Recent commits section. Holds an owned
directory path (the fold key), so it is
Clone, notCopy. - Screen
- Screen stack entry. The per-screen state lives in
App::status,App::log, andApp::diff; the stack only decides which one is active. - Section
- Status screen sections, in display order.
- Severity
- Split
Row - One row of the side-by-side diff body.
left/rightindex into the hunk’s lines: a context row carries the same index on both sides, a modified row pairs a deletion with an addition, and a lone deletion or addition fills one side withNone.
Functions§
- comment_
display - The terminal lines a comment occupies. Shared by row flattening (for counts) and rendering (for content) so they can never disagree.