Skip to content

fix(desktop): keep code and diffs out of the tool overflow window - #71678

Merged
OutThisLife merged 1 commit into
mainfrom
bb/code-block-overflow
Jul 26, 2026
Merged

fix(desktop): keep code and diffs out of the tool overflow window#71678
OutThisLife merged 1 commit into
mainfrom
bb/code-block-overflow

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Summary

A run of 3+ adjacent tool calls collapses into the 6.75rem .tool-group-scroll window added in #57913. That's the right call for status rows, but a patch / write_file / execute_code / read_file row's body is a code block the user reads, and the window squeezed it into a ~2-row viewport behind a fade mask.

This extends the existing UNBOUNDABLE_TOOLS opt-out — the same mechanism #64679 used for clarify forms and #65142 used for generated images — to the code-bearing tools.

Why the existing break-out isn't enough

.tool-group-scroll:has([data-tool-row][data-tool-open]) already lifts the cap once a row is expanded, and it works — that's why most tools are safe to bound, and this PR leaves them bounded.

It can't cover this case. clarify / image_generate render their own components and never emit data-tool-row, so the rule can't reach them at all. The code tools do emit it, but the user has to first notice the clipped block and expand it before the code is legible — reading a diff shouldn't require discovering an affordance.

Notes

  • terminal stays boundable on purpose. Console output is a log tail whose last lines are the ones that matter, which is exactly what the window pins. Exempting it too would swallow the feature whole, since nearly every long run contains one.
  • The file-edit names are derived from the existing isFileEditTool rather than re-listed, so a newly supported edit tool can't be exempt in one place and clipped in the other.
  • UNBOUNDABLE_TOOLS is no longer exported; isUnboundableTool is the single entry point.

Test plan

Verified in Chrome against the app's compiled Tailwind CSS (measuring real laid-out height, since jsdom does no layout). A 3-call run carrying a 520px diff:

rendered content clipped
before (bounded) 108px 520px yes
after (unbounded) 520px 520px no
  • npx vitest run src/components/assistant-ui — 209 passed
  • npx tsc --noEmit clean
  • npx eslint clean

Unit tests assert the invariant (every isFileEditTool name is unboundable; terminal / web_search still bound) rather than snapshotting the set's contents.

A run of 3+ adjacent tool calls collapses into the 6.75rem
`.tool-group-scroll` window. That is right for status rows, but a patch
or execute_code row's body is a code block the user reads, and the
window squeezed it to a ~2-row viewport behind a fade mask.

The CSS break-out (`:has([data-tool-row][data-tool-open])`) already
lifts the cap once a row is expanded, which is why most tools are safe
to bound. It can't help here: the user has to notice the clipped block
and expand it before the code is legible.

Extend the existing UNBOUNDABLE_TOOLS opt-out to the code-bearing tools
behind an `isUnboundableTool` predicate, deriving the file-edit names
from `isFileEditTool` so a newly supported edit tool can't be exempt in
one place and clipped in the other. `terminal` stays boundable: console
output is a log tail whose last lines are the ones that matter, which
is exactly what the window pins.

Verified in Chrome against the app's compiled CSS: a 3-call run
carrying a 520px diff rendered at 108px before, full height after.
@OutThisLife
OutThisLife enabled auto-merge July 26, 2026 01:40
@OutThisLife
OutThisLife merged commit a288fc3 into main Jul 26, 2026
30 checks passed
@OutThisLife
OutThisLife deleted the bb/code-block-overflow branch July 26, 2026 01:42
@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 7f29710

ℹ️ Info

Desktop E2E visual evidence · View test artifacts · View job

1 visual diff.

inline evidence is publishing...

@alt-glitch alt-glitch added type/bug Something isn't working comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have labels Jul 26, 2026
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…-overflow

fix(desktop): keep code and diffs out of the tool overflow window
prmartinow pushed a commit to prmartinow/hermes-agent that referenced this pull request Aug 26, 2026
…-overflow

fix(desktop): keep code and diffs out of the tool overflow window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants