Skip to content

feat(theme): route widget selection colors through a seeded primary token (WIND-3)#148

Merged
anilcancakir merged 8 commits into
masterfrom
feat/semantic-primary-color-tokens
Jul 7, 2026
Merged

feat(theme): route widget selection colors through a seeded primary token (WIND-3)#148
anilcancakir merged 8 commits into
masterfrom
feat/semantic-primary-color-tokens

Conversation

@anilcancakir

Copy link
Copy Markdown
Collaborator

What (WIND-3)

Routes the hardcoded palette colors in WSelect, WCheckbox, WRadio, and WDatePicker through a semantic primary token so a consumer's brand color drives selection, checkmark, and accent colors.

Load-bearing prerequisite: wind's default color map did NOT contain a primary key (bg-primary was a silent no-op; primary was consulted only by toThemeData()). This PR seeds a default primary MaterialColor, aliased 1:1 to the Tailwind blue swatch, so bg-primary/text-primary/border-primary resolve out of the box and the shipped look is unchanged, while becoming brand-overridable.

Why

The selection/accent colors were hardcoded blue-* classes and Colors.blue shades, so a consumer's brand color could not drive them. Now WindThemeData(colors: {'primary': ...}) recolors all four widgets.

Changes

  • lib/src/theme/defaults/colors.dart: seed the default primary swatch.
  • lib/src/theme/wind_theme_data.dart: toThemeData() keeps its indigo Material ColorScheme baseline unless a genuinely custom primary is registered (a primary equal 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 the primary token; removed the redundant checked:bg-blue-500 on the checkbox.
  • Tests: default bg-primary resolves to today's blue (regression guard) + a custom primary recolors the widgets.
  • 5-surface doc sync: 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 analyze clean, dart format clean, flutter test green (widget + theme suites). No bg-blue-*/text-blue-*/Colors.blue remains at the five widget sites.

Note

Shares CHANGELOG.md / SKILL.md with the WIND-1/5/4 PRs; whichever merges first, the others need a trivial rebase on those doc surfaces.

Copilot AI review requested due to automatic review settings July 7, 2026 14:11
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@anilcancakir, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ad98d681-45cb-4ef6-8c3a-2a4816c7f1a6

📥 Commits

Reviewing files that changed from the base of the PR and between 092cb10 and 1104f80.

📒 Files selected for processing (15)
  • CHANGELOG.md
  • doc/widgets/w-date-picker.md
  • doc/widgets/w-radio.md
  • lib/src/theme/defaults/colors.dart
  • lib/src/theme/wind_theme_data.dart
  • lib/src/widgets/w_checkbox.dart
  • lib/src/widgets/w_date_picker.dart
  • lib/src/widgets/w_radio.dart
  • lib/src/widgets/w_select.dart
  • skills/wind-ui/SKILL.md
  • skills/wind-ui/references/theme.md
  • test/theme/wind_theme_data_test.dart
  • test/widgets/w_checkbox_test.dart
  • test/widgets/w_radio_test.dart
  • test/widgets/w_select_test.dart
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/semantic-primary-color-tokens

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 primary swatch in the default color map and updated WindThemeData.toThemeData() to keep Material’s indigo baseline unless primary is truly customized.
  • Updated WSelect, WCheckbox, WRadio, and WDatePicker to use primary-based class tokens and (where needed) raw icon colors.
  • Added/updated tests and performed doc + skill + changelog sync to document the new primary token 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.

Comment thread lib/src/widgets/w_checkbox.dart Outdated
Comment thread lib/src/widgets/w_select.dart Outdated
Comment thread lib/src/widgets/w_select.dart Outdated
Comment thread lib/src/widgets/w_select.dart Outdated
Comment thread lib/src/widgets/w_select.dart Outdated
Comment thread doc/widgets/w-date-picker.md
…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.
@anilcancakir

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.

@anilcancakir anilcancakir merged commit 11db93d into master Jul 7, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants