Skip to content

feat(terminal): Mouse Mode Submit button for agent terminal panes (#819) - #823

Merged
Juliusolsson05 merged 5 commits into
mainfrom
feat/mouse-mode-terminal-submit
Sep 7, 2026
Merged

feat(terminal): Mouse Mode Submit button for agent terminal panes (#819)#823
Juliusolsson05 merged 5 commits into
mainfrom
feat/mouse-mode-terminal-submit

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

Closes #819.

What

Adds a Mouse Mode-gated Submit row so a mouse-only user can press Enter inside an agent terminal pane (AgentTerminalLeaf) after dictating or pasting a command into the raw PTY. Clicking Submit routes the Enter byte ('\r') through the existing keypress pipeline (terminalInputForwarder + the pre-attach pendingInput queue), so a mouse click and a real Enter are byte-identical to the backend — no read/clear of any draft (terminal view has none by design), no new setting (reuses mouseModeEnabled), zero layout change when off.

Scope

  • AgentTerminalLeaf only. Added: src/renderer/src/workspace/tile-tree/AgentTerminalActions.tsx (+ colocated test) and wiring in AgentTerminalLeaf.tsx (selector, a ref the mount effect publishes the routing closure on, and the gated row).
  • TerminalLeaf (plain shells) and ComposerActions are byte-identical — confirmed via git diff against main.
  • Stop button deliberately out of scope (deferred follow-up — interrupt semantics differ per TUI).

Design/plan

  • docs/superpowers/specs/2026-09-05-mouse-mode-terminal-submit-design.md
  • docs/superpowers/plans/2026-09-05-mouse-mode-terminal-submit.md

Verification (Node v24.14.1, matching .nvmrc/CI)

  • npm run typecheck (control-sdk + tsc -b): exit 0
  • npm run test:renderer: 123 files / 522 tests passing (baseline 121/514, +2 files/+8 tests)
  • node scripts/verify-submodule-checkouts.mjs: verified

Tests added

  • AgentTerminalActions.renderer.test.tsx (5): renders one always-enabled button, mousedown preventDefault (xterm focus preserved) + still bubbles (leaf engagement), click fires onSubmit, composer scaffold classes.
  • AgentTerminalLeaf.submit.renderer.test.tsx (3): button hidden when mouse mode off; sends '\r' to the PTY after attach when on; queues a pre-attach Submit and delivers it on attach.

Note for maintainers/reviewers: this repo's renderer suite requires Node 24. Node 25 (this machine's default) breaks happy-dom's localStorage with 34 spurious storage.setItem is not a function failures.

Do not merge — awaiting explicit maintainer confirmation.

@Juliusolsson05 Juliusolsson05 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the full diff against the mouse-first workspace plan and #819's acceptance criteria.

  • Submit routes '\r' through the same forwarder + pre-attach queue the keyboard uses, so a click before attach is queued and a click during replay is dropped exactly like a keypress. The closure reads forwarder.replaying and attachedBackfillDone at call time, so no stale capture.
  • TerminalLeaf.tsx and ComposerActions.tsx are byte-identical to main (checked with git diff origin/main...HEAD).
  • Merged current main (23 commits) into the branch: no conflicts; npm run typecheck clean; the two new test files pass on Node 24 (8 tests).
  • One observation, not a blocker: the leaf test detects the Node 25 happy-dom problem only in the PR body. .nvmrc already pins 24, so nothing to change.

Approve. Waiting for the maintainer's merge confirmation per repository policy.

@Juliusolsson05
Juliusolsson05 merged commit fcb8d0c into main Sep 7, 2026
2 checks passed
@Juliusolsson05
Juliusolsson05 deleted the feat/mouse-mode-terminal-submit branch September 7, 2026 22:02
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.

feat(terminal): Mouse Mode Submit button for agent terminal panes

1 participant