Skip to content

fix: Compare feature has poor contrast in dark mode — dropdowns render light, labels invisible #218

Closed

Description

@EVWorth

Summary

The schema Compare feature renders with very poor contrast in dark mode. The connection and database dropdowns look like they're using the OS/browser's light color scheme (white background, dark text on the trigger; light popup), while the "Source" / "Target" labels are nearly invisible. In light mode the same controls look fine.

Reproduction

  1. Switch the app to dark mode

  2. Open or create the Compare tab (⇄ Compare in the tab bar)

  3. Observe the setup row:

    • "Source" / "Target" labels are very low contrast against the dark panel background (barely visible)
    • The four dropdowns (Source connection, Source database, Target connection, Target database) render with what looks like native browser styling — white-ish backgrounds, dark text — clashing with the rest of the dark UI
    • The Select database... placeholder text is even fainter than the connection select (compounded by disabled:opacity-40 when no connection is picked yet)
    • The blue Compare button on the right looks acceptable, which makes the dropdowns stand out as broken
  4. Switch to light mode — everything looks correct (light backgrounds, dark text, readable labels)

Screenshots

Attached by reporter. Dark mode image (top) shows white dropdowns + invisible labels. Light mode image (bottom) shows the same controls with proper contrast and theming.

Root cause

The Compare setup row is built entirely from raw native HTML <select> elements with no custom dropdown component, and the project has no global color-scheme rule applied to native form controls. Three things combine to produce the broken dark-mode appearance:

1. No global color-scheme: dark on the dark theme

src/styles/globals.css:18-31 defines the dark theme tokens (background #0a0a0f, text #e4e4ef) and src/styles/globals.css:47-52 applies them to body — but there's no color-scheme: dark declaration anywhere. package.json has no Radix, Headless UI, shadcn, or react-select dependency.

Without color-scheme: dark set on the <html> element or :root, Chromium uses the system / OS color scheme for native form controls (selects, scrollbars, inputs), so dropdown triggers and option popups render light even when the page background is dark.

2. Native <select> triggers and option popups ignore Tailwind classes

src/components/compare/SchemaCompare.tsx:223-230 (Source/Target connection select) and :231-239 (Source/Target database select) — both use raw <select> elements. The trigger is themed with bg-[var(--color-bg-primary)] and text-[var(--color-text-primary)] (:226, :235), which does work for the closed dropdown. But:

  • The native dropdown popup (the list of options that opens on click) is rendered by the OS, not the page, so Tailwind classes don't apply — it stays light.
  • Select database... at :228, :237 is a plain native <option>, not a styled placeholder.

3. Low-contrast "Source" / "Target" labels

src/components/compare/SchemaCompare.tsx:221 uses text-[var(--color-text-muted)]. In dark mode the muted token is #5a5a6e (src/styles/globals.css:25), which sits very close to the dark panel background #0a0a0f / #111118. The labels visually disappear.

4. Database select disabled-state opacity

src/components/compare/SchemaCompare.tsx:235 — the database select uses disabled:opacity-40, so when no connection is chosen the placeholder text is reduced to 40% opacity on top of an already low-contrast background. Worst-of-both contrast.

Fix

Three independent improvements; each is small. Recommend doing all three:

1. Add color-scheme to the theme (global, fixes native controls project-wide)

src/styles/globals.css:18-31 (dark theme block) — add:

color-scheme: dark;

src/styles/globals.css:33-45 (light theme block) — add:

color-scheme: light;

This alone fixes the white popup background and the white-default scrollbar everywhere — not just in Compare. It also makes native form controls feel intentional in both themes.

2. Bump the muted text contrast in dark mode

src/styles/globals.css:25 — the muted token #5a5a6e fails WCAG AA against the dark backgrounds. Lift it to something like #8b8ba0 or #9090a8 so the "Source" / "Target" labels are clearly readable. (Verify the rest of the app's muted usage still looks correct; this is a small global change.)

If a project-wide token bump is too risky, scope it locally: SchemaCompare.tsx:221 could use text-[var(--color-text-secondary)] instead of text-[var(--color-text-muted)] for just the Source/Target labels.

3. Tone down disabled:opacity-40 on the database selects (or rework placeholder styling)

src/components/compare/SchemaCompare.tsx:235 — disabled:opacity-40 makes the placeholder text nearly invisible. Options:

  • Lower the opacity multiplier (e.g. disabled:opacity-70)
  • Use disabled:text-[var(--color-text-muted)] instead of opacity, so the disabled state is communicated via a softer color rather than blanket transparency
  • Or, if the team is open to it, replace the native <select> with a small themed custom dropdown (shadcn Select, Radix Select, or a hand-rolled popover) — but this is a bigger change and should be tracked separately

4. Optional: explicit option styling

If after fix #1 the option popup is still light in some browsers, add an explicit appearance reset to the <select>:

className="... appearance-none ..."

plus styling for the option list. This is browser-dependent and is only needed if color-scheme alone is insufficient.

Out of scope

  • Replacing the native <select> with a fully custom dropdown (a separate, larger refactor — open a follow-up issue if desired)
  • Theming the ⇄ Compare tab itself (already themed correctly per EditorTabs.tsx)
  • Theming the Compare results panel below the setup row (rendered fine in both modes per scout review)
  • The swap icon at SchemaCompare.tsx:144 (not a button, just decorative — leave as-is unless a swap action is added)

Acceptance criteria

  • Dark mode: Source/Target labels are clearly readable
  • Dark mode: connection and database dropdown triggers match the dark theme
  • Dark mode: the option popup (list of connections/databases) is dark, not white
  • Dark mode: Select database... placeholder is readable when no connection is selected
  • Light mode: no regression on any of the above
  • No regression on the rest of the app's native form controls (because the color-scheme fix is global)

Files

  • src/styles/globals.css:18-31,33-45 — add color-scheme to dark/light blocks
  • src/styles/globals.css:25 — bump dark muted text contrast (or scope locally in SchemaCompare.tsx:221)
  • src/components/compare/SchemaCompare.tsx:221,223-239 — local contrast/disabled fixes
  • src/components/compare/SchemaCompare.tsx:19 — SchemaCompare component definition (reference)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggood first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions