feat(theme): route widget selection colors through a seeded primary token (WIND-3)#148
Conversation
…rial scheme (WIND-3)
… primary token (WIND-3)
|
Warning Review limit reached
Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (15)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR introduces a seeded semantic primary color token (defaulting to Tailwind blue) and routes selection/accent styling in key interactive widgets through primary, enabling consumer branding via WindThemeData(colors: {'primary': ...}) while preserving the out-of-the-box look.
Changes:
- Seeded a default
primaryswatch in the default color map and updatedWindThemeData.toThemeData()to keep Material’s indigo baseline unlessprimaryis truly customized. - Updated
WSelect,WCheckbox,WRadio, andWDatePickerto useprimary-based class tokens and (where needed) raw icon colors. - Added/updated tests and performed doc + skill + changelog sync to document the new
primarytoken behavior.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/widgets/w_radio_test.dart | Adds regression tests asserting default/custom primary drives selected indicator color. |
| test/widgets/w_checkbox_test.dart | Adds regression tests asserting default/custom primary drives checked background color. |
| test/theme/wind_theme_data_test.dart | Verifies seeded primary maps to Tailwind blue and toThemeData() baseline behavior. |
| skills/wind-ui/SKILL.md | Bumps skill version and updates guidance around primary being seeded/overridable. |
| skills/wind-ui/references/theme.md | Documents seeded primary token and how it affects interactive widgets + Material baseline. |
| lib/src/widgets/w_select.dart | Replaces hardcoded blue classes/Colors.blue icon shades with primary-driven styling. |
| lib/src/widgets/w_radio.dart | Updates default selected styling tokens from blue to primary. |
| lib/src/widgets/w_date_picker.dart | Routes selected/in-range day styling through primary. |
| lib/src/widgets/w_checkbox.dart | Routes checked/hover styling docs + defaults through primary (and removes redundant blue token). |
| lib/src/theme/wind_theme_data.dart | Adjusts toThemeData() primary resolution to treat seeded default as “not customized.” |
| lib/src/theme/defaults/colors.dart | Adds a seeded semantic primary swatch aliased to Tailwind blue. |
| doc/widgets/w-radio.md | Updates docs to reflect primary-routed defaults and rebranding guidance. |
| doc/widgets/w-date-picker.md | Updates docs to reflect primary-routed selection/range styling and theme override example. |
| CHANGELOG.md | Records the new seeded primary token and widget routing behavior under Unreleased. |
…sh icons The raw Icon colors used MaterialColor.shadeN getters, which throw when a consumer registers a primary MaterialColor missing that shade. A new _primaryShade(int) helper falls back to the swatch base color. Adds a regression test with a base-only swatch.
…ness WCheckbox docblock now uses hover:border-primary-400 consistently; the date-picker theme example notes that omitted shades fall back to the base color and a complete 50-950 swatch is preferred when one primary is shared across widgets.
|
@coderabbitai review |
✅ Action performedReview finished.
|
…ry-color-tokens # Conflicts: # CHANGELOG.md
What (WIND-3)
Routes the hardcoded palette colors in
WSelect,WCheckbox,WRadio, andWDatePickerthrough a semanticprimarytoken so a consumer's brand color drives selection, checkmark, and accent colors.Load-bearing prerequisite: wind's default color map did NOT contain a
primarykey (bg-primarywas a silent no-op;primarywas consulted only bytoThemeData()). This PR seeds a defaultprimaryMaterialColor, aliased 1:1 to the Tailwind blue swatch, sobg-primary/text-primary/border-primaryresolve out of the box and the shipped look is unchanged, while becoming brand-overridable.Why
The selection/accent colors were hardcoded
blue-*classes andColors.blueshades, so a consumer's brand color could not drive them. NowWindThemeData(colors: {'primary': ...})recolors all four widgets.Changes
lib/src/theme/defaults/colors.dart: seed the defaultprimaryswatch.lib/src/theme/wind_theme_data.dart:toThemeData()keeps its indigo MaterialColorSchemebaseline unless a genuinely customprimaryis registered (aprimaryequal to the seeded default is treated as "not customized"), so default Material appearance is unchanged.lib/src/widgets/w_select.dart,w_checkbox.dart,w_radio.dart,w_date_picker.dart: reroute className + raw Icon colors to theprimarytoken; removed the redundantchecked:bg-blue-500on the checkbox.bg-primaryresolves to today's blue (regression guard) + a customprimaryrecolors the widgets.SKILL.md(2.8.2 -> 2.9.0),references/theme.md,doc/widgets/w-radio.md,doc/widgets/w-date-picker.md,CHANGELOG.md.Verification
dart analyzeclean,dart formatclean,flutter testgreen (widget + theme suites). Nobg-blue-*/text-blue-*/Colors.blueremains at the five widget sites.Note
Shares
CHANGELOG.md/SKILL.mdwith the WIND-1/5/4 PRs; whichever merges first, the others need a trivial rebase on those doc surfaces.