fix(settings): keep theme previews independent of active theme#2329
fix(settings): keep theme previews independent of active theme#2329Iflaqbhat wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@Iflaqbhat is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
|
Pulled this branch and verified the fix. Reads correct to me. What I checked:
Both were previously using The Light swatch was already using Screenshot
One small noteNot a blocker: the added test pins the constant strings, That guards the literal values, but it does not assert the thing that actually broke here: whether the class resolves to a real palette color. A class like Also FYI, the same root cause, a color class that is not in the Radix palette, shows up in a handful of other components. I put the full list in #2341 so it does not widen this PR. |
|
@evanklem Thanks for the thorough verification and for documenting the broader issue in #2341. I pushed b6d5995 to strengthen the regression test: it now checks that the preview color utilities resolve through the configured Tailwind palette, in addition to asserting the intended black/white values.
|
Pablosinyores
left a comment
There was a problem hiding this comment.
Reasonable fix — extracting THEME_PREVIEW_CLASSES and adding the regression test are good.
One thing to verify: the rationale is that the app Tailwind override drops bg-zinc-950. If that override replaces the palette rather than just removing zinc, it is worth confirming bg-black/bg-white are actually in the configured palette too — otherwise the dark swatch can hit the same "unsupported utility" problem the PR is fixing. The test asserts the class names but not that they resolve to a real color; a check against the Tailwind config (or a computed-style assertion) would lock that down.
Also worth a line in the PR description: the swatches are now fixed pure black/white rather than the live theme background. That matches the "independent of active theme" goal, but means they will not track a custom dark palette — fine if intentional.
|
@Pablosinyores Thanks, good call. I pushed b6d5995 to strengthen the regression test: it now imports the configured Tailwind palette and verifies the preview utilities resolve to real colors. The previews intentionally use fixed pure black/white examples rather than live theme-surface tokens, so they remain stable while selecting Light, Dark, or System. I added that design intent to the PR description as well. |

Summary
bg-zinc-950utilities with configuredbg-blackutilities in the Appearance theme picker.Why
The app overrides Tailwind colors and does not define the Zinc palette. The old
bg-zinc-950class therefore produced no background rule, letting the preview inherit its parent theme.Issue
Scope
apps/app/src/react-app/domains/settings/appearance/theme-section.tsxapps/app/tests/theme-preview.test.tsOut of scope
Testing
Ran
pnpm --filter @openwork/app testpnpm --filter @openwork/app typecheckpnpm --filter @openwork/app buildgit diff --checkResult
use memoand chunk-size warnings only.CI status
Manual verification
Evidence
Risk
Rollback
fac8b55bandb6d5995.