Skip to content

Comments

Support textBreakStrategy and justificationMode for Selectable Facsimile TextView#55660

Open
NickGerleman wants to merge 3 commits intofacebook:mainfrom
NickGerleman:export-D93933310
Open

Support textBreakStrategy and justificationMode for Selectable Facsimile TextView#55660
NickGerleman wants to merge 3 commits intofacebook:mainfrom
NickGerleman:export-D93933310

Conversation

@NickGerleman
Copy link
Contributor

Summary:
getReactTextUpdateFromPreparedLayout() hardcoded textBreakStrategy to
BREAK_STRATEGY_HIGH_QUALITY and justificationMode to 0, causing
user-specified values like textBreakStrategy: "simple" or
textAlign: "justify" to be ignored when the PreparedLayout code path
is used via ReferenceStateWrapper.

This change surfaces the textBreakStrategy and justificationMode
values already computed in TextLayoutManager.createLayout() by:

  • Introducing a CreateLayoutResult wrapper to return them alongside the Layout
  • Adding both fields to PreparedLayout
  • Propagating them through FabricUIManager.reusePreparedLayoutWithNewReactTags()
  • Using the real values in ReactTextViewManager.getReactTextUpdateFromPreparedLayout()

Changelog: [Internal]

Differential Revision: D93933310

…k#55634)

Summary:

Extract ParagraphComponentDescriptor logic into a template base class BaseParagraphComponentDescriptor<ShadowNodeT> so that other paragraph-like component descriptors can reuse the same TextLayoutManager wiring. Remove `final` from ParagraphShadowNode to allow subclassing. Move TextLayoutManagerKey from extern linkage in .cpp to constexpr in the new header.

This is a pure refactor with no behavioral change.

Changelog:
[Internal]

Reviewed By: cortinico

Differential Revision: D93829402
Summary:
Add the native components needed to route selectable text through ReactTextView instead of PreparedLayoutTextView when enablePreparedTextLayout is on.

C++ side: Add SelectableParagraphShadowNode (inherits ParagraphShadowNode) and SelectableParagraphComponentDescriptor (inherits BaseParagraphComponentDescriptor). Register in CoreComponentsRegistry and componentNameByReactViewName.

Android side: Make ReactTextViewManager open so it can be subclassed. Add getReactTextUpdateFromPreparedLayout to handle ReferenceStateWrapper holding PreparedLayout. Create SelectableTextViewManager (extends ReactTextViewManager, registered as RCTSelectableText). Add FabricNameComponentMapping entry for SelectableParagraph -> RCTSelectableText.

No JS code references RCTSelectableText yet, so the new components are inert.

Changelog:
[Internal]

Differential Revision: D93829400
…ile TextView

Summary:
`getReactTextUpdateFromPreparedLayout()` hardcoded `textBreakStrategy` to
`BREAK_STRATEGY_HIGH_QUALITY` and `justificationMode` to `0`, causing
user-specified values like `textBreakStrategy: "simple"` or
`textAlign: "justify"` to be ignored when the PreparedLayout code path
is used via `ReferenceStateWrapper`.

This change surfaces the `textBreakStrategy` and `justificationMode`
values already computed in `TextLayoutManager.createLayout()` by:
- Introducing a `CreateLayoutResult` wrapper to return them alongside the `Layout`
- Adding both fields to `PreparedLayout`
- Propagating them through `FabricUIManager.reusePreparedLayoutWithNewReactTags()`
- Using the real values in `ReactTextViewManager.getReactTextUpdateFromPreparedLayout()`

Changelog: [Internal]

Differential Revision: D93933310
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 20, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 20, 2026

@NickGerleman has exported this pull request. If you are a Meta employee, you can view the originating Diff in D93933310.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants