Skip to content

Studio: one tooltip design everywhere, matching chat's text colours in light and dark - #14172

Merged
shimmyshimmer merged 12 commits into
mainfrom
studio-tooltip-contrast
Oct 19, 2026
Merged

shimmyshimmer merged 12 commits into
mainfrom
studio-tooltip-contrast

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Fixes #13997.

What changed

Every tooltip in Studio was black in both themes. In light mode that looked out of place. In both themes, secondary lines such as a model's local path or a chip's description used a grey that was hard to read on black. Many controls also showed the browser's own native tooltip instead of Studio's, for example Approve for me in the chat composer.

  • Light mode: tooltips are white with a soft shadow and no border.
  • Dark mode: tooltips are black (#000000), flat, with no shadow.
  • Text colours: main text is chat's normal text colour in both themes. Secondary text (paths, descriptions) is the grey chat uses for Thinking and tool-call lines in light mode, and one shade lighter in dark mode (the plain muted grey, #b0b0b0) so it reads on black.
  • Coverage: every tooltip in the app now uses this design, including native title tooltips and chart tooltips.
Light Dark
Surface popover surface (white), soft shadow, no border #000000, no shadow
Main text --foreground, same as chat text --foreground, same as chat text
Secondary text chat's Thinking / tool colour (--color-trace-foreground) --muted-foreground (#b0b0b0), one shade above chat's trace grey

How it is wired:

  • Shared --tooltip-* tokens in index.css. --tooltip-fg is var(--foreground). --tooltip-muted is the same expression as --color-trace-foreground in light (that one lives in @theme inline, so it is not a runtime variable; a test keeps the two equal), and var(--muted-foreground) in dark.
  • .tooltip-compact (every default TooltipContent, the collapsed sidebar labels, the model picker rows) and .tooltip-rich (context usage, message timing, compaction) read the tokens. .text-muted-foreground inside either maps to the secondary token.
  • The two CSS ::after pill labels in the composer, the citation hover card (sources.tsx), and the Hub inspector and catalog tooltips (which tinted text text-white/70 and /75) now use the tokens too.
  • Native title tooltips: about 540 title attributes across 188 files render through the OS tooltip. Rather than wrap each one, TitleTooltipLayer (components/ui/title-tooltip.tsx, mounted once in AppProvider) handles them:
    • It hit-tests the pointer, lifts the title off the hovered element so the native tooltip never appears, and shows the same text with .tooltip-compact.
    • The attribute goes back on leave, scroll, click, key press or window blur, so accessible names and tests still see it as written.
    • Radix tooltip triggers and collapsed composer pills (which draw their own label) keep their own tooltip and only lose the native one.
    • Disabled buttons (pointer-events: none, which never showed a native tooltip) are found under the pointer and get one now.
    • Placement (below, flipped above near the bottom, clamped to the viewport) is a pure helper in lib/title-tooltip-placement.ts, with tests.
  • Chart tooltips (components/ui/chart.tsx, the profile token activity card) use .tooltip-compact instead of their own bordered surface.

Verification

  • npm run typecheck, npm test (12,622 pass), npm run build, and npm run i18n:check:strict unaffected.
  • tests/tooltip-theme.test.ts checks:
    • the light and dark tokens;
    • that no tooltip rule or pill label is black;
    • that tooltip secondary text equals chat's trace colour;
    • that charts and native titles use the tooltip surface.
  • tests/title-tooltip-placement.test.ts covers the placement helper.
  • A fresh Studio installed from current main plus this branch, driven with Playwright:
    • 31 tooltips hovered in light and dark, across Chat, the model picker with a local GGUF path, the collapsed sidebar, Model hub, Images, Audio, composer pill labels, and the native title on Approve for me.
    • Every one measured light oklch(1 0 0) with a shadow, and dark rgb(0, 0, 0) with box-shadow: none.
    • Main text equals the chat answer text in each theme: rgb(15, 17, 20) and rgb(252, 252, 252).
    • Secondary text equals the chat Thinking and tool label colour in light, and rgb(176, 176, 176) in dark.
    • A native title is removed while hovered and restored after, including on a disabled button.

Screenshots (left light, right dark)

Approve for me, a native title now drawn in the tooltip design:

Approve for me

A secondary line (description):

Hub downloads tooltip

The model picker's local path, the case in the issue:

Model picker local path

Chat, Approve for me, model picker with a local path:

Tooltips sheet 1

Collapsed sidebar and Model hub header:

Tooltips sheet 2

Model hub inspector:

Tooltips sheet 3

Model hub chips, Images, Audio:

Tooltips sheet 4

Composer pill labels:

Tooltips sheet 5

Not tested here

Tooltips that need a loaded model (context usage, message timing, loaded models), web search results (citation hover card) or training data (charts) were not rendered on this CPU host. They use the same classes and tokens.

…n dark

Fixes #13997. Every tooltip was black in both themes, with theme grey secondary text on it. Tooltips now read shared tokens: the popover surface with a shadow in light mode, #444 in dark mode, the app's main text colour, and a legible muted colour for secondary lines. Covers the compact and rich tooltips, the composer pill labels, the source hover card and the Hub chips that tinted text for a black surface.
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
@shimmyshimmer shimmyshimmer changed the title Studio: theme-following tooltips, white in light and a lighter grey in dark Studio: theme-following tooltips, white in light and readable grey text in dark Oct 19, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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-19T03:55:55.901760Z 0c981d2 Manual request
🔒 Security Review ✅ Completed 2026-10-19T03:28:05.143390Z 59b57b5 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.

shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: e206c5ff64

ℹ️ 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".

shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
@shimmyshimmer shimmyshimmer changed the title Studio: theme-following tooltips, white in light and readable grey text in dark Studio: theme-following tooltips, white in light and readable secondary text in dark Oct 19, 2026
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
…design

Secondary tooltip text now uses chat's thinking and tool text colour, and the main text chat's. Native title attributes (hundreds of controls, e.g. Approve for me) were drawn by the OS; a root layer now lifts the title while hovered and shows it with .tooltip-compact, restoring it on leave. Chart tooltips use the same surface.
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
The lifted title made closest('[title]') skip the hovered control on the next move, so every second move released the tooltip and it never stayed. The current target now holds while the pointer is still over it.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 59b57b51de

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

…ong ones

While a title is lifted, an icon-only control gets it as aria-label (and a named one as aria-description), so assistive tech keeps the name. A title rewritten while hovered (download rate and ETA) is lifted again and the drawn tooltip updated. Long titles (a whole spreadsheet cell) clamp to 12 lines instead of running off screen.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

…ed titles

A labelled control's title is its accessible description, so it now gets an aria-description stand-in too (unless it already has one). The hovered title is emptied rather than removed, so the browser cannot fall back to a titled ancestor's native tooltip.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

…ile hovered

The single-line pill rule lived only in TooltipContent, so native title tooltips (Approve for me) and chart tooltips kept square corners on one line. It is now a shared helper used by all four surfaces. A hovered title that React removes or empties now dismisses the drawn tooltip and is not restored on leave.
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 19, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 19, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 19, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 19, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 19, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 19, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 19, 2026
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 0c981d2009

ℹ️ 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".

shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 19, 2026
@shimmyshimmer
shimmyshimmer merged commit 8bb21cc into main Oct 19, 2026
@shimmyshimmer
shimmyshimmer deleted the studio-tooltip-contrast branch October 19, 2026 04:04
danielhanchen added a commit that referenced this pull request Oct 19, 2026
…eset the startup budget to the build (#14168)

## Summary

Main is over the startup bundle budget, so `Frontend build + bundle
sanity` fails on every PR based on it:

```
over the startup budget: transfer 2005.9 KB > 2003.5 KB, raw 6665.4 KB > 6659.1 KB      (main at 2fee36f)
```

This PR takes two steps. It moves #14137's prompt upsampler client out
of the startup chunks, which is real growth with a lazy home. It then
resets both limits to the measured build. Main has gone over this budget
repeatedly, and the root of that is a shortfall in how the limits were
raised, which this corrects.

## Cause

**#14137 (FLUX.3 prompt upsampling).** The Images page is lazy
(`ImagesPage = lazy(...)` in `__root.tsx`), but `features/images/api.ts`
is not. Startup modules import it for other calls
(`loaded-models-api.ts`, `loaded-models-sources.ts`,
`use-media-companion-bytes.ts`). #14137 put the four upsampler calls
there, with value imports from `lib/prompt-enhance.ts`, so that module
joined the startup chunks. Only `prompt-enhance-panel.tsx`, inside the
lazy Images page, calls them.

**The limits themselves.** Each raise since #14073 was sized from its
own PR's delta and added to the previous limit. That previous limit
already sat below the build, starting at #14073:
- `475a02ac` measures 2,047,700 B transfer against the 2,047,608 B limit
#14073 set.
- By `2fee36ff` the gap is 6,500 B raw and 2,409 B transfer.

The raises since (#14072, #14075, #14110, #14108, #14113) each added
their delta, so the shortfall carried forward. CI agrees with my machine
to the byte: the first run of this PR read 1999.7 KB transfer on both.

## Change

- **New `features/images/prompt-upsampler-api.ts`:** holds
`getPromptUpsamplerStatus`, `startPromptUpsamplerDownload`,
`cancelPromptUpsamplerDownload` and `previewEnhancedPrompt`, moved
unchanged, with the same `parseJson` error handling.
- **`api.ts`:** now imports only the `PromptEnhancement` type from
`lib/prompt-enhance` (erased at build).
- **`prompt-enhance-panel.tsx`:** imports the calls from the new module.
- **No behavior change** in the app.
- **`check-bundle-budget.ts`:** both limits are reset to the measured
build plus the usual margin (160 B raw, 189 B transfer), with an entry
in the BUDGET comment block explaining why the reset is absolute rather
than by delta.
  - `rawBytes`: 6,819,206 (main after #14113) -> 6,825,885.
  - `transferBytes`: 2,051,727 -> 2,054,261.

## Testing

One machine and build, Node 24, exact byte totals from the budget
script, 95 chunks throughout:

| tree | raw B | transfer B |
|---|---|---|
| main `2fee36ff` | 6,825,378 | 2,053,999 |
| main `2fee36ff` + the move | 6,821,006 | 2,052,708 |
| main `78e5eefa4d` (adds #14113) + the move | 6,821,334 | 2,052,857 |
| + #14183 | 6,821,410 | 2,052,614 |
| + #14172 (one tooltip design) | 6,825,307 | 2,053,990 |
| this PR (main `b227654927`, adds #14184, + the move) | 6,825,725 |
2,054,072 |

- **The move saves:** 4,372 B raw and 1,291 B transfer.
- **#14113 adds:** 328 B raw and 149 B transfer on this build.
- **Landed while main was over, with no raise:** #14183 (+76 B raw, -243
B transfer), #14172 (+3,897 B raw, +1,376 B transfer, the shared tooltip
is in the eager shell) and #14184 (+418 B raw, +82 B transfer). This is
the treadmill the absolute reset stops: while main is red on this check,
growth lands unaccounted.
- **With the new limits:** `within budget (0.2 KB transfer, 0.2 KB raw
to spare)`.
- **`npm run typecheck`:** clean.
- **`bundle-budget-cli.test.ts`, `bundle-budget-closure.test.ts`,
`image-prompt-enhance.test.ts` and
`loaded-models-platform-matrix.test.ts`:** 74 passed.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.

[Feature] make all popups use chosen theme

1 participant