fix(cua-driver): Linux list_windows emits bounds for cross-platform parity (#2017)#2018
Conversation
… parity (#2017) Linux list_windows returned flat x/y/width/height while macOS and Windows nest geometry under `bounds: {x,y,width,height}`. Emit `bounds` (plus app_name / is_on_screen) to match, keeping the flat fields as a legacy alias so existing Linux callers keep working. Additive — no schema_version bump. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KMXCW4M5uK1HRGjjH4wueZ
|
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 (1)
📝 WalkthroughWalkthroughLinux ChangesLinux window record shape
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
|
… on all platforms trycua/cua#2018 normalized Linux list_windows to nest geometry under `bounds: {x,y,width,height}`, matching macOS/Windows. The tolerate-both-shapes helper is no longer needed; read window dims directly from `bounds`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KMXCW4M5uK1HRGjjH4wueZ
cat <<'EOF'
Fixes #2017.
What
list_windowsreturned window geometry under a nestedbounds: {x,y,width,height}object on macOS and Windows, but as flat top-levelx/y/width/heighton Linux (and omittedapp_name/is_on_screen). Any cross-platform consumer readingwindow.bounds.widthworked on macOS/Windows and silently broke on Linux. This surfaced while wiring a Geminicomputers/desktopbackend, which had to add a_window_dims()shim purely to tolerate the two shapes.How
In
crates/platform-linux/src/tools/impl_.rs, eachlist_windowsrecord now emits:bounds: { x, y, width, height }— the canonical cross-platform field, matching macOS/Windowsapp_nameandis_on_screen— companion fields the other backends already emitx/y/width/heightfields, kept inline as a legacy alias so existing Linux callers don't break (mirrors the additive pattern Windows uses)The per-record JSON is extracted into a
window_record_jsonhelper, with a no-display unit test asserting both the nestedboundsand the flat legacy fields are present.Defaults
app_nameis""andis_on_screenistrue. The LinuxWindowInfostruct (crate::x11::WindowInfo) exposes onlyxid, pid, title, x, y, width, height— no app-name or visibility field — so these are best-effort defaults matching the Windows backend. No new lookup was invented.Schema
Purely additive — no field removed — so
schema_versionis not bumped.Testing
list_windows_tests::record_has_bounds_and_flat_legacy_fields(syntheticWindowInfo, no display required).cargo check -p platform-linuxon the macOS dev host: thex11crate's build script fails cross-compiling tox86_64-unknown-linux-gnu("pkg-config has not been configured to support cross-compilation"). Manual review confirms the Rust is sound (imports, field accesses,json!macro, balanced braces). Needs CI / a Linux box to confirm the build + run the test.🤖 Generated with Claude Code
https://claude.ai/code/session_01KMXCW4M5uK1HRGjjH4wueZ
EOF
Summary by CodeRabbit
New Features
boundsobject for each window, making window geometry consistent across platforms.app_nameandis_on_screenfields.Bug Fixes
x,y,width, andheightfields in place for compatibility with existing Linux integrations.