feat: system-selectable plain text surface (SelectableText) for three platforms - #96
Merged
Merged
Conversation
bytemain
force-pushed
the
bisheng/task69-selectable-plain-text
branch
3 times, most recently
from
July 31, 2026 05:51
01140f5 to
018de72
Compare
Add SelectableText, a read-only plain text component rendered by each platform's native text view so the OS selection experience is available anchored to the selection. Baseline guarantee: word selection, drag handles, Select all, Copy; further menu actions (Translate / Look Up / Share / Android PROCESS_TEXT targets) appear only as provided by the OS version, locale and installed services. The surface never opens an IME and text mutates only via the text prop. - core: SelectableTextView (KRSelectableTextView type) measured with the shared rich-text shadow, SelectableTextAttr reusing TextConst wire keys, ViewContainer.SelectableText DSL - Android: KRSelectableTextView (TextView + setTextIsSelectable), system ActionMode; registered in KuiklyRenderViewBaseDelegator - iOS: KRSelectableTextView (UITextView editable=NO selectable=YES), system edit menu; resolved by class-name convention - OHOS: KRSelectableTextView (ARKUI_NODE_TEXT + NODE_TEXT_COPY_OPTION local-device copy scope), native selection menu; registered in ComponentsRegisterEntry - Compose: SelectableText(text, modifier, style) with a pure style-to-props resolver; every supported field always resolves to a concrete wire value (deterministic defaults for unspecified fields) so style updates on the reusable node reset prior values on both the native renderer and the measuring shadow - tests: Robolectric behavior contract (selectable/read-only/wire props) and commonTest teeth covering resolver defaults, density scaling, weight/align mapping, full wire coverage and the specified->Default reset sequence - docs: docs/API/components/selectable-text.md with explicit capability boundary (baseline Select all/Copy; extras are platform-provided) Raft: #Kuiklybase task #69 (Phase 1 of #proj-chat task Tencent-TDS#924) Signed-off-by: BiSheng <raft-mobile-bisheng@mail.build> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
bytemain
force-pushed
the
bisheng/task69-selectable-plain-text
branch
from
July 31, 2026 06:03
018de72 to
1852436
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds SelectableText — a read-only plain text surface rendered by each platform's native system text view, so the OS supplies the complete selection experience: word selection, drag handles, Select all, Copy, and system extension actions (Translate / Look Up / Share / PROCESS_TEXT) anchored to the selection. The surface never opens an IME; text mutates only through the
textprop.Phase 1 of the thread-message text-selection restoration (Raft #Kuiklybase task #69, source #proj-chat task Tencent-TDS#924). Mobile Phase 2 will consume this to replace the
SelectionContainer+ custom top-bar action fallback that lost the system menu.Design
SelectableTextView(KRSelectableTextViewbridge type) measured via the shared rich-textTextShadow— same self-sizing approach asTextAreaView, so layout and native rendering consume identicalTextConstwire props (text/fontSize/fontWeight/color/lineHeight/textAlign/useDpFontSizeDim). DSL:ViewContainer.SelectableText {}.TextView+setTextIsSelectable(true)→ system ActionMode; not an EditText, so no input connection/IME by construction.reusable=falseso selection state never leaks across reuse.UITextViewwitheditable=NO / selectable=YES / scrollEnabled=NO, zeroed insets; resolved by class-name convention, props viacss_setters; system edit menu.ARKUI_NODE_TEXT+NODE_TEXT_COPY_OPTION = LOCAL_DEVICE→ native selection/copy menu; registered inComponentsRegisterEntry;ReuseEnable=false.SelectableText(text, modifier, style)with an internal pureTextStyle→props resolver.Tests
KRSelectableTextViewTest(Robolectric): selectable + read-only by construction (onCheckIsTextEditor()==false), text/color/textAlign prop behavior, wire-key contract pin.SelectableTextStylePropsTest(commonTest): color formatting, density scaling, fontWeight bucketing, textAlign keyword mapping, unspecified-omission.Boundary
Source + CI only; three-platform device validation belongs to task Tencent-TDS#924 Phase 2 per the task contract.
Raft: #Kuiklybase task #69
Signed-off-by: BiSheng raft-mobile-bisheng@mail.build