fix(ui): stop tool-well copy button colliding with long first lines and titles - #3699
Open
GabrielDrapor wants to merge 3 commits into
Open
fix(ui): stop tool-well copy button colliding with long first lines and titles#3699GabrielDrapor wants to merge 3 commits into
GabrielDrapor wants to merge 3 commits into
Conversation
A headerless Astryx CodeBlock floats its copy button over the scroll viewport's top-right corner, so a long unbroken first line (a maka://archive URI, a long command) rendered straight under the button. Reserve the button's footprint with a float on the first line: wrapped text flows around the corner instead of colliding. Anchored on the line div rather than <code> because 100+ line blocks wrap lines in content-visibility chunks whose layout containment would stop an outer float from shortening their line boxes. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VqBZ8cP7wMpy1mXTrn3VDg
The first fix covered headerless wells; the reported overlap is in the HEADERED variant. A result headline title (often a long unbroken maka://archive URI) is a flex span with white-space: pre and visible overflow, so it runs under the header's copy button — and headerCompact draws no divider, so it reads as the well's first content line. Ellipsize the title inside the flex slot the header already sizes. Verified live against the packaged app via devtools: title now ends at the button's edge with an ellipsis. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VqBZ8cP7wMpy1mXTrn3VDg
Codex review P2: white-space: nowrap collapses runs of spaces, so a title like 'report final.txt' displayed as a different path — and the title is its only display (the copy button copies the body). Both pre and nowrap satisfy text-overflow's no-wrap requirement; keep pre. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VqBZ8cP7wMpy1mXTrn3VDg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In tool-call detail wells, a long unbroken line — typically a
maka://archive/tool-result-archive-…URI — collides with the well's copy button. Two distinct layouts produce the same visual overlap:white-space: preand visible overflow. The compact header draws no divider, so the title reads as the well's first content line — and runs straight under the header's copy button, then hard-clips at the container edge.copyButtonAbsolute), and wrapped content's first line passes under it — the wrap point is the container edge, not the button edge.Before
After
Fix (CSS only, scoped to
.maka-tool-call-detail)flex: 1/min-width: 0on its wrapper).display: blockbecause a flex container will not ellipsize its anonymous text; tool wells never render the collapsible chevron that the flex display exists for.white-spacestayspre— bothpreandnowrapsatisfytext-overflow's no-wrap requirement, butnowrapwould collapse runs of spaces, and a title is often a literal path wherereport final.txtandreport final.txtare different names (this was a review finding, see below).float: inline-end::beforeon the first line, so wrapped text flows around the corner. The lengths are the button's geometry, not tunables: the 28px sm IconButton insetspacing-2ends 20px past the code'sspacing-4inline padding (+8px gap), and its bottom edge sits 36px −spacing-3= 24px below the first line's top. Anchored on the line div rather than<code>because 100+-line blocks wrap lines incontent-visibilitychunks whose layout containment would keep an outer float from shortening their line boxes. Logical properties throughout, so RTL follows the button (inset-inline-end).This mirrors the doctrine already recorded for markdown code blocks (styles.css: markdown always gives CodeBlock a structural header "instead of overlaying the horizontal scroll viewport") while keeping tool wells quiet — no added header chrome.
Verification
--size-element-sm,spacing-2/3/4), the header-class guard, RTL, consumer scope, and cascade order; its one P2 —nowrapcollapsing literal spaces in path-like titles — is fixed in the third commit by keepingwhite-space: pre.npm run format:checkclean.Known trade-off: an ellipsized title's full value is no longer fully visible; it was not readable before either (hard clip + button overlap), it is excluded from the copy button's payload in both states (
pickHeadlineconsumes it out of the body), and text selection still yields the full string. If the full headline should be hover-recoverable, a nativetitletooltip needs a smallToolCodeBlockcomponent change — happy to follow up if preferred.Co-Authored-By: Claude noreply@anthropic.com
https://claude.ai/code/session_01VqBZ8cP7wMpy1mXTrn3VDg