Conversation
A definition naming an appearance token this build does not know now resolves with that token dropped and reported, instead of being rejected whole. Unknown colours, invalid values for known tokens, and CSS or markup carried by an unknown token still reject the definition.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
|
Lighthouse CI failed. The last 80 log lines contain the measured budgets and assertion failures. |
berry-13
deleted the
followup/127-16340-let-theme-readers-tolerate-unknown-appeara
branch
September 25, 2026 19:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary
validateThemeDefinitionrejected a whole theme definition when a mode'sappearancenamed a token the running build did not know. Each PR that adds an appearance token (the radius and font scales in #16340, the shadow scale in #16341) therefore made stored andinterface.themedefinitions using it unreadable to an older frontend: after a rollback the user lost the theme's colors and every other appearance value, not just the new one.Readers now ignore an unknown appearance token instead of rejecting the definition.
resolveThemeleaves it out, andThemeProviderreports it once per applied definition with a console warning. A stored definition keeps the key, so rolling forward again restores it. Unknown color tokens, invalid values for known appearance tokens, and an unknown token whose name or value carries CSS or markup (;, braces,url(, angle brackets) still reject the definition. The stored, controlled and deployment paths share this behavior because they all go through the registry and the provider.Addresses berry-13#127, raised on #16340.
Type of change
Testing
Tested environments/configuration:
Automated tests:
cd packages/client && npx jest src/theme: 282 passed. The 7 new or changed cases inregistry.spec.tsandThemeProvider.spec.tsxfail against the canary source and pass with this change.cd client && npx jest src/Providers/__tests__/DeploymentTheme.spec.tsx: 16 passed, one new case for an inlineinterface.themewith an unknown token.e2e/specs/mock/scenarios/theme-unknown-appearance.spec.tswith four scenarios: stored and deployment definitions with an unknown token apply the rest, an invalid known value still rejects, and CSS carried by an unknown token still rejects.npx tsc --noEmitinpackages/client,npm run typecheckinclient, andnpm run static-checks -- --against origin/canary: all clean.Screenshots / recordings
No new UI. A theme carrying a newer token now paints instead of falling back to the default, which the e2e scenarios assert on the rendered root styles.
Risk / compatibility
Readers become more permissive only for appearance keys. An ignored key never reaches the DOM, and its name and value are still checked for injection. The server schema already accepts any string-valued appearance key, so no config changes.
Checklist