Skip to content

fix: withUniwind remove className props on web after converting them - #615

Merged
Brentlok merged 3 commits into
mainfrom
fix/withUniwind-remove-classnames
Jul 27, 2026
Merged

fix: withUniwind remove className props on web after converting them#615
Brentlok merged 3 commits into
mainfrom
fix/withUniwind-remove-classnames

Conversation

@Brentlok

@Brentlok Brentlok commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

#614

Summary by CodeRabbit

  • Bug Fixes
    • Prevented class-related and color-related input props from being forwarded to wrapped components during both automatic and manual unwinding.
    • Ensured generated style and color props are computed from the original values and applied as expected, without leaking intermediate props.
  • Tests
    • Updated HOC tests to verify correct prop-forwarding behavior for auto and manual modes, including inline color override cases.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b3acefb9-237b-42a7-9a06-bae993af9ca7

📥 Commits

Reviewing files that changed from the base of the PR and between b362532 and fba86dc.

📒 Files selected for processing (2)
  • packages/uniwind/src/hoc/withUniwind.tsx
  • packages/uniwind/tests/web/hoc/withUniwind.test.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/uniwind/src/hoc/withUniwind.tsx
  • packages/uniwind/tests/web/hoc/withUniwind.test.tsx

📝 Walkthrough

Walkthrough

The auto and manual Uniwind HOCs now shallow-copy incoming props and remove styling props after processing them. Tests verify generated styles and colors remain forwarded while source class props are omitted.

Changes

HOC prop filtering

Layer / File(s) Summary
Auto HOC prop filtering
packages/uniwind/src/hoc/withUniwind.tsx, packages/uniwind/tests/web/hoc/withUniwind.test.tsx
withAutoUniwind copies props, removes processed class and style inputs, and tests the forwarded generated styles and colors.
Manual HOC prop filtering
packages/uniwind/src/hoc/withUniwind.tsx, packages/uniwind/tests/web/hoc/withUniwind.test.tsx
withManualUniwind copies props, removes mapped class inputs, and tests the resulting style props.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: withUniwind now strips className-related props after converting them on web.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/withUniwind-remove-classnames

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.

@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown

Greptile Summary

This PR prevents processed styling props from being forwarded on web.

  • Clones incoming props before removing converted class and color properties.
  • Reads manual mapping sources from the original props so multiple mappings can reuse the same source.
  • Adds assertions that generated values remain present while source class props are removed.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/uniwind/src/hoc/withUniwind.tsx Separates immutable source reads from the forwarded prop clone, fixing shared manual-source handling while removing converted props.
packages/uniwind/tests/web/hoc/withUniwind.test.tsx Extends web HOC coverage to verify generated styles and colors are retained while processed source props are omitted.

Reviews (2): Last reviewed commit: "chore: fixes" | Re-trigger Greptile

Comment thread packages/uniwind/src/hoc/withUniwind.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/uniwind/src/hoc/withUniwind.tsx`:
- Line 49: Update the early-return branch in withUniwind so it also deletes the
color class source prop when both color and colorClassName are provided, before
returning. Preserve the existing deletion at the later filtering point and
ensure the wrapped component never receives colorClassName when the inline color
takes precedence.
- Around line 92-98: Update withManualUniwind so the reducer reads each
mapping’s source value from originalProps rather than the mutable props object,
allowing multiple target props to reuse the same fromClassName. Continue
deleting consumed source properties only from props so they are excluded from
forwarded props.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a9d3c25c-e9fe-4e58-ae1f-85e6ffb5363d

📥 Commits

Reviewing files that changed from the base of the PR and between 6cce440 and b362532.

📒 Files selected for processing (2)
  • packages/uniwind/src/hoc/withUniwind.tsx
  • packages/uniwind/tests/web/hoc/withUniwind.test.tsx

Comment thread packages/uniwind/src/hoc/withUniwind.tsx Outdated
Comment thread packages/uniwind/src/hoc/withUniwind.tsx
@Brentlok
Brentlok merged commit 2ea1b53 into main Jul 27, 2026
3 checks passed
@Brentlok
Brentlok deleted the fix/withUniwind-remove-classnames branch July 27, 2026 12:08
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.

1 participant