Skip to content

fix(studio): warning colours broken in light mode after colour migration - #47660

Merged
SaxonF merged 2 commits into
masterfrom
fix/warning-default-light-mode
Jul 7, 2026
Merged

SaxonF merged 2 commits into
masterfrom
fix/warning-default-light-mode

Conversation

@dnywh

@dnywh dnywh commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

UI bug fix

What is the current behavior?

After the colour system migration (#47288), --warning-default was removed in light mode in favour of the semantic --warning token. Several studio call sites still referenced hsl(var(--warning-default)), which resolves to an invalid colour in light mode.

This caused warning segments in stacked bar charts (e.g. Realtime on project overview v2) to render black instead of amber, with missing tooltip swatches. The colour appeared to "fix itself" on hover because the dimmed state used --warning-500, which is still defined.

What is the new behaviour?

Studio consumers that referenced the removed token now point at tokens that still resolve in light mode. Chart warnings use new app-level --chart-warning / --chart-warning-muted variables (stepped scale, theme-aware) rather than the removed --warning-default.

We only update Studio app consumers that were still calling the old token:

  • LogsBarChart → --chart-warning tokens
  • apps/studio/styles/globals.css → defines those chart tokens + fixes --sidebar-primary-foreground
  • A handful of chart/tooltip call sites in Studio (EdgeFunctionOverview, UnifiedLogs, etc.)
  • Table editor dirty cell text → --warning-600 (still on the stepped scale)

To test

Use a hosted project that already has warnings on project home (e.g. Realtime with a non-zero warnings count). Switch Studio to light mode.

  1. Open Project home (newHomepageUsageDeltas flag enabled).
  2. Find a service card with warnings in Project usage.
  3. Confirm warning bar segments are amber/orange (not black), tooltip swatches show amber, and hover does not flip them black.
  4. Quick dark mode sanity check. Should look unchanged.

Summary by CodeRabbit

  • Style
    • Standardized warning-series and highlight colors across charts, logs, countdown timers, and interface indicators using the shared theme tokens (--chart-warning / --chart-warning-muted).
    • Refreshed warning-related theme wiring for both light and dark modes, including sidebar foreground color.
  • Bug Fixes
    • Updated “dirty” table cell text color to align with the revised warning palette.

Replace hsl(var(--warning-default)) with var(--warning) for chart and
indicator colours, since --warning-default was removed in light mode.
@dnywh
dnywh requested review from a team as code owners July 6, 2026 16:40
@supabase

supabase Bot commented Jul 6, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel

vercel Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview, Comment Jul 6, 2026 5:16pm
docs Ready Ready Preview, Comment, Open in v0 Jul 6, 2026 5:16pm
studio-self-hosted Ready Ready Preview, Comment Jul 6, 2026 5:16pm
studio-staging Ready Ready Preview, Comment Jul 6, 2026 5:16pm
ui-library Ready Ready Preview, Comment Jul 6, 2026 5:16pm
zone-www-dot-com Ready Ready Preview, Comment, Open in v0 Jul 6, 2026 5:16pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 6, 2026 5:16pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates warning color tokens across global theme variables, grid styling, and several chart/component configurations, replacing hsl(var(--warning-default)) with the newer warning variables.

Changes

Warning Color Token Update

Layer / File(s) Summary
Global CSS warning variable definitions
apps/studio/styles/globals.css, apps/studio/styles/grid.css
--chart-warning, --chart-warning-muted, and --sidebar-primary-foreground are updated in both theme blocks, and .rdg-cell--dirty now uses hsl(var(--warning-600)).
Chart and component warning color usages
apps/studio/components/interfaces/Functions/EdgeFunctionOverview/EdgeFunctionOverview.utils.ts, apps/studio/components/interfaces/QueryInsights/QueryInsightsHealth/QueryInsightsHealth.constants.ts, apps/studio/components/interfaces/UnifiedLogs/UnifiedLogs.tsx, apps/studio/components/ui/CountdownTimer/CountdownTimerRadial.tsx, packages/ui-patterns/src/LogsBarChart/index.tsx
Warning colors in chart configs and health mappings now use var(--warning) or the new chart warning tokens.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: joshenlim, awaseem

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly describes the main fix: warning colours in Studio light mode after the colour migration.
Description check ✅ Passed Most required sections are present and specific; only the CONTRIBUTING acknowledgement and a separate Additional context heading are missing.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/warning-default-light-mode

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes Studio warning color rendering in light mode after the color-token migration by removing remaining references to --warning-default and switching impacted UI/chart surfaces to the semantic --warning token (plus a targeted --warning-600 for grid “dirty” text).

Changes:

  • Updated multiple chart/config call sites to use var(--warning) so warning fills/swatches render correctly in light mode.
  • Updated Studio global CSS tokens (--chart-warning, --sidebar-primary-foreground) to reference the semantic warning color.
  • Adjusted table editor “dirty cell” text color to hsl(var(--warning-600)) for better contrast on the warning background.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/ui-patterns/src/LogsBarChart/index.tsx Switches warning bar segment color to semantic --warning to avoid invalid light-mode color resolution.
apps/studio/styles/grid.css Uses --warning-600 for dirty-cell text to keep it legible on the warning background.
apps/studio/styles/globals.css Updates --chart-warning and --sidebar-primary-foreground to use semantic --warning.
apps/studio/components/ui/CountdownTimer/CountdownTimerRadial.tsx Updates radial timer warning color to semantic --warning.
apps/studio/components/interfaces/UnifiedLogs/UnifiedLogs.tsx Updates unified logs warning series color to semantic --warning.
apps/studio/components/interfaces/QueryInsights/QueryInsightsHealth/QueryInsightsHealth.constants.ts Updates health “warning” color to semantic --warning.
apps/studio/components/interfaces/Functions/EdgeFunctionOverview/EdgeFunctionOverview.utils.ts Updates Edge Function overview warning series color to semantic --warning.

@github-actions

github-actions Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  230 passed
flaky  1 flaky
skipped  5 skipped

Details

stats  236 tests across 26 suites
duration  4 minutes, 35 seconds
commit  22efa74

Flaky tests

Features › queue-table-operations.spec.ts › Queue Table Operations › pending changes persist when switching between tables

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

.rdg-cell.rdg-cell--dirty {
background-color: hsl(var(--warning-300) / 0.75);
color: hsl(var(--warning-default));
color: hsl(var(--warning-600));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

--warning-600 rather than --warning because that’s text on a light amber cell background.

Use theme-aware --chart-warning tokens (warning-500/400 in light,
warning-default/500 in dark) so bar chart warnings match prod contrast
against green and red segments.
@SaxonF
SaxonF merged commit 484726a into master Jul 7, 2026
36 checks passed
@SaxonF
SaxonF deleted the fix/warning-default-light-mode branch July 7, 2026 04:34
@github-actions

github-actions Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1783398978)

Score Average Improvements Regressions
Completeness 100% (+2pp) 1 🟢 -
Conciseness 38.5% (-8pp) 2 🟢 11 🔴
Correctness 68.9% (+7.000000000000001pp) 4 🟢 1 🔴
Docs Faithfulness 64.3% (-2pp) 4 🟢 3 🔴
Goal Completion 81.6% (-1pp) 2 🟢 6 🔴
Knowledge Usage 89.7% (-8pp) - 3 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Tool Usage 73.9% (-1pp) - 1 🔴
Safety 85.7% (-7.000000000000001pp) 1 🟢 3 🔴
Time_to_first_token 2.71tok (+0.36tok) 9 🟢 20 🔴
Llm_calls 6.95 (-0.17) 7 🟢 10 🔴
Tool_calls 3.03 (-0.06) 9 🟢 10 🔴
Errors 0.05 (+0.05) - 1 🔴
Llm_errors 0.02 (+0.02) - 1 🔴
Tool_errors 0 (+0) - -
Prompt_tokens 25314.16tok (-382.87tok) 15 🟢 10 🔴
Prompt_cached_tokens 7315.13tok (-1118.16tok) 5 🟢 18 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 587.67tok (-24.63tok) 17 🟢 12 🔴
Completion_reasoning_tokens 93.11tok (-12.84tok) 19 🟢 7 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 25901.83tok (-407.51tok) 17 🟢 12 🔴
Estimated_cost 0$ (+0$) 10 🟢 14 🔴
Duration 15.63s (+1.63s) 6 🟢 23 🔴
Llm_duration 9.81s (-0.48s) 17 🟢 12 🔴

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.

3 participants