Documentation
¶
Overview ¶
Package activity is the root's own record of what has happened this session — every promotion started, landed, blocked or failed, every abandon, every browser-launch outcome — kept as an append-only, capped Log (AGENTS.md §4.8) rather than the single transient "notice" string app.Model carried before this package existed.
The old convention (app.Model.notice) showed exactly one message, cleared unconditionally on the operator's very next keypress — so a real refusal (an in-flight conflict, a missing repos[].github, a claim conflict) that arrived a beat before an unrelated "j" or "k" was simply gone, with no way to read it again short of re-running the equivalent command on the CLI (#164 was the first half of this; this package is the second). Log.Add never drops an entry on a keypress — only once the log's own cap (50) is exceeded, oldest first — and Model is the screen (l on the matrix, AGENTS.md §9 entry 10's own "one verb per concept" keymap) that reads every entry back in full, redacted and wrapped but never truncated.
app.Model's own bottom row (View, replacing the old notice rows) shows only the latest entry's text, one line, plus a "l: activity (N)" hint — not cleared by a keypress either, only ever replaced by a newer entry or dismissed by opening the log itself.
Index ¶
Constants ¶
const Cap = 50
Cap is the maximum number of entries Log keeps. Add drops the oldest once full.
Variables ¶
This section is empty.
Functions ¶
func Lines ¶
Lines renders every entry in log as plain wrapped text, oldest first — the activity screen's own derived data, with no terminal dependency (AGENTS.md §4.8: "a screen's derived data … lives in a file with no terminal dependency", the same split matrix/cells.go uses), so a test can assert an exact row count and which rows hold a given line without a viewport or a Frame in the way. Nothing here truncates: a long Detail (a full transport error) wraps onto as many rows as it needs — the screen scrolls, it never drops the tail (contrast ui.Frame's own section-trimming, AGENTS.md §9 entry 10, which is about a FIXED number of terminal rows, not this scrollable content inside one of them). now ages every entry (ui.Ago); a test pins it. Every string is redacted here, once, at this render boundary (pkg/redact), the same convention app.Model.View and flight.Model.View already use.
Types ¶
type BackMsg ¶
type BackMsg struct{}
BackMsg is emitted on esc; the root pops the screen (internal/app/app.go — l, handled generically for any keyed screen, is what pushes it: the same New-on-open, adapter-in-app.go shape every other read-only screen in this package uses, config.Model in particular).
type Entry ¶
Entry is one thing the session reported: a promotion started (naming its PR when one already exists), landed, blocked, failed or abandoned, or a browser-launch outcome. Text is the short summary the bottom row can show on one line; Detail is the full text a summary would otherwise lose — a complete transport error, in particular — shown only in the activity screen itself, wrapped but never truncated (AGENTS.md §8, "verify the output, not the instrument": a summary that silently ate the reason would be exactly the #164 shape this package exists to end). URL is set when the entry names a link (a PR) — both the bottom row and the activity screen show it. Every string here is redacted at render time (pkg/redact), never at construction, so Log.Add never has to know redaction happened.
type Kind ¶
type Kind int
Kind classifies one Entry for the activity screen's own styling and the bottom row's own short summary — Err in the error color, OK in the success color, Info plain.
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
Log is an append-only, capped history of Entry values (doc.go's own "Design" section) — a value type, copy-on-append like session.Controller (AGENTS.md §4.8): Add never mutates the receiver's backing array, so an older Log a screen still holds (Model.New takes one by value, doc comment) never observes a later Add.
func (Log) Entries ¶
Entries returns every entry, oldest first. The caller must not mutate the result.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the activity log screen (l on the matrix and, per the proposed keymap, every other screen — docs/audit/2026-09-ux-arch-audit.md "Proposed keymap"). It shows every Entry the root's own activity.Log has recorded, oldest first, full text, redacted and wrapped but never truncated (Lines' own doc comment) — the operator's way to read a result or an error in full once the bottom row's own one-line summary is all that is left on screen. Value-typed like every other screen (AGENTS.md §4.8).
New takes a snapshot of the log as it stood when the operator pressed l, not a live feed: like config.Model's own already-marshalled text, what this screen shows is exactly what the root held at the moment it opened, never re-fetched or updated in place while it's open. An entry added while the log is open next shows the next time l is pressed.
func New ¶
New builds the screen over log. now ages every entry (ui.Ago); nil defaults to time.Now, and every real caller (app.go) supplies one, mirroring every other relative-time screen's own convention (AGENTS.md §4.8).
func (Model) CapturesText ¶
CapturesText is false: no key on this screen is text.
func (Model) SetSize ¶
SetSize records the terminal size and sizes the viewport to what the frame leaves.