Skip to content

docs(styling): document and test-prove the recipe caller-append merge contract#146

Merged
anilcancakir merged 4 commits into
masterfrom
docs/recipe-caller-append-contract
Jul 7, 2026
Merged

docs(styling): document and test-prove the recipe caller-append merge contract#146
anilcancakir merged 4 commits into
masterfrom
docs/recipe-caller-append-contract

Conversation

@anilcancakir

Copy link
Copy Markdown
Collaborator

What (WIND-1)

Verifies and documents that WindRecipe/WindSlotRecipe already merge a caller className correctly: the recipe only appends the caller className last, and the conflict with a base token is resolved one layer down, at parse time, by WindParser's per-family last-wins. There is intentionally no Dart twMerge/cn port.

This PR adds no runtime code. It locks the contract with tests and documents it.

Why

The recipe merge behavior was correct but undocumented, and the "className replaces the recipe" anti-pattern (a consumer bug, not a wind defect) needed to be stated on the record so consumers do not re-implement a twMerge that wind does not need.

Changes

  • test/recipe/wind_recipe_test.dart: proves WindRecipe(base: 'w-1/2')(className: 'w-full') emits w-1/2 w-full (caller appended last, order preserved, no dedup).
  • test/parser/parsers/sizing_parser_test.dart: proves the appended w-full wins at parse time (widthFactor resolves to 1.0).
  • doc/styling/wind-recipe.md, skills/wind-ui/SKILL.md: document the caller-append contract and note the REPLACE anti-pattern lives in consumer components, not wind.

Verification

dart analyze clean, dart format clean, flutter test green.

Copilot AI review requested due to automatic review settings July 7, 2026 14:06
@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: 29 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: d50d9c86-bc9a-446a-bc79-6c854c6864fd

📥 Commits

Reviewing files that changed from the base of the PR and between 7dcb980 and 3a760f3.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • doc/styling/wind-recipe.md
  • skills/wind-ui/SKILL.md
  • test/parser/parsers/sizing_parser_test.dart
  • test/recipe/wind_recipe_test.dart
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/recipe-caller-append-contract

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.

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 locks in and documents Wind’s “caller-append” merge contract for WindRecipe/WindSlotRecipe, showing that caller-provided className is appended last (no dedupe/twMerge) and that conflicts are resolved at parse time via per-family last-wins in WindParser/parsers.

Changes:

  • Added a recipe-level test proving the emitted class string preserves both conflicting tokens with caller appended last.
  • Added a parser-level test proving the trailing (caller) sizing token wins (w-full overrides w-1/2 at parse time).
  • Documented the contract in user docs and the wind-ui skill, plus recorded it in CHANGELOG.md.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/recipe/wind_recipe_test.dart Adds a test proving WindRecipe appends caller className last without merging/deduping.
test/parser/parsers/sizing_parser_test.dart Adds a test proving parse-time last-wins makes appended w-full win over base w-1/2.
skills/wind-ui/SKILL.md Documents the caller-append/no-twMerge recipe contract for the skill surface.
doc/styling/wind-recipe.md Documents the caller-append contract and explains parse-time conflict resolution.
CHANGELOG.md Adds an Unreleased entry describing the newly documented/test-proved contract.

Comment thread doc/styling/wind-recipe.md Outdated
Comment thread doc/styling/wind-recipe.md Outdated
@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!

… note consumer-agnostic

Addresses PR review: the parse-time-resolution sentence now cites
WindParser.findAndGroupClasses / SizingParser.parse (the recipe rationale
reference moves to the no-twMerge sentence where it belongs), and the
className-REPLACE anti-pattern note no longer names a specific downstream project.
@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 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread doc/styling/wind-recipe.md Outdated
@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.

@anilcancakir anilcancakir merged commit 41b23a3 into master Jul 7, 2026
9 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