NEXT: agent service notices sit above the composer, not over the transcript

Merged
TE
4d ago
+271-87

Leo, on the "This chat runs on another cmux install's agent service. Approve its requests in that app." notice: "yuck more garbage".

#31476 / #31481 made that line show only while a request waits, but when it shows it is still a background-less native label laid over the page, on top of the first user bubble. The remote-approvals and peer-approvals notices (AgentPaneView+RemoteApprovals.swift) used the same floating layout.

What changed

  • The pane no longer adds any view for these notices. It pushes them to the page as a paneNotices event (page host) or applyPaneNotices (legacy host): a list of {id, title, detail?, button?, enabled?}. The list is replayed on reload and handshake.
  • The page draws each one as a card in its existing notice slot above the composer (PaneNotices.tsx), using the harness notice's neutral card. The card sits in the layout flow, so it takes up space and never covers transcript content.
  • The card's button (Restart with approvals, Enroll this Mac) sends pane.noticeAction {id} back to the app. It only runs on the person's own click (page-host gesture or legacy gesture credit), and stays disabled while its action runs. A failure updates the detail line, as before.
  • The text and the show/hide conditions are unchanged.

Tests

  • Swift AgentPanePeerApprovalsNoticeTests.theNoticeIsThePagesNotAViewOverTheTranscript: showing either notice must not change the pane's subviews, and the replayed events must carry the notice. The overlay version added a subview, so it fails this test.
  • Swift thePagesButtonRunsTheNoticesAction: request decoding, the gesture check, and the action.
  • Web PaneNotices.test.tsx: malformed rows are dropped, cards render in the slot's flow with the card class, the button calls back, a disabled state shows, and an empty list renders nothing.

Observed / Not run

  • Ran on the fleet: package-test-lane.sh suite Packages/macOS/CmuxNext AgentPanePeerApprovalsNoticeTests,AgentPaneOtherInstallNoticeTests, plus webviews bun test for the new test and bun run check. Results are in the comments.
  • Not run: a live DEV build against another install's daemon. No capture.

Changelog

Fixed: The "runs on another cmux install" and remote approvals notices now sit above the composer instead of floating over the chat.

Agent session: agent session

šŸ¤– Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Moves the "runs on another cmux install" and remote/peer approvals notices from floating native labels over the transcript into the page's notice slot above the composer, so they no longer cover chat content.

  • The pane pushes notices to the page as paneNotices events (or applyPaneNotices on the legacy host), replayed on reload and handshake; the pane adds no view of its own.
  • The page renders each notice as a card in the existing notice slot, in layout flow above the composer.
  • The card's button (Restart with approvals, Enroll this Mac) calls back as pane.noticeAction {id}, runs only on the person's own click, and stays disabled while its action runs; failures update the detail line.
  • Notice text and show/hide conditions are unchanged.

Tests cover no overlay subviews, event replay, button action and gesture checks (Swift), and card rendering, malformed rows, and disabled state (Web).