Skip to content

fix(editor): light theme contrast + gradient palette - #470

Merged
EtienneLescot merged 3 commits into
mainfrom
claude/light-theme-contrast-gradients-ff4420
Aug 22, 2026
Merged

fix(editor): light theme contrast + gradient palette#470
EtienneLescot merged 3 commits into
mainfrom
claude/light-theme-contrast-gradients-ff4420

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Gradient picker contrast (gradient-editor.tsx): the "remove color" icon read as invisible until hover, and the brightness-slider thumb disappeared into the light-theme popover background. The slider row had no backing of its own (unlike the dark color-wheel canvas above it), so its near-white thumb (#f5f5f5) blended into the light theme's near-white surface. Gave the row its own dark backing and bumped the icon buttons from 60%→80% white opacity.
  • Two more dark-hardcoded surfaces found via a broader light-theme sweep: ShortcutsConfigDialog.tsx (bg-[#09090b] text-white, ignored theme entirely) and App.tsx's editor-loading Suspense fallback (flashes dark on every editor load). Both converted to design-tokens.css custom properties.
  • White-on-mint contrast (theme-independent, found while auditing accent-colored surfaces): .exportBtn, .bigRecBtn, .previewEmptyPrimaryButton, and VirtualPreview's icon-button hover state used white/near-white text on the mint --accent/--brand background instead of the --accent-on token the design system defines for that exact pairing. Under WCAG contrast minimums in both themes — switched all four to --accent-on, matching the pattern already used correctly elsewhere (.paneTabs button.isActive, .btnPrimary, Modals.tsx, ExportDialog.tsx).
  • Default gradient presets: recolored from 16 swatches built out of 4 grays + the single mint accent (read as "all green") to a spread across the same hues already offered in the solid-color tab (blue, purple, pink, orange, green), with a couple of mint blends so the brand color still shows without dominating.

Intended to be cherry-picked into 1.10.0.rc2 — the gradient-palette change counts as a fix for that purpose.

Testing

  • npx biome check . — clean (13 pre-existing warnings, unrelated to this diff)
  • npx tsc --noEmit -p . — clean
  • npx vitest run on the touched components (gradient-editor, ShortcutsConfigDialog's coverage via NewEditorShell.dialogShortcuts, RightPanes, VirtualPreview) — 38/38 passing
  • Verified computed styles (background/text color, contrast ratios) for both light and dark theme in a live browser session against the real running editor, for: the gradient picker's brightness slider and remove-color icon, the Keyboard Shortcuts dialog (opened via ?, theme toggled via the real UI button), and the four white-on-mint buttons.

🤖 Generated with Claude Code

…the light theme

Two contrast bugs reported directly against the gradient picker: the
"remove color" icon read as invisible until hover, and the brightness
slider's thumb disappeared into the popover background in light mode.
Both buttons/icons in gradient-editor.tsx were colored for the dark
color-wheel canvas above them, but the brightness-slider row has no
canvas of its own — it sits directly on the (theme-dependent) popover
surface, where the near-white thumb (`#f5f5f5`) all but vanished
against the light theme's near-white surface. Gave that row its own
dark backing, consistent with the canvas and angle-knob beside it
(deliberately dark-by-design, like most pro color pickers), and bumped
the icon buttons from 60% to 80% white so they don't need hover to read.

A light-theme sweep for the same class of bug found two more hardcoded
surfaces: ShortcutsConfigDialog.tsx (`bg-[#09090b] text-white`, so the
whole dialog stayed dark regardless of theme) and App.tsx's editor
Suspense fallback (same dark hex, flashes on every editor load before
the real light UI paints). Both now use the design-tokens.css custom
properties already used everywhere else in the app.

While auditing accent-colored surfaces for the same sweep, found a
separate but related bug: a few primary buttons (`.exportBtn`,
`.bigRecBtn`, `.previewEmptyPrimaryButton`, and VirtualPreview's
icon-button hover state) put white/near-white text directly on the
mint `--accent`/`--brand` background instead of `--accent-on` — the
token design-tokens.css defines specifically for text on that
background. White-on-mint measures under WCAG's contrast minimums in
both themes; switched all four to `--accent-on`, matching the pattern
already used correctly everywhere else (NewEditorShell.module.css's
`.paneTabs button.isActive`, `.btnPrimary`, Modals.tsx, ExportDialog.tsx).

Finally, the default gradient presets: 16 swatches built from four
grays plus the single mint accent, so half the grid paired a gray with
the same green, reading as "we only have one color." Recolored with
the same hue spread already offered in the solid-color tab just below
it (blue, purple, pink, orange, green) with a couple of mint blends so
the brand color still shows up without dominating.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@EtienneLescot, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Limit details: You’ve used all 4 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f7c71812-5419-42eb-9eab-b0bea8509e95

📥 Commits

Reviewing files that changed from the base of the PR and between b4d4399 and 5866387.

📒 Files selected for processing (10)
  • index.html
  • src/App.tsx
  • src/components/ai-edition/LeftPanel.tsx
  • src/components/ai-edition/NewEditorShell.module.css
  • src/components/ai-edition/RightPanes.tsx
  • src/components/ai-edition/VirtualPreview.module.css
  • src/components/ai-edition/v4/EditorShellV4.module.css
  • src/components/ai-edition/v4/MediaStage.tsx
  • src/components/ui/gradient-editor.tsx
  • src/components/video-editor/ShortcutsConfigDialog.tsx

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.

EtienneLescot and others added 2 commits August 22, 2026 12:23
…ressed

Ran /code-review (medium effort, 8 finder angles + verification) against
bb6452c while waiting out CodeRabbit's rate limit. Two findings were the
migration itself introducing bugs, and two more were the same white-on-mint
class of bug the previous commit fixed, just in files it didn't touch:

- ShortcutsConfigDialog's "Swap" button (shown on a keybinding conflict) had
  its hover and resting background collapsed onto the same `--warn-soft`
  token — the pre-migration code used two distinct amber opacities (20%/30%)
  to give it a hover state, and the conflict banner's border/fill did the
  same thing (10%/20%), leaving the border invisible against its own fill.
  Gave the border `--warn` (matching the pattern already used two lines up
  in the same file for the binding-chip's conflict state) and the hover a
  `color-mix()` step, the same technique NewEditorShell.module.css already
  uses elsewhere for token-based opacity variants.

- MediaStage.tsx's "Add to Timeline" button read `var(--on-accent, #fff)` —
  a token name that doesn't exist anywhere in design-tokens.css (only
  `--accent-on`, words reversed, is defined) — so it always fell through to
  the `#fff` fallback: white text on the mint accent, always, in both
  themes. LeftPanel.tsx's rewind-confirm button paired the accent background
  with `color: var(--bg)` instead of `--accent-on`, which happens to read
  fine in dark theme (`--bg` is near-black there) but is near-white-on-mint
  in light theme. Both switched to `--accent-on`.

- The Suspense fallback fix in the previous commit (hardcoded dark colors →
  theme tokens) fixed the light-theme flash but introduced the mirror bug:
  `data-theme="dark"` is only ever set by useTheme(), which lives inside the
  same lazily-loaded editor chunk the fallback covers, so a dark-theme user
  now sees a light flash while that chunk downloads. Added the standard
  FOUC-prevention pattern instead — a synchronous inline script in
  index.html's <head> that applies the stored preference before first paint
  — which fixes it for every themed element on first load, not just this one.

- `.bigRecBtn.recording` (EditorShellV4.module.css) inherits its color from
  the base rule, which the previous commit changed from white to
  `--accent-on` (tuned for the mint accent, not the red `--danger` this
  state switches the background to). No code path sets the `recording`
  class today, so this was inert either way, but pinned it to `#fff`
  explicitly so the red recording state doesn't silently inherit a color
  chosen for a different background if that ever changes.

One candidate (a claim that the gradient-editor brightness slider's new
`rounded-full` track exposes the wave-path stroke at its rounded ends in
light mode) didn't survive verification: the stroke sits at the track's
vertical center, and a stadium shape's boundary at its own vertical center
is at full width by construction — the recession is sub-pixel, and the wave
path's own endpoints (~12%/87% of the track width) don't reach that region
regardless.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@EtienneLescot

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

@EtienneLescot I will review the current changes in #470.

❌ Action failed

Review failed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

@EtienneLescot I will review the current changes in #470.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@EtienneLescot
EtienneLescot merged commit ee62822 into main Aug 22, 2026
17 checks passed
@EtienneLescot
EtienneLescot deleted the claude/light-theme-contrast-gradients-ff4420 branch August 22, 2026 10:53
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.

1 participant