Repository navigation
feat(tui): render the sidebar background-activity strip - #685
Merged
Merged
Conversation
The operator could already move over background tasks with `↑↓` and act on them with `x`/`a`/`d`/`i`, but nothing drew them: `task_selection.task()` was read only by the commands and by focus, never by a renderer, and every caller of the layout passed `background_h = 0`, so the region `layout.rs` reserves for the strip was always zero-height. The keys worked; the rows were invisible. The strip is now a real surface, docked between the outbound-message queue and the composer. It is deliberately not a log: a `[✓]` row retires a minute after it finished, and everything else waits for `x`. Three rules are load-bearing, and each is pinned by a test: - Ordering is blocked -> failed -> active -> queued -> done. `failed` outranks `active` because a failure is the only other state that can need an operator, and truncation takes from the tail, so the rows that get cut are always the ones still progressing or already finished. Naive ordering hides the failure first. - `Cancelled` is not folded into `Done`. Sharing the TTL would have aged out a cancellation the operator never performed (a stopped session, an interrupted turn), leaving no evidence it happened. - The strip yields before the transcript. The renderer only requests a height; `layout.rs` clamps it against the transcript's `Min` floor, so a merely running job can never take a row from the conversation. Blocked rows also name the asker and draw the pending request (tool plus its already-redacted arguments) on a second line, so "task #4 needs approval" becomes "explore wants to run bash". `started_at`/`finished_at` were already on `BackgroundTaskHandle`; the snapshot now carries them for the elapsed column and the expiry clock. Tests: 7 view-model, 5 widget, 2 snapshot. `cargo fmt --all -- --check` and `cargo clippy --workspace --all-targets --locked -- -D warnings` clean.
mohitranka
added a commit
that referenced
this pull request
Sep 14, 2026
A background subagent stopping for approval changed nothing the operator could read. `poll_background_tasks` swept only terminal transitions, so the block was invisible apart from the footer chip's `· 1 need` — a count that does not say who is asking, and which the operator has to notice unprompted. Subagent approvals live on the task (`BackgroundTaskStatus:: WaitingForApproval`), not on the session, so there is no transcript card to relabel: the strip row and the feedback line are the whole surface. The strip row already names the asker after #685; this adds the transition that was missing. - A task newly entering `WaitingForApproval` now raises a warning on the feedback strip and a toast: `explore needs approval: bash`. - Approve, deny and "not waiting" feedback name the task rather than its row id, so answering one of several in-flight agents is unambiguous. - `push_toast` hardcoded `FeedbackSeverity::Ok` for both the toast and the feedback strip it writes. A needs-approval notice would therefore have rendered as a success and clobbered the severity. `push_toast_with` takes the severity; `push_toast` is now a thin `Ok` wrapper. Tests: a subagent that blocks names itself and its tool on the feedback strip with `Warn` severity, and the approval confirmation names the task.
This was referenced Sep 14, 2026
mohitranka
added a commit
that referenced
this pull request
Sep 14, 2026
…ions (#688) The design system described the footer's counts-only chip and referred per-item detail to "the task view", which did not exist as a named surface. The strip now renders (#685, #686) and notifies (#687), so the rules that shipped — and the reason each exists — belong in the design language rather than only in the code. Adds §9.12 (the strip) and §9.13 (out-of-band notification), and points Row 1 of §9.3 at them. The rules recorded are the ones that are load-bearing and easy to undo by accident: the derived height that keeps the transcript's floor, the ordering that stops truncation hiding a failure, `cancelled` staying distinct from `done`, the one-minute expiry, and the focus gate on the notification.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The defect
The operator could already move a selection over background tasks with
↑↓and act on them withx/a/d/i, but nothing drew them.task_selection.task()was read only by the command handlers and by focus, never by a renderer, and every caller of the layout passedbackground_h = 0— soregions.background, the striplayout.rsreserves between the queue and the composer, was permanently zero-height. The keys worked; the rows were invisible.What changed
The strip is now a real surface. It is deliberately not a log: a
[✓]row retires a minute after it finished; everything else waits forx.Three rules are load-bearing, and each is pinned by a test:
failedoutranksactivebecause a failure is the only other state that can need an operator, and truncation takes from the tail — so the rows that get cut are always the ones still progressing or already finished. Naive ordering hides the failure first.Cancelledis not folded intoDone. Sharing the TTL would have aged out a cancellation the operator never performed (a stopped session, an interrupted turn), leaving no evidence it happened.layout.rsclamps it against the transcript'sMinfloor, so a merely running job can never take a row from the conversation.Blocked rows also name the asker and draw the pending request — the tool plus its already-redacted arguments — on a second line, so "task #4 needs approval" becomes "explore wants to run bash".
Notes for the reviewer
started_at/finished_atalready existed onBackgroundTaskHandle; the snapshot now carries them for the elapsed column and the expiry clock. No other crate constructs the struct, so the field addition is additive.layout.rsis a no-op atbackground_h = 0, which is why the 22 existing layout tests still pass unchanged.Verification
crates/forge-tui/src/tasks_strip.rs), 5 widget tests (crates/forge-tui/src/widgets/background_strip.rs), 2 snapshot tests.cargo fmt --all -- --checkclean.cargo clippy --workspace --all-targets --locked -- -D warningsclean.app::tests::taskstests fail because this machine refuses to apply the tool sandbox, so spawning a real background shell fails. They fail identically on the base commit (verified by stashing), and CI installs sandbox dependencies.