Repository navigation
Studio: one tooltip design everywhere, matching chat's text colours in light and dark - #14172
Conversation
…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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…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.
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.
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
…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.
…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.
…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.
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…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>
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.
#000000), flat, with no shadow.#b0b0b0) so it reads on black.titletooltips and chart tooltips.#000000, no shadow--foreground, same as chat text--foreground, same as chat text--color-trace-foreground)--muted-foreground(#b0b0b0), one shade above chat's trace greyHow it is wired:
--tooltip-*tokens inindex.css.--tooltip-fgisvar(--foreground).--tooltip-mutedis the same expression as--color-trace-foregroundin light (that one lives in@theme inline, so it is not a runtime variable; a test keeps the two equal), andvar(--muted-foreground)in dark..tooltip-compact(every defaultTooltipContent, the collapsed sidebar labels, the model picker rows) and.tooltip-rich(context usage, message timing, compaction) read the tokens..text-muted-foregroundinside either maps to the secondary token.::afterpill labels in the composer, the citation hover card (sources.tsx), and the Hub inspector and catalog tooltips (which tinted texttext-white/70and/75) now use the tokens too.titletooltips: about 540titleattributes across 188 files render through the OS tooltip. Rather than wrap each one,TitleTooltipLayer(components/ui/title-tooltip.tsx, mounted once inAppProvider) handles them:titleoff the hovered element so the native tooltip never appears, and shows the same text with.tooltip-compact.pointer-events: none, which never showed a native tooltip) are found under the pointer and get one now.lib/title-tooltip-placement.ts, with tests.components/ui/chart.tsx, the profile token activity card) use.tooltip-compactinstead of their own bordered surface.Verification
npm run typecheck,npm test(12,622 pass),npm run build, andnpm run i18n:check:strictunaffected.tests/tooltip-theme.test.tschecks:tests/title-tooltip-placement.test.tscovers the placement helper.mainplus this branch, driven with Playwright:titleon Approve for me.oklch(1 0 0)with a shadow, and darkrgb(0, 0, 0)withbox-shadow: none.rgb(15, 17, 20)andrgb(252, 252, 252).rgb(176, 176, 176)in dark.titleis removed while hovered and restored after, including on a disabled button.Screenshots (left light, right dark)
Approve for me, a native
titlenow drawn in the tooltip design:A secondary line (description):
The model picker's local path, the case in the issue:
Chat, Approve for me, model picker with a local path:
Collapsed sidebar and Model hub header:
Model hub inspector:
Model hub chips, Images, Audio:
Composer pill labels:
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.