test(cua-driver): use canonical capture_mode "ax", drop deprecated "tree" alias - #2054
Conversation
…ree" alias
Seven `get_window_state` call sites across the harness/focus tests passed
`capture_mode: "tree"`, which is not in the documented enum (`som`/`vision`/`ax`).
Its behavior was inconsistent across platforms:
* macOS — explicitly aliased to "ax" (tree only).
* Windows/Linux — `do_tree = mode != "vision"`, `do_shot = mode != "ax"`, so
"tree" produced BOTH a tree AND a screenshot (i.e. `som`), wasting a capture
the tests never read.
The tests passed everywhere only because they assert on the tree. Switching the
call sites to the canonical `"ax"` makes intent explicit and behavior consistent
(tree-only, no wasted screenshot) on all three platforms. On macOS this is a
no-op (the alias already resolved to "ax").
Verified on macOS: harness_appkit (5) + harness_swiftui (2) green; the
get_window_state(ax) snapshot renders the full tree unchanged. (modality_focus's
focus-steal assertion flaked on an unrelated background app grabbing focus on
the dev host — not driver behavior, not this change.)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAll touched tests now request ChangesTest harness snapshot mode
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Linux visual regression artifactsMatrix jobs now run independently. Download visual artifacts from this workflow run.
|
What
Seven
get_window_statecall sites across the harness/focus tests passedcapture_mode: "tree", which is not in the documented enum (som/vision/ax). Its behavior was inconsistent across platforms:"tree"resolves to"ax"(tree only)do_tree = mode != "vision",do_shot = mode != "ax"→ both tree + screenshot (i.e.som), wasting a capture the tests never readThe tests passed everywhere only because they assert on the tree. Switching to the canonical
"ax"makes intent explicit and behavior consistent (tree-only, no wasted screenshot) on all three platforms. On macOS this is a no-op (the alias already resolved to"ax").Files (7 sites, 5 files)
modality_focus_test,harness_wpf_test(×3),harness_appkit_test,harness_winui3_test,harness_swiftui_test.Verification (macOS)
harness_appkit(5) +harness_swiftui(2) ✅ green; theget_window_state(ax)snapshot renders the full tree unchanged.modality_focus's focus-steal assertion flaked because an unrelated background app grabbed focus on the dev host (com.apple.Terminal→com.superhuman.electron) — not driver behavior, not this change. Theaxsnapshot itself returned the expected 267-element tree.Companion to #2053 (modality matrix docs + capture_mode coverage).
🤖 Generated with Claude Code
Summary by CodeRabbit