Skip to content

feat(focus): connect keyboard actions and platform focus - #1183

Merged
Kyle-Ye merged 17 commits into
mainfrom
feature/key_press
Oct 18, 2026
Merged

Kyle-Ye merged 17 commits into
mainfrom
feature/key_press

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Oct 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Connect AppKit keyboard events to focused onKeyPress handlers for down, repeat, and up phases.
  • Wire focusable views, focus scopes, and default-focus resets through the view graph and macOS, iOS, and visionOS hosting bridges.
  • Add first-responder tracking, focus navigation, key-view proxies, and UIKit focus-item helpers.
  • Add focus navigation and key-event dispatch coverage, plus a two-panel keyboard example.

Closes #1158

@Kyle-Ye
Kyle-Ye requested a review from Mx-Iris as a code owner October 18, 2026 10:44
@Kyle-Ye Kyle-Ye added this to the 0.24.0 milestone Oct 18, 2026
@github-actions github-actions Bot added area: event-gesture Events, gestures, tracing, or interaction plumbing. area: hosting-bridge SwiftUI bridge, UIHosting/NSHosting, representables, and platform host views. platform: macOS macOS-specific behavior or support. type: feature New API, behavior, platform support, or user-facing capability. labels Oct 18, 2026
@tuist

tuist Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Ran test modules Commit
OpenSwiftUI ✅ 7 7069ca5c6

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI ✅ 1m 25s 7069ca5c6

@codecov

codecov Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 31.00173% with 799 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.49%. Comparing base (8df5e78) to head (197de9c).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
Sources/OpenSwiftUI/Event/Focus/FocusBridge.swift 17.94% 320 Missing ⚠️
Sources/OpenSwiftUI/Event/Focus/Focusable.swift 0.90% 110 Missing ⚠️
Sources/OpenSwiftUI/Event/Focus/DefaultFocus.swift 0.93% 106 Missing ⚠️
...ntegration/Hosting/AppKit/View/NSHostingView.swift 30.15% 88 Missing ⚠️
Sources/OpenSwiftUI/Event/Focus/FocusSection.swift 0.00% 50 Missing ⚠️
Sources/OpenSwiftUI/Event/Focus/KeyViewProxy.swift 15.38% 44 Missing ⚠️
...urces/OpenSwiftUI/Event/Focus/FocusNavigator.swift 79.23% 38 Missing ⚠️
...enSwiftUI/Event/Focus/FirstResponderObserver.swift 42.30% 30 Missing ⚠️
...nt/Platform/AppKit/AppKitKeyEventConversions.swift 0.00% 9 Missing ⚠️
...urces/OpenSwiftUI/Event/Focus/FocusViewGraph.swift 77.77% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1183      +/-   ##
==========================================
+ Coverage   29.37%   29.49%   +0.12%     
==========================================
  Files         946      950       +4     
  Lines       74841    75987    +1146     
==========================================
+ Hits        21985    22416     +431     
- Misses      52856    53571     +715     

☔ 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.

@github-actions github-actions Bot added area: example Example apps, previews, sample projects, screenshots, or demo assets. area: tests Test suites, UI tests, fixtures, snapshots, and test support code. platform: iOS iOS-specific behavior or support. platform: visionOS visionOS-specific behavior or support. labels Oct 18, 2026
@Kyle-Ye
Kyle-Ye merged commit 743c60a into main Oct 18, 2026
7 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/key_press branch October 18, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: event-gesture Events, gestures, tracing, or interaction plumbing. area: example Example apps, previews, sample projects, screenshots, or demo assets. area: hosting-bridge SwiftUI bridge, UIHosting/NSHosting, representables, and platform host views. area: tests Test suites, UI tests, fixtures, snapshots, and test support code. platform: iOS iOS-specific behavior or support. platform: macOS macOS-specific behavior or support. platform: visionOS visionOS-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 keyboard action support on macOS

1 participant