feat(tool-rail): show full tool results in a scrollable box, labels above values - #1394
Merged
Merged
Conversation
…bove values Tool results were cut to 200 characters behind a "Show full result" toggle, with input/result labels in a gutter column beside the values. The detail panel now stacks each label above its value and renders the whole payload in a bounded, keyboard-focusable box that scrolls vertically (text wraps, so no horizontal scroll). Input is shown one `key: value` per line instead of a single truncated line. The boxes are styled in component CSS because the message block's global, unlayered `pre` rules override Tailwind utilities. Label colours move to steps that clear WCAG AA in both themes. Also fixes the JSON highlight pipe, which re-scanned string values with its number rule and rendered "09:30:17" as "09: 30: 17" — previously only visible after expanding a result, now visible by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What changed
The expanded tool-call detail in the tool rail is restructured:
Input/Result(orErrorfor a failed call,Outputwhile generating) now sit above their values instead of in a gutter column beside them, so the payload gets the full width.max-h-80) that scrolls vertically; text wraps (overflow-wrap: anywhere), so long URLs/tokens never cause horizontal scroll. The truncation state and helpers (expandedResultIds,toggleFullResult,isResultExpanded,truncateResult,getResultText) are removed;hasResultBodydecides whether there is text/JSON to show (image-only results render just the image).key: valueper line in its own smaller scroll box (max-h-40) instead of a single truncated line — some tools (e.g. artifact creation) take large inputs.tabindex="0",role="group", labelled) so keyboard users can scroll it, with a focus-visible outline. Label colours moved to steps that clear WCAG AA in both themes (the oldinput:/result:labels failed at ~2.5:1).Why the box styles live in component CSS
styles.csshas unlayered prose rules on.message-block pre(padding 1rem, 0.875rem font, grey background) andhtml.dark .message-block pre(specificity 0,2,2). They override Tailwind utilities on any<pre>inside a message, so.detail-scrollis styled in the component stylesheet, with the dark background under:host-context(.dark)to out-rank the dark rule.Bundled fix: JSON syntax highlight pipe
JsonSyntaxHighlightPipechained per-token-kind regex replaces, so the number rule re-matched text inside string values:"2026-09-30T09:30:17-06:00"rendered as"…09: 30: 17-06: 00". This was only visible after clicking "Show full result"; with results now shown in full by default it would be on every JSON result. Rewritten as a single-pass tokenizer, with a new spec. The pipe is also used by thetool-usecomponent, which gets the fix too.Verification
ng testoversrc/app/session/components/message-list/components/**— 30 files, 369 tests passing (tool-rail spec updated; new pipe spec).styles.cssin light and dark: stacked labels, 320px result box scrolls vertically withscrollWidth == clientWidth, globalprestyles overridden (12px / 6px 8px padding). axe shows no contrast violations on the new labels.For reviewers
axe still flags pre-existing low-contrast
text-gray-400text elsewhere in the rail (header tool count/duration, per-row tool name and duration). Left untouched to keep this change scoped.🤖 Generated with Claude Code