Skip to content

preserve style selectable precedence#76

Merged
mfkrause merged 1 commit into
kuatsu:mainfrom
adamivancza:fix-text-selectable-fuzz
Jul 10, 2026
Merged

preserve style selectable precedence#76
mfkrause merged 1 commit into
kuatsu:mainfrom
adamivancza:fix-text-selectable-fuzz

Conversation

@adamivancza

@adamivancza adamivancza commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Nightly build on my fork failed: https://github.com/adamivancza/react-native-boost/actions/runs/28921814048

Fixes a parity fuzz divergence where static style.userSelect did not override selectable from a later spread.

React Native Text applies userSelect as a late style-derived override, so:

<Text style={{ userSelect: 'none' }} {...{ selectable: true }} />

should end up with selectable={false}.

Boost already handled the dynamic processTextStyle(...) path this way, but the static build-time selectable attribute was emitted too early and could be overwritten by later props/spreads.

Changes

  • Emit static userSelect-derived selectable after remaining attributes/spreads
  • Add the exact fuzz-discovered parity case
  • Update Text fixture output order

Verification

pnpm package test text
pnpm package test parity

Summary by CodeRabbit

  • Bug Fixes
    • Improved how text selection-related props are handled so later overrides behave consistently.
    • Fixed optimized text output to match standard rendering, including prop order and native prop values.
    • Added coverage for a scenario where static text selection settings are combined with later prop spreads.

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
react-native-boost-docs Skipped Skipped Jul 8, 2026 10:31am

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b1116de2-414c-4af0-8788-bba56149ed2f

📥 Commits

Reviewing files that changed from the base of the PR and between cc94e0e and 1bb55b9.

📒 Files selected for processing (4)
  • packages/react-native-boost/src/plugin/__tests__/parity/parity.test.ts
  • packages/react-native-boost/src/plugin/optimizers/text/__tests__/fixtures/static-style-user-select-overrides-selectable/output.js
  • packages/react-native-boost/src/plugin/optimizers/text/__tests__/fixtures/static-style-user-select/output.js
  • packages/react-native-boost/src/plugin/optimizers/text/index.ts

Walkthrough

This PR reorders JSX attribute emission for Text components so selectableAttribute is placed after remainingAttributes and staticStyleAttribute, updates two fixture outputs accordingly, and adds a parity test verifying static userSelect overrides a later selectable spread.

Changes

Text attribute ordering fix

Layer / File(s) Summary
Reorder selectableAttribute emission
packages/react-native-boost/src/plugin/optimizers/text/index.ts
processProps now emits selectableAttribute after remainingAttributes and staticStyleAttribute instead of right after accessibilitySpread, with updated comments explaining the intent.
Fixture and parity test updates
packages/react-native-boost/src/plugin/optimizers/text/__tests__/fixtures/static-style-user-select/output.js, packages/react-native-boost/src/plugin/optimizers/text/__tests__/fixtures/static-style-user-select-overrides-selectable/output.js, packages/react-native-boost/src/plugin/__tests__/parity/parity.test.ts
Fixture outputs are reformatted/reordered to match the new attribute placement, and a new parity test asserts static userSelect overrides a later selectable spread while keeping Boost and wrapper outputs identical.

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

Possibly related PRs

Poem

A hop, a skip, a prop rearranged,
Selectable's place has finally changed 🐇
After the spread, it now takes its seat,
UserSelect wins — the override complete!
Fixtures updated, tests all in tune,
This bunny's proud beneath the moon. 🌙

🚥 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 is concise and accurately reflects the main change: preserving selectable precedence from style over later props.
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 unit tests (beta)
  • Create PR with unit tests

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.

@mfkrause mfkrause merged commit b5ff429 into kuatsu:main Jul 10, 2026
8 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