Skip to main content

Module engine

Module engine 

Source
Expand description

The headless engine behind git queue tui.

The engine owns the editing state of the current queue line — the ordered commit sequence (front/oldest → tip) and the branch boundaries over it — and (in later tickets) the undo/redo stack and the operations that mutate git. It is deliberately headless: it touches git/meta but never the terminal, so the interactive view sits in front of it and tests drive it in-process (via lib.rs) instead of spawning the binary.

This ticket is the scaffold: load the current line into the model and guard the entry conditions. The operations-as-data type is defined even where its variants are not yet applied — later tickets fill in apply.

Structs§

Boundary
A branch boundary over the commit sequence: name owns the contiguous run of commits ending just before index end (its exclusive upper bound into EditableLine::commits). Boundaries are front → tip, their ends strictly increase, and the last one’s end equals the commit count.
Commit
One commit of the loaded queue line.
EditableLine
The loaded queue line: the commit sequence and the boundaries over it.
Engine
The headless editing engine over the current queue line.
SplitLine
One display line of the split selector. Selectable lines (Added/Removed) carry a dense change_index used to express the selection.

Enums§

Applied
The outcome of applying an operation.
Operation
An edit expressed as data. The view produces these from user input; the engine applies them. Every variant the TUI will ever perform is named here so undo becomes a snapshot↔operation pair and the engine stays directly testable — but this scaffolding ticket does not yet apply any of them (see Engine::apply). Later tickets fill the variants in, roughly in the spine order: boundary edits (ref-only) → reorder/reword/delete → squash → split → undo/redo.
Row
A row of the queue pane, indexing back into an EditableLine.
SplitKind
The kind of a line in the split selector’s rendering of a commit’s diff.