Skip to content

✨ feat(bots): SOUL and TEAM approvals show a diff, and approval cards fit on mobile - #386

Open
diegojohnsonl wants to merge 3 commits into
custom-nightlyfrom
feat/bot-soul-diff
Open

diegojohnsonl wants to merge 3 commits into
custom-nightlyfrom
feat/bot-soul-diff

Conversation

@diegojohnsonl

@diegojohnsonl diegojohnsonl commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

When a Bot changed a SOUL or the TEAM rules, the approval showed the whole new text. You could not see what was removed or reworded. The web card also ended with a "Scroll to read all of it." note jammed between the text and the buttons.

On mobile, a long approval from a subagent pushed Cancel, Decline and Approve out of reach. The panel was capped at 320pt, and the card scrolled inside it. Three full-width buttons stacked vertically took most of that room. The title showed the raw request kind "mcp-elicitation".

What changed

  • Server (bots/handlers.ts): the approval now says "Change the SOUL of …" and carries a unified diff from the saved text, with one line of context. jsdiff's "No newline at end of file" marker shows only when the trailing line break is the change itself. The approval state now also covers the saved SOUL and TEAM, so if either changes before the user answers, the user is asked again.
  • Shared (client-runtime):
    • approvalDiffLines splits approval text into lines and marks hunk headers, added lines and removed lines. Text without an @@ -a,b +c,d @@ header is left alone, so command approvals look the same as before.
    • APPROVAL_KIND_LABEL holds readable titles such as "App access approval", used by both web and mobile.
  • Web:
    • Diff lines get the theme's addition and deletion colors.
    • A box that overflows fades at the edge and shows a Show all / Show less toggle instead of the scroll note.
    • The status row has more space above it.
  • Mobile:
    • Diff lines get green and red tints.
    • Approval text shows eight lines, fades into the card, and opens in place with Show all / Show less.
    • The buttons sit in one row, each sized to its label. Equal-width buttons made Android wrap "Approve" as "Approv / e".
    • The subagent approval panel gets the available height, minus the floating control's strip, instead of 320pt.
    • The floating "Subagent needs approval" pill no longer points at approvals the panel already shows. It still points at subagent questions.
    • The card title uses the readable label when the app sends no name.

Before / after

Web before:
before

Web after, collapsed (the first change is visible without expanding):
after collapsed

Web after, expanded (taken before context was cut from 3 lines to 1):
after expanded

Mobile (Android), a subagent's SOUL approval: collapsed, expanded, and expanded scrolled to the buttons:

Verification

  • A real dev server ran a Claude Haiku thread that called bot_update on a test Bot twice: once for a full rewrite and once for an edit. Both approvals rendered as diffs on web, and approving them saved the change.
  • On an Android emulator, a Haiku parent thread delegated a child that asked to change a Bot's SOUL. The subagent approval showed the title, the faded diff and all three buttons with no scrolling. Show all and Show less worked. The panel stayed below the floating control.
  • threadRequests.test.ts, threadShell.test.ts, bots/handlers.test.ts, and the approval cases in MessagesTimeline.browser.test.tsx pass. Typecheck passes for client-runtime, server, web and mobile. Lint, format and i18n:check pass.
  • iOS was not run. The layout uses no platform-specific code.

🤖 Generated with Claude Code (Claude Opus 5.5, in T3 Code)

@diegojohnsonl diegojohnsonl changed the title ✨ feat(bots): SOUL and TEAM approvals show a diff of what changes ✨ feat(bots): SOUL and TEAM approvals show a diff, and approval cards fit on mobile Dec 5, 2026
diegojohnsonl and others added 3 commits December 4, 2026 19:56
A Bot SOUL or TEAM change asked the user to approve the whole new text, so
nothing showed what was removed or reworded. The approval now carries a
unified diff from the saved text, with one line of context, and web and
mobile draw its added and removed lines in color. The approval is bound to
the saved documents it was drawn from, so a change to them asks again.

Approval text that overflows its box now fades and offers Show all / Show
less in place of the "Scroll to read all of it." note, and the status row
gets room from the text above it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A long approval filled the subagent panel, which was capped at 320pt, so
Cancel, Decline and Approve sat below a small scroll window. The floating
"Subagent needs approval" pill sat on the panel's top edge, and the title
showed the raw request kind "mcp-elicitation".

- Approval text shows eight lines, fades into the card, and opens in place
  with Show all / Show less, like the web card.
- The buttons sit in one row, each sized to its label.
- The subagent panel gets the available height, minus the floating
  control's strip, instead of 320pt.
- The pill no longer points at approvals the panel already shows.
- Web and mobile share readable approval titles from client-runtime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The approval card showed each hunk's "@@ -2,18 +2,3 @@" header, line
numbers a reader has no use for. Web and mobile now leave the header out
and show only the removed, added and unchanged lines. The server still
sends it, since it marks where the diff starts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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