Skip to content

Fix false positive activation points for SwiftUI elements#315

Merged
RoyalPineapple merged 2 commits intomainfrom
alex/activation-testing
Feb 11, 2026
Merged

Fix false positive activation points for SwiftUI elements#315
RoyalPineapple merged 2 commits intomainfrom
alex/activation-testing

Conversation

@RoyalPineapple
Copy link
Copy Markdown
Collaborator

SwiftUI AccessibilityNode elements report accessibilityFrame as .zero but provide valid accessibilityPath geometry. This caused the parser to incorrectly mark all such elements as having overridden activation points.

Adds effectiveAccessibilityFrame(for:) to fall back to accessibilityPath.bounds when accessibilityFrame is empty. Updates defaultActivationPoint(for:) to use the effective frame. Adds usesDefaultActivationPoint(element:activationPoint:screenScale:) which fast-paths when both activation point and frame are zero.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

soroush-demo
soroush-demo approved these changes Feb 11, 2026
Copy link
Copy Markdown
Collaborator

@soroushsq soroushsq left a comment

Choose a reason for hiding this comment

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

Code looks fine, do we need a test for this?

Test the four key scenarios:
- Zero frame + zero activation point → treated as default
- Zero frame + valid path + valid activation point → treated as default
- Normal frame + center activation point → treated as default
- Normal frame + custom activation point → not default

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@RoyalPineapple RoyalPineapple merged commit 465b976 into main Feb 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants