Skip to content

Background task UI: task bar, keys, suggestion strip, manager, output views (#382) - #384

Closed
raiseCatError wants to merge 6 commits into
feature/background-tasks-corefrom
feature/background-task-ui
Closed

raiseCatError wants to merge 6 commits into
feature/background-tasks-corefrom
feature/background-task-ui

Conversation

@raiseCatError

@raiseCatError raiseCatError commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Second slice of #382, stacked on #383. Pure presentation and input logic (bar.ts, suggestion.ts, view.ts, manager.ts); no shared files touched. Design: docs/design/background-task-ui.md.

  • Task bar above the composer: nothing when empty; one summary row collapsed (● 3 background tasks · 2 running · 1 failed); expanded up to four rows with overflow; reserved rows = drawn rows; marks + words per state (Safe/NO_COLOR complete).
  • Keys: Up enters the bar only from an idle composer (empty draft, not browsing history, no foreground command running or waiting for input, no other owner) — the same rule the agent shelf already uses — so drafts, history and foreground input are untouched; Shift+Up and /background always work; in the bar ↑↓, Enter view, x stop then the next escalation by name, Delete removes finished tasks only, Esc back, other typing returns to the composer unlost.
  • Suggestion strip: Enter keeps the normal foreground path (double Enter = old behavior); b once, a always, n never, Esc edit; states that a background run has no aliases/functions/unexported variables. /background run keeps the command byte for byte and refuses terminal-bound programs.
  • Output: per-task NMSh-owned transcript block (folded/dropped counts, plain copy) and a focused live view that follows until scrolled back and counts new lines.
  • Manager (/background, /bg): tasks + details + stop/remove/clear; preferences incl. per-family decisions.
  • Security: commands, families and directory names render through stripTerminalControls (from a review of this slice; tested with OSC/CSI/bidi payloads in command and cwd).

Tests: tests/backgroundTaskUi.test.ts (plus the core suites: 23/23 locally). Remaining: TerminalApp/service integration after #359's checkpoint; adopting #369's action controls; physical QA.

Update (85ac421), quality and security pass: the /background manager selected by row index, so a task starting or finishing made x/Delete act on a task the person never chose (reproduced: t1 selected, a new task, x stopped t2); selection is a task id now. The output view kept a scrolled-back position as a row index and drifted at the retention limit; it is anchored to the line's seq. A double press or held x went from SIGINT to SIGKILL at once; stronger signals wait 1.5 s (ESCALATION_PAUSE_MS). Finished tasks with processes left offer x kill what is left and cannot be removed while they run. Narrow rows keep the task label, hints drop whole entries and keep Esc, the manager list scrolls, the view shows the progress line, removal selects the neighbour, /background parsing is linear. Regressions in tests/backgroundTaskUi.test.ts. CI green on 85ac421.

…put views

#382, stacked on the background tasks core. Pure presentation and input
logic; the running app is unchanged until integration.

- Task bar above the composer: no rows when empty, one summary row
  collapsed, at most four expanded with an overflow row; rows reserved
  always equal rows drawn; every state has a mark and a word.
- Keys: Up enters the bar only from an idle composer (empty draft, not in
  history, no foreground command, no other owner), the rule the agent shelf
  already uses; Shift+Up and /background always work. In the bar: select,
  Enter view, x stop and then the next escalation by name, Delete removes
  finished tasks only, any other typing returns to the composer unlost.
- Suggestion strip: Enter keeps the foreground path, b/a/n for background
  once, always, never; it says a background run has no aliases, functions or
  unexported variables. /background run keeps the command byte for byte and
  refuses programs that need the terminal.
- Output: an NMSh-owned transcript block per task with folded and dropped
  counts, and a focused live view that follows until scrolled back.
- Manager: tasks with details and stop/remove/clear; preferences including
  per-family decisions.
- Commands, families and directory names are drawn through
  stripTerminalControls (found by a security review of this slice).
…ut, escalation is paced, narrow rows keep the task

- The manager selected by row index; a task starting or finishing reordered the list, so x or Delete acted on a task
  the person never chose (with t1 selected, a new task made x stop t2). Selection is a task id now.
- The output view anchored a scrolled-back position to a row index; at the retention limit every new line moved the
  text being read. It is anchored to the line's seq, and says when those lines were dropped.
- A double press or held x went from SIGINT to SIGKILL at once; stronger signals wait 1.5 s after the previous request.
- A finished task with processes left offers x to kill them and is not removed while they run.
- At 40 columns a stopping task's label disappeared behind its state words; key hints drop whole entries and keep Esc;
  the manager list scrolls with the selection; the view shows the unfinished progress line; removing a task selects
  its neighbour; the hint names Shift+Up when Up is off.
- /background parsing trimmed with a quadratic regular expression; it uses trimEnd.
raiseCatError added a commit that referenced this pull request Oct 11, 2026
…sk quality and security pass

New heads for #375-#378, #383 and #384; a prioritized findings table with the fixes and their commits; the
investigated locations that are not vulnerabilities (the demo renderer, configAssist.ts:164, the session socket, Git
in untrusted repositories, dependencies); what cannot be validated before integration; and the contract changes
Codex needs at integration, including one precedence for Up from an idle composer.
@raiseCatError

Copy link
Copy Markdown
Owner Author

Integrated, not merged here: this head (85ac4210) is part of the release line that shipped in v0.20.0 through the authoritative release PR #392 (merge commit 65e4de55). Closing because its changes reached master by that route; the branch is kept for history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant