Fix Text parity fuzz edge cases#75
Conversation
|
@adamivancza is attempting to deploy a commit to the Kuatsu Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughRewrites the style-based ChangesSelectable Extraction and Parity Fixes
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
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/react-native-boost/src/plugin/optimizers/text/index.ts`:
- Line 339: The `selectable` prop generation currently emits an identifier for
`undefined`, which can be shadowed by a local binding. Update the `selectable`
handling in the text optimizer logic to emit an unshadowable undefined value
using the existing AST helper pattern instead of `t.identifier('undefined')`,
while keeping the boolean literal path unchanged. Use the surrounding
`selectable.value` expression in
`packages/react-native-boost/src/plugin/optimizers/text/index.ts` to locate the
fix.
In `@packages/react-native-boost/src/plugin/utils/common/attributes.ts`:
- Around line 431-452: The style-userSelect extraction in attributes.ts is too
optimistic when `styleExpr` contains mixed or unresolved entries, which can
cause the computed selectable value to be overridden by later flattened styles.
Update the logic around the candidate collection and `processTextStyle` handling
so it bails out to runtime whenever the style array includes dynamic elements,
spreads, or any unresolved nested entries rather than only handling fully static
object arrays. Keep the fix localized to the `collect` flow and the final
`last`/`removeUserSelectProperties` decision so `selectable` is only derived
when RN flatten order can be preserved safely.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 89981b52-bafa-49f9-8ec4-c85d566c5e15
📒 Files selected for processing (4)
packages/react-native-boost/src/plugin/__tests__/parity/normalize.tspackages/react-native-boost/src/plugin/__tests__/parity/parity.test.tspackages/react-native-boost/src/plugin/optimizers/text/index.tspackages/react-native-boost/src/plugin/utils/common/attributes.ts
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Appreciated! :) |
Fixes #72
Fixes #74
Summary
style: nullas host-equivalent to absent style in parity comparisonsstyle.userSelectclobber directselectableeven when the value maps toundefinedValidation
Summary by CodeRabbit
nulland unknown selectable states are treated more consistently.