Repository navigation
fix(macos-helper): scroll SwiftUI forms whose rows are scroll-area children - #3888
Conversation
…ildren A SwiftUI Form exposes each row and heading as a direct child of its AXScrollArea, with no single document view as tall as the content. The scroll-bar path sized the overflow from the largest child, found none taller than the area, and refused with no-scroll-bar. Size the overflow from the span all content children cover.
…nt adds Trims the comments the change added to the comment rule.
There was a problem hiding this comment.
🔵 Needs a closer look
Smoke tests, coverage, and repository guards are still running, so validation remains incomplete.
No open issues 🎉
What changed in this PR
Fixes scrolling in SwiftUI forms under the opt-in native macOS backend by measuring content across all scroll-area children rather than selecting the largest child.
Changes:
- Calculate overflow from the combined span of non-scroll-bar children.
- Add regression tests for multiple rows, distant children, and empty frames.
| File | Description |
|---|---|
| apple/macos-helper/Tests/AgentDeviceMacOSHelperTests/BackgroundInteractionTests.swift | Tests content-span calculations and boundary cases. |
| apple/macos-helper/Sources/AgentDeviceMacOSHelper/BackgroundInteraction.swift | Uses combined child bounds to calculate scroll overflow. |
Review effort: Balanced
|
This PR is ready for review at 0878411. I found no problems in the code, and CI is green: 14 checks reported and none failed. The diff only touches the macOS helper scroll-bar route, which the Apple and Smoke Tests jobs exercise. There are no conflicts. Not blocking, and you can take or leave these: the test On evidence, the live Settings Form run was at 50acc2d, not at this commit. Since then the source only changed a doc comment, so that run still covers the scroll change. I did not run |
* origin/main: feat(test-app): add a Bluesky-depth heavy feed screen (#3884) fix(android): read a child that vanished mid-read as gone (#3901) feat(ios): route iPad Simulator snapshots through the host AX bridge (#3895) Prepare shared resource ownership and selection for #3325 (#3887) refactor(kernel): track held execution locks in keyed-lock (#3879) perf(ios): ask a ready runner about surface hosts before spawning probes (#3877) fix(ios): keep the bridge while a surface host only lingers (#3873) perf(ios): synthesize taps on resolved in-app back controls (#3880) fix(macos): open a running app by its own path instead of its bundle id (#3889) fix(macos): accept mixed-case bundle ids in open (#3867) fix(macos-helper): scroll SwiftUI forms whose rows are scroll-area children (#3888)
* origin/main: fix(android): read a child that vanished mid-read as gone (#3901) feat(ios): route iPad Simulator snapshots through the host AX bridge (#3895) Prepare shared resource ownership and selection for #3325 (#3887) refactor(kernel): track held execution locks in keyed-lock (#3879) perf(ios): ask a ready runner about surface hosts before spawning probes (#3877) fix(ios): keep the bridge while a surface host only lingers (#3873) perf(ios): synthesize taps on resolved in-app back controls (#3880) fix(macos): open a running app by its own path instead of its bundle id (#3889) fix(macos): accept mixed-case bundle ids in open (#3867) fix(macos-helper): scroll SwiftUI forms whose rows are scroll-area children (#3888)
Summary
With
AGENT_DEVICE_MACOS_APP_BACKEND=native, everyscrollin a SwiftUIForm(such as a Settings window) failed withno scroll area with a settable scroll bar under the window center.The helper sized the content from the largest child of the
AXScrollArea, but aFormlists each heading and row group as a direct child of the area. No child was taller than the area, so the overflow came out negative and the area was skipped. The overflow now comes from the span all non-scroll-bar children cover. One document view gives the same value as before.Known limits:
ListandLazyVStack) only expose on-screen rows, so overflow can be underestimated. That is pre-existing, and not made worse by this PR.2 files. Related: #3213.
Validation
Head
0878411bd, basec8b944ca0.pnpm check:affected --base upstream/main --head 0878411bd --run: passed,exactCommit: true; selected checks are GitHub-authoritative (Apple / Smoke Tests).swift testinapple/macos-helper: 20 passed.50acc2d96(head adds only a test and comment trims), macOS 27, Stim Desktop's Settings window, native backend: base refusesscroll down,bottom,--pixelsand--until; head passes all, and--untilreaches an off-screen switch that apressthen toggles.Top of the form, then after
scroll --untiland the press: