Skip to content

feat: add text selection modifier and platform support - #1212

Merged
Kyle-Ye merged 5 commits into
mainfrom
feature/text_select
Oct 25, 2026
Merged

Kyle-Ye merged 5 commits into
mainfrom
feature/text_select

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add View.textSelection(_:) with platform availability and selectability graph inputs.
  • Add UIKit selection providers and long-press gesture handling, plus AppKit selection overlays and native text fields.
  • Add selectable-text accessibility metadata, text-field scrolling control, and rectangle anchors.
  • Add three examples for selectability and inheritance, text layout and styling, and dynamic selection and text updates.
  • Add seven macOS double-click interaction cases for default, explicit, inherited, and overridden selectability in SwiftUI and OpenSwiftUI.

Fixes #1210

@Kyle-Ye
Kyle-Ye requested a review from Mx-Iris as a code owner October 24, 2026 17:43
@Kyle-Ye Kyle-Ye added this to the 0.25.0 milestone Oct 24, 2026
@github-actions github-actions Bot added area: accessibility Accessibility APIs, settings, semantics, or behavior. area: event-gesture Events, gestures, tracing, or interaction plumbing. area: text Text, labels, line style, and text rendering APIs. platform: iOS iOS-specific behavior or support. platform: macOS macOS-specific behavior or support. type: feature New API, behavior, platform support, or user-facing capability. labels Oct 24, 2026
@Kyle-Ye
Kyle-Ye force-pushed the feature/text_select branch from a8523bf to 4db72d6 Compare October 24, 2026 17:44
@tuist

tuist Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Ran test modules Commit
OpenSwiftUI ✅ 7 c6a0adf01

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI ✅ 1m 5s c6a0adf01

@codecov

codecov Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 184 lines in your changes missing coverage. Please review.
✅ Project coverage is 30.89%. Comparing base (095578f) to head (8de8711).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...s/OpenSwiftUI/View/Text/Text+Selection_macOS.swift 0.00% 130 Missing ⚠️
.../OpenSwiftUICore/Layout/Geometry/Anchor+Rect.swift 0.00% 24 Missing ⚠️
...s/OpenSwiftUI/Event/Gesture/LongPressGesture.swift 0.00% 8 Missing ⚠️
Sources/OpenSwiftUI/View/Text/Text+Selection.swift 0.00% 7 Missing ⚠️
...iftUI/View/TextField/TextInputCustomizations.swift 0.00% 5 Missing ⚠️
...tUI/Accessibility/AccessibilityConfiguration.swift 0.00% 4 Missing ⚠️
...rces/OpenSwiftUI/View/Text/TextSelectionMenu.swift 0.00% 3 Missing ⚠️
...iftUI/View/TextField/NSTextField+Environment.swift 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1212      +/-   ##
==========================================
+ Coverage   27.01%   30.89%   +3.88%     
==========================================
  Files         885      960      +75     
  Lines       65819    77650   +11831     
==========================================
+ Hits        17781    23992    +6211     
- Misses      48038    53658    +5620     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye

Kyle-Ye commented Oct 24, 2026

Copy link
Copy Markdown
Member Author

/interactiontest macos osui-iag only-testing=OpenSwiftUIInteractionTests/TextSelectionInteractionTests

@Kyle-Ye
Kyle-Ye merged commit b930e46 into main Oct 25, 2026
8 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/text_select branch October 25, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: accessibility Accessibility APIs, settings, semantics, or behavior. area: event-gesture Events, gestures, tracing, or interaction plumbing. area: text Text, labels, line style, and text rendering APIs. platform: iOS iOS-specific behavior or support. platform: macOS macOS-specific behavior or support. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the text selection modifier

1 participant