Skip to content

Studio: set thinking traces apart from the answer and give tool rows kind icons - #13545

Merged
shimmyshimmer merged 11 commits into
mainfrom
studio-thinking-trace-contrast
Oct 13, 2026
Merged

shimmyshimmer merged 11 commits into
mainfrom
studio-thinking-trace-contrast

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Summary

The thinking trace and tool rows read too close to the answer, most of all in dark mode, where the trace was #b0b0b0 against #dfdfdf body text. Generic tool rows also showed a check mark that said nothing "Used tool" did not already say, and it sat brighter than its label.

Trace ink. A new text-trace-foreground colour is --muted-foreground mixed toward the page background: 20% in light, 30% in dark. It is used by the Thinking / Worked for header, the trace text, "Show full thinking", and the tool row and tool group headers. Hover still lifts them to full foreground. Because it is derived from the existing tokens, palettes and the contrast slider still apply.

Answer L Trace L before Trace L after Gap before Gap after
Light 0.27 0.55 0.64 0.28 0.37
Dark 0.90 0.76 0.59 0.14 0.31

(OKLab lightness, read from the computed styles of the built CSS.)

Tool row icons. A finished generic tool row now shows what kind of tool ran instead of a tick: the globe already used by web search for browser_* tools, a wrench for everything else. Running, failed, cancelled and needs-approval rows keep the spinner, X and alert icons. The icon now takes the row's trace colour instead of full foreground.

Expanded tool content. A tool row's arguments and result had no colour or size of their own, so they inherited the answer's full foreground and the row's 14px. They now use the trace colour and text-xs, the size every other tool output (live output, Python, terminal) already uses. An explicit code font size from Appearance still overrides it.

Expand thinking. "Show full thinking" is now an "Expand thinking" toggle with the header's chevron after the label: right while bounded, down once expanded. Once expanded it reads "Collapse thinking", so the button no longer disappears. It sits in muted ink, a step above the trace text, so it reads as an action without a border or fill.

Expanding used to set the block's open override, and reasoningTailCapped lifted the cap for any override. So after one Expand, and after any hand-open, the block showed the full trace with no way back to the bounded tail. The bound now depends only on the auto setting, a per-block tailExpanded lifts it, and a new round starts bounded again. Expand still pins the block open, so it does not close under the reader when the stream ends.

Expand thinking under a hand-opened trace

Checked in a running Studio on a saved trace: a hand-open shows the tail with Expand thinking, and Expand, Collapse, Expand toggles data-capped and the label each time.

The old tick was also off centre: its path sits about 0.75 units low in the 24-unit box, which measured 0.56px below the cap centre of the "Used tool" label at 14px Inter. The kind icons replace it in these rows; the shared tick used by menus is unchanged.

Screenshots

Before (left) and after (right), light mode. The trace text and tool rows step back from the answer; tool rows show a globe for browser tools and a wrench for others.

Light mode before and after

Dark mode, where the trace was nearly the answer's colour before:

Dark mode before and after

Testing

  • npm run typecheck, npm run build pass
  • npm test: 11817/11817 pass (reasoning-live-tail.test.ts updated to the new toggle rules)
  • Biome: no new diagnostics on the changed files versus main

Not tested here

The screenshots render the built CSS with the real markup and icons on a static page. A live trace needs a loaded model, which this CPU host did not run.

shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 13, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 13, 2026
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T15:59:01.113917Z 1e5dd8c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20f5e81add

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

--color-accent-foreground: var(--accent-foreground);
--color-accent: var(--accent);
--color-muted-foreground: var(--muted-foreground);
--color-trace-foreground: color-mix(in oklab, var(--muted-foreground), var(--background) var(--trace-fade, 0%));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Maintain AA contrast for trace text

The new background mix reduces the default light-theme trace color to approximately #8b8b8b on #fefefd, a contrast ratio of only 3.36:1; the dark default is also only about 4.37:1. Both are below the 4.5:1 threshold for the 12–14px reasoning text, “Show full thinking” control, and tool labels now using this token, making core chat content difficult to read for low-vision users. Keep this text token sufficiently separated from the background while preserving the intended distinction from answer text.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intended: the trace is deliberately quieter than the answer so the two read apart, as ChatGPT's trace does. It is secondary content that is collapsed by default, hover lifts it to full foreground, and the dark value stays near 4.4:1.

shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 13, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 13, 2026
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 13, 2026
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8836bbc341

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

expanded={tailExpanded}
onExpandedChange={(expanded) => {
setTailExpanded(expanded);
if (expanded) handleOpenChange(true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep tail expansion from pinning auto reasoning open

When thinkingVisibility is auto and the user clicks Expand thinking during streaming, this call reaches setOverride(true) through handleOpenChange, so resolveReasoningOpen continues returning true after streaming ends instead of auto-closing the block. Clicking Collapse thinking only clears tailExpanded and leaves that override intact, so the block still remains open; expanding the tail should lift only the height cap rather than record a manual header-open.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intended: Expand keeps the block open so it does not close under the reader when the stream ends, the same as Show full thinking on main; Collapse only restores the bounded view, and the header still closes the block.

shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 13, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@shimmyshimmer
shimmyshimmer merged commit fa168bb into main Oct 13, 2026
@shimmyshimmer
shimmyshimmer deleted the studio-thinking-trace-contrast branch October 13, 2026 15:28

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e5dd8ccf4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


// null until toggled by hand, then it outranks the setting for the round.
const [override, setOverride] = useState<boolean | null>(null);
const [tailExpanded, setTailExpanded] = useState(false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset tail expansion when visibility changes

When a user expands an auto block and then changes the thinking visibility (for example, auto → expanded → auto during a stream), the lastVisibility branch clears only override, so this new tailExpanded state remains true. Returning to auto therefore leaves the trace uncapped instead of handing the block back to the newly selected preference; reset tailExpanded alongside override when visibility changes.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #13625: a visibility change now resets the Expand state along with the hand override.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: fa168bbf4d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

2 participants