Skip to content

fix(studio): contrast ratio of JSON cell viewer colors in light mode - #40691

Merged
awaseem merged 3 commits into
supabase:masterfrom
marsou001:color-contrast-json-view
Mar 6, 2026
Merged

awaseem merged 3 commits into
supabase:masterfrom
marsou001:color-contrast-json-view

Conversation

@marsou001

@marsou001 marsou001 commented Nov 21, 2025 •

Copy link
Copy Markdown
Contributor

JSON column viewer looks fine on dark mode, but barely visible on light mode, especially when the value is of string type.

There are no colors that can satisfy the 4.5:1 contrast ratio (minimum requirement for web and digital accessibility) on both white and black background, so I had to pick different classes for ight mode (dark mode is fine, I checked the colors against the dark background and the contrast is good).

Even though the new colors may not look that contrasting to each other, I prioritized accessibility, and made sure they all complied with the 4.5:1 contrast ratio.

Before:
112

After:
222

Fixes #40633

@marsou001
marsou001 requested a review from a team as a code owner November 21, 2025 17:10
@vercel

vercel Bot commented Nov 21, 2025 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
studio-self-hosted Ready Ready Preview, Comment Mar 6, 2026 3:13pm
studio-staging Ready Ready Preview, Comment Mar 6, 2026 3:13pm
7 Skipped Deployments
Project Deployment Actions Updated (UTC)
cms Ignored Ignored Mar 6, 2026 3:13pm
studio Ignored Ignored Mar 6, 2026 3:13pm
design-system Skipped Skipped Mar 6, 2026 3:13pm
docs Skipped Skipped Mar 6, 2026 3:13pm
learn Skipped Skipped Mar 6, 2026 3:13pm
ui-library Skipped Skipped Mar 6, 2026 3:13pm
zone-www-dot-com Skipped Skipped Mar 6, 2026 3:13pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for contributing to Supabase! ❤️ Our team will review your PR.

A few tips for a smoother review process:

  • If you have a local version of the repo, run pnpm run format to make sure formatting checks pass.
  • Once we've reviewed your PR, please don't trivially merge master (don't click Update branch if there are no merge conflicts to be fixed). This invalidates any pre-merge checks we've run.

@vercel

vercel Bot commented Nov 21, 2025

Copy link
Copy Markdown

@marsou001 is attempting to deploy a commit to the Supabase Team on Vercel.

A member of the Team first needs to authorize it.

@coveralls

coveralls commented Nov 28, 2025 •

Copy link
Copy Markdown

Coverage Status

coverage: 68.489% (-0.4%) from 68.855%
when pulling 948bd38 on marsou001:color-contrast-json-view
into 1e8dcac on supabase:master.

@kallebysantos

Copy link
Copy Markdown
Member

Hi @marsou001 💚
Thanks for your contribution! It really helped with contrast

Looks good to me!


cc @awaseem
I'm not sure if the current theme of the Json viewer should be refactored to match Supabase colorscheme.

dark

Json editor - Supabase colorscheme

image

View - completely different

image
light

Json editor - Supabase colorscheme

image

View (Current) - completely different

image

View (This PR)

image

@marsou001

marsou001 commented Nov 28, 2025 •

Copy link
Copy Markdown
Contributor Author

I thought about it too! Two reasons I didn't go with it:

  1. I thought I should stick to tailwind classes so the change matches the rest of the code in the file.
  2. If the theme is the same between "edit" and "view", users might not immediately recognize the difference.

@coderabbitai

coderabbitai Bot commented Mar 6, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Repository UI (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 723b0b03-c0b5-414c-9dec-655fc2704dc7

📥 Commits

Reviewing files that changed from the base of the PR and between f0b44ae and e28cb9b.

📒 Files selected for processing (1)
  • apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/JsonEditor/DrilldownViewer/DrilldownPane.tsx

📝 Walkthrough

Summary by CodeRabbit

  • Style
    • Refined color palette for data values and labels in the data viewer with improved visual hierarchy and contrast between different data types.
    • Added comprehensive dark mode styling to ensure consistent readability and appearance across both light and dark themes.

Walkthrough

This pull request updates the visual styling of the DrilldownPane component in the JSON editor. The changes modify the color classes for key labels and value text to use different color palette options, including dark mode variants. Key labels now use sky and blue tones, non-string values use purple with green fallback, and string values use lime with yellow fallback. No functional or control flow changes are present.

Assessment against linked issues

Objective Addressed Explanation
Improve contrast of JSON column viewer in light mode [#40633] ✅
Ensure string values meet recommended contrast standards (4.5:1) [#40633] ✅
Ensure number/primitive values meet recommended contrast standards [#40633] ✅

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 and usage tips.

@awaseem awaseem 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.

LGTM

@awaseem
awaseem merged commit efa40ea into supabase:master Mar 6, 2026
19 checks passed
@github-actions

github-actions Bot commented Mar 6, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1772811634)

Score Average Improvements Regressions
Completeness 97.2% (+0pp) 1 🟢 1 🔴
Conciseness 0% (+0pp) - -
Correctness 100% (+0pp) - -
Docs Faithfulness 58.8% (+6pp) 1 🟢 -
Goal Completion 98.6% (+4pp) 2 🟢 1 🔴
Tool Usage 100% (+3pp) 1 🟢 -
URL Validity 95% (-5pp) - 1 🔴
SQL Identifier Quoting 93.3% (-7.000000000000001pp) - 1 🔴
SQL Validity 100% (+0pp) - -
Time_to_first_token 0.25tok (+0.01tok) 6 🟢 6 🔴
Llm_calls 8.28 (+0) 3 🟢 5 🔴
Tool_calls 3.14 (-0.06) 5 🟢 5 🔴
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 48394.08tok (+417.47tok) 6 🟢 6 🔴
Prompt_cached_tokens 24430.22tok (-2755.56tok) 4 🟢 7 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 2913.53tok (+23.08tok) 5 🟢 7 🔴
Completion_reasoning_tokens 2144tok (+72.89tok) 4 🟢 7 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 51307.61tok (+440.56tok) 6 🟢 6 🔴
Estimated_cost 0.01$ (+0$) 6 🟢 6 🔴
Duration 52.11s (+0.36s) 4 🟢 8 🔴
Llm_duration 102.52s (-2.19s) 5 🟢 7 🔴

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.

JSON column view mode has extremely low contrast

4 participants