Repository navigation
fix(snapshot): name every iOS element type in the XCTest runner - #4897
Conversation
The runner's element-type table covered 32 raw values and published every other one as Element(<rawValue>), while the Simulator AX bridge names all 83, so one node carried two types depending on which producer served the capture (#4657). The table now covers every raw value the SDK numbers, and contracts/fixtures/ios-element-type-names.json is the one table both producers mirror, each side pinned by its own parity test.
The fixture host gains a UIPickerView screen behind --agent-device-picker-wheel, and a simulator-lane test asserts the walk publishes its wheel as PickerWheel. The alert-surface read now takes the shared table's names directly: its Alert/Sheet override duplicated two rows the table covers.
Size Report
Startup median (7 runs, lower is better):
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 804cb85. The verdict and the full list are in the summary comment.
|
The runner-side change at 804cb85 has no remotely checkable proof yet, so it needs one more piece of evidence before merge. The changed producer is the XCTest runner's elementTypeName. The only CLI device check in the PR body was served by the bridge, and the bridge table is unchanged, so that check would also show PickerWheel at base. The runner-side unit test is gated on os(iOS), PR CI does not run it, and the local receipt cannot be opened remotely. This leaves the issue's completion condition, a UIPickerView captured through XCTest reporting type PickerWheel, without checkable evidence. Please attach one of two things: a CLI Not blocking, and these can be taken or left: the fixture description in contracts/fixtures/ios-element-type-names.json says both producers spell an unnamed raw value Element(), but the bridge reads unknown numbers as Other, and it also names a vitest/Swift-compile check that no code performs; the runner target also builds for macOS and tvOS, so those captures rename Element(N) to names too, which the Summary could state as a maintainer decision or follow-up issue; and the ScrollBar scroll-container behavior in isScrollableType already exists for bridge and Linux captures, so a follow-up issue to exclude 'scrollbar' there is enough. The inline thread on ScrollBar being treated as a scrollable type still applies as a non-blocking follow-up: #4897 (comment) The failing Body rules check looks unrelated to the diff, which does not touch the gate or workflow, and the body is about 234 words against the 250 limit, so a rerun should pass. No conflicts. Not verified here: the Swift and vitest suites, the '55 mismatches' count, whether the 81 SDK cases compile on tvOS/visionOS/watch SDKs, and the Body rules job logs. Before merge, the runner-served PickerWheel capture must be attached and Body rules rerun. |
The scrollable-type rule matches fragments, so a producer's subclass answers for it — which is also why the runner publishing ScrollBar made a 3pt scroll bar read as its own scroll container (#4657 review). isScrollableNodeLike already excluded the indicator locally at two call sites and not at the owner, so the exclusion moves there and both copies go away. The golden table's description also overstated two things the code does not do: the bridge reports Other for a raw value no row names, and nothing runs the vitest/Swift-compile check it named. The runner's table serves every runner platform, so the Swift comment says which captures the rename reaches.
This comment has been minimized.
This comment has been minimized.
isScrollIndicatorNode reached snapshotNodeKindIncludesAny with nullable fields the shared helper does not accept, so CI's tsc rejected the new guard and the checks that compile against the package failed with it. Both scroll predicates now take the kernel's own node shape, the shape every caller already passes.
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
Runner-side proof at 7f7959e
{
"snapshotDiagnostics": { "stats": { "backends": { "apple-runner": 2 } } },
"wheelNode": {
"index": 2,
"type": "PickerWheel",
"value": "First",
"rect": { "x": 9, "y": 262.5, "width": 372, "height": 291 },
"depth": 2,
"ref": "e3",
"kind": "pickerwheel"
}
}The same CLI path with origin/main's The |
|
This PR is ready at 7f7959e. The earlier ScrollBar and indicator finding from 804cb85 is fixed: CI shows 20 checks with 0 failing at this commit, and the earlier Not blocking, and fine to take or leave: The earlier inline thread on ScrollBar and indicator spellings (#4897 (comment)) no longer applies, because the code now rules those out before the fragment match. It can be resolved. |
Summary
The iOS XCTest runner named 32 of the 83 element types the SDK numbers and published every other one as
Element(<rawValue>), while the Simulator AX bridge names all 83 — so one node carried twotypevalues depending on which producer served the capture (#4657). The runner's table now covers every raw value, andcontracts/fixtures/ios-element-type-names.jsonis the one table both producers mirror, each side pinned to it by its own parity test. The review's scroll-container finding is fixed here too: an indicator's own names are ruled out before the fragment match, so a runner-servedScrollBaris no longer read as a scroll container.Before / after
A real
UIPickerViewwheel (raw value 39), one node captured twice:PickerWheel, runnerElement(39)PickerWheelValidation
Element(39)vsPickerWheel) and pass at head.snapshot --actions --jsonof the new--agent-device-picker-wheelfixture reports backends{"apple-runner":2}and"type": "PickerWheel"for the wheel node. A dispatched XCTest Nightly run on this branch runs the#if os(iOS)wheel test remotely.swift test --package-path apple/snapshot-presentation: 51 pass.pnpm check:xctest-selectionandpnpm formatpass.Fixes #4657
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.