feat(theme)!: standardize theme scopes and remove legacy APIs - #212
Open
leoafarias wants to merge 4 commits into
Open
leoafarias wants to merge 4 commits into
leoafarias wants to merge 4 commits into
Conversation
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
Add
theme,darkTheme, andmodeto FortalScope and both generated preset scopes. Root scopes supply light/dark defaults and follow live system brightness. A suppliedthemewithoutdarkThemeis used in both modes; nested scopes inherit the configured pair and current selection. The application owns the mode preference.Use WidgetsApp throughout the dashboard, examples, generated-consumer hosts, documentation, skills, and downloadable tutorials. Put routed scopes in the app builder above the Navigator. Preserve application-owned custom tokens. The scope supplies appearance; no new app wrapper is introduced.
Enforce the hard cutoff with a lexical guard that handles comments, strings, named constructors, typed declarations, configured prefixes, and tutorial/integration tests while allowing unrelated scope APIs. Regression tests assert inherited token colors, custom-theme preservation, live dialogs, and text-style inheritance across host placements.
Related Issues
Stacked on #211. Merge #211 first, then retarget this PR to main.
Validation
Current follow-up commit:
The prior dashboard browser verification covered light/dark/system selection, charts, tables, dialog open/Escape, and no console errors. This follow-up changes test hosts and guidance without changing application runtime behavior. Original tutorial screenshots predate the host/theme migration; the archive contains updated tested source.
Checklist
Breaking Change
Remove default-scope
data, FortalScopebrightness, and configurationcreateScopeAPIs without aliases. Usethemefor supplied values andmodefor appearance selection. Theme data/configuration retains resolvedbrightness; intentional direct Fortal design options remain available. Migrate installed source and callers together.