Repository navigation
fix(registry): keep equal Fortal themes from rebuilding token readers - #325
Open
leoafarias wants to merge 3 commits into
Open
leoafarias wants to merge 3 commits into
leoafarias wants to merge 3 commits into
Conversation
Fortal's shadow tokens are lists, and a plain List equals only itself. MixScope compares the old and new token maps value by value to decide whether to notify its dependents, so every FortalTheme rebuild, even with identical settings, notified every widget that reads a Fortal token. Vanilla's tokens are all value-equal and were never affected. buildFortalScopeTokens now returns its shadow lists as unmodifiable lists that compare by value, so an equal theme builds an equal token map. The registry template and the demo and dashboard installed copies are regenerated.
…des above it Every theme scope installs a complete token set instead of merging with the scope above it, in Vanilla and in Fortal alike, so a MixScope.inherit override made above a nested theme does not apply below it. Say so next to the description of nested scopes, and where to place the override instead.
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. |
This branch has not been deployed
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.
Description
Fortal's shadow tokens are
Lists, and a plainListequals only itself.MixScopedecides whether to notify its dependents by comparing the old and new token maps value by value, so everyFortalThemerebuild, even with identical settings, notified every widget that reads a Fortal token. Vanilla's tokens are all value-equal and were not affected.buildFortalScopeTokensnow returns its 22 shadow lists (6List<BoxShadow>, 16List<RemixBoxShadow>) as unmodifiable lists that compare by value, so an equal theme builds an equal token map. The registry template and the demo and dashboard installed copies are regenerated.The second commit documents that every theme scope (Vanilla and Fortal) installs a complete token set instead of merging with the scope above it, so a
MixScope.inheritoverride made above a nested theme, such as a customfocusRingWidth, does not apply below it. That is existing behavior and matches Vanilla and the building-remix-design-system skill's scope contract; a plain merge would not change it for Fortal tokens because the nested map contains every Fortal key. No code change for it.Validation
theme_rebuild_test.dartcounts builds of a token-reading descendant across an equal rebuild (light and dark) and a changed accent. It fails on main (Expected: <1> Actual: <2>) and passes here.registry_sourcefull suite 1392 passed;apps/demo64 andapps/dashboard84 passed.dart formatclean;dart analyzeclean on registry_source and the two touched apps;ci:checks,docs:check,open-code:registry:build(no drift), andopen-code:apps:checkpass.Related Issues
Follow-up to review of #319 (finding on the Fortal rebuild amplifier) and #320 (nested scope reset note).
Checklist
///).Breaking Change