Skip to content

fix(web): published themes fill missing colors from the stock palette - #37463

Open
dfakkeldy wants to merge 1 commit into
pingdotgg:mainfrom
dfakkeldy:t3/published-theme-stock-base
Open

dfakkeldy wants to merge 1 commit into
pingdotgg:mainfrom
dfakkeldy:t3/published-theme-stock-base

Conversation

@dfakkeldy

Copy link
Copy Markdown
Contributor

Problem

A published environment theme without canvas and accent seeds fills every color role it leaves out from getDefaultThemeColors, which is the T3 Chat palette. So a partial palette, such as one role plus some css, repaints the whole app in T3 Chat's purples instead of keeping the stock T3 Code look. The other-appearance variant of any published theme has the same problem.

I hit this with the agent theme tool: asking an agent for a small CSS tweak (colored pinned threads) washed out the whole app. The agent had to copy all 61 stock roles into the theme to keep the normal look.

Change

publishedThemeColors now starts from getStandardPaintedThemeColors(appearance), the palette clients paint when no theme is selected. Seeded themes in their own appearance still use the generated palette. Stored custom themes and theme-file import still fall back to T3 Chat, as themePalette.test.ts expects; this PR leaves that boundary alone.

Testing

  • Extended keeps seeds, partial palettes, and usable alternate appearances in useEnvironmentTheme.test.ts to assert that omitted roles match the stock palette for a partial dark theme and for a light variant. It fails on main (canvas is oklch(0.22813 0.020366 307.469), expected #000000) and passes here.
  • vp run check:changed passed: format, lint, knip, typecheck, the tests beside the change, and the React compiler check.
  • In a dev server with its own state, published a dark theme that sets only searchMatchBackground plus one CSS rule, ran t3 theme set, and captured the web client on main and on this branch.

Before (main):

Before: a one-role theme repaints the app in T3 Chat purples

After:

After: the same theme keeps the stock dark palette

Not exercised: the desktop shell (it renders the same web palette) and light mode in a real client (covered by the light-variant assertion). Mobile does not use environment themes.

Risk

Low. Display only. A published theme that relied on the T3 Chat fallback for roles it omitted will now show stock colors for those roles instead. Themes seeded with canvas and accent are unchanged in their own appearance.

How to revert

Revert this commit. Partial published themes go back to filling omitted roles from the T3 Chat palette.

Reviewed-by: fresh-context Codex review (GPT-6.1 Sol), approved; its two nits (exact override values in the test, narrower trigger wording) are applied.

Implemented by Claude (Opus 5.5, Claude Code).

🤖 Generated with Claude Code

A published environment theme without canvas and accent seeds filled every
role it left out from the T3 Chat palette, so a partial palette (one role
plus some CSS, say) repainted the whole app in T3 Chat's purples. The same
happened to the other-appearance variant of any published theme. Missing
roles now come from the stock T3 Code palette that clients paint with no
theme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 16, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — Published themes with unspecified colors will now inherit the stock web palette instead of the T3 Chat palette. Human review is required to confirm this change to default visual behavior.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Published environment themes now use standard painted colors for unspecified colors when the theme does not have both canvas and accent to generate vivid colors. Tests check the fallback and canonicalization of supplied colors for dark and light variants.

Changes: Environment theme palette

Layer / File(s) Summary
Palette fallback and partial-palette tests
apps/web/src/themePalette.ts, apps/web/src/hooks/useEnvironmentTheme.test.ts
Published themes use standard painted colors as the fallback unless vivid colors are generated from both canvas and accent. Tests check the dark and light defaults and canonicalized supplied colors.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge, maria-rcks, macroscopeapp

Merge Risk: Minimal · up to c3084

Published themes that omit colors now fall back to the stock palette instead of T3 Chat colors, and seeded themes are unchanged. No merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: published themes that omit colors now fill them from the stock palette rather than the T3 Chat palette. It uses a conventional commit format and plain language, and ma…
Description check Passed The description follows the template. It has Problem, Change, Testing (verification), and Risk sections, and it names the focused test, the check command, the manual dev-server comparison, and the unt…
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.
Full details: Title check

Explanation

The title names the main change: published themes that omit colors now fill them from the stock palette rather than the T3 Chat palette. It uses a conventional commit format and plain language, and matches the changeset and the stated objectives.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Testing (verification), and Risk sections, and it names the focused test, the check command, the manual dev-server comparison, and the untested areas. It also links before/after screenshots. The Scope section is missing. The description does not link an issue or say why no issue is needed, and it does not state whether a maintainer requested the PR. The template asks for this under Scope, so the description is incomplete on that point, but the rest of the template is covered.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6b7027b and c308490.

Files selected for processing: 2

  • apps/web/src/hooks/useEnvironmentTheme.test.ts
  • apps/web/src/themePalette.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant