Skip to content

feat(focus): implement focus event proxy - #1132

Merged
Kyle-Ye merged 1 commit into
mainfrom
feature/focus_event_proxy
Oct 9, 2026
Merged

Kyle-Ye merged 1 commit into
mainfrom
feature/focus_event_proxy

Conversation

@Kyle-Ye

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

Copy link
Copy Markdown
Member

Summary

  • Add focus event proxy wrapping when focus inputs and responder preferences require it, with a stable proxy as child responders change.
  • Keep the proxy responder private while preserving lookup on FocusableViewResponder through an internal cast helper.

Validation

Scoped type checks and standalone proxy behavior checks passed. A full package build was not run.

@github-actions github-actions Bot added area: event-gesture Events, gestures, tracing, or interaction plumbing. type: feature New API, behavior, platform support, or user-facing capability. labels Oct 9, 2026
@augmentcode

augmentcode Bot commented Oct 9, 2026

Copy link
Copy Markdown

PR Risk Analyzer Agent 🛡️

👀 Human review needed

Justification

This PR introduces net-new focus event proxy behavior rather than a trivial or mechanical change:

  • Adds FocusEventProxyModifier (iOS/visionOS) that rewires a view's viewResponders preference via a new FocusEventProxyResponderFilter attribute-graph StatefulRule when IOSFocusEnabledFlag is set and preferences.requiresViewResponders is true.
  • Makes FocusEventProxyResponder private and adds an asFocusEventProxyResponder cast helper, which FocusableViewResponder.focusProxyResponder now uses to keep the lookup working across the visibility change.

The new logic wires directly into the attribute graph that routes focus events, so a defect here could affect focus event delivery and responder resolution. The PR description also states a full package build was not run, leaving compile/runtime integration unverified. These factors place the change beyond automatic low-risk approval and warrant human review.

Reviewed commit ce2b835

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep Code Review Agent🐛

Review completed with 1 suggestion.

Reviewed commit: ce2b835

Comment thread Sources/OpenSwiftUI/Event/Focus/FocusEventProxy.swift
@tuist

tuist Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Ran test modules Commit
OpenSwiftUI ✅ 7 3348e750d

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI ✅ 28.0s 3348e750d

@Kyle-Ye
Kyle-Ye merged commit cf77488 into main Oct 9, 2026
4 of 5 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/focus_event_proxy branch October 9, 2026 16:08
@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.54%. Comparing base (4fa6573) to head (ce2b835).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...rces/OpenSwiftUI/Event/Focus/FocusEventProxy.swift 0.00% 2 Missing ⚠️
Sources/OpenSwiftUI/Event/Focus/Focusable.swift 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1132      +/-   ##
==========================================
- Coverage   30.89%   26.54%   -4.36%     
==========================================
  Files         880      821      -59     
  Lines       71040    61716    -9324     
==========================================
- Hits        21945    16380    -5565     
+ Misses      49095    45336    -3759     

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

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. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant