fix(desktop): include Chrome app text in macOS SnapShots #11325
main fromrefs/pull/11325/head·merged by juliusmarminge View on GitHubChrome SnapShots on macOS can omit app text because accessibility appends the browser and profile to the captured page title. Permit that narrow suffix for Chrome and Chromium after exact-title matching, while retaining bounds and ambiguity checks.
The suffix fallback is authorized only for windows returned by the captured PID lookup. If that lookup is empty, the existing global application fallback cannot borrow another Chrome process’s suffixed window. Linux Flatpak lookup retains its existing behavior. Other applications and platforms keep strict title matching.
Verification on headless Linux:
Original PR: 18 added cases in 3 test files
Takeover: 6 added cases in 2 existing files; one-off reader test removed
Matcher disabled: 3 regression failures
Original reader with other-PID fixture: FAIL — captures other-process text
PID-scoped suffix fallback: PASS — rejects other-process context
Focused suites: 201 passed
Scoped lint and desktop typecheck: passed
The reader tests verify captured text and structured accessibility context for Chrome with a profile suffix and Chromium without one. Existing Linux Flatpak coverage passes. Headless tests bypass the absent Electron installation loader; they do not run Electron. Native macOS accessibility/Chrome capture and Electron desktop verification remain for a human. Windows, iOS and Android were not run. No UI layout changes are made; the regression evidence is at the capture service boundary rather than a native screenshot.
Original contribution by @shivamhwp in #11325. Fixes #10896.
Takeover: GPT-6-Astra tests, GPT-6.1-Sol implementation; Codex harness. Independent review: Claude Opus 5.5 (Claude harness) and GPT-6-Sol (Codex harness).
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅ Codex Live turn messages 2 2 0 (0.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB +24 B (+0.5%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB +24 B (+2.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB +41 B (+0.2%) 29.3 KiB ✅ Claude Live turn messages 1 2 +1 (+100.0%) 8 ✅ Baseline:
dff750b· PR result:2559bff· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
Bugbot is paused — on-demand spend limit reached
Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.
A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.
github-actions[bot](GitHub profile, opens in a new tab) added labels📱 Native Change
Warning
Review limit reached#
Only developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing.
Next included review available in 28 minutes.
View limit details
-
Limit details: You’ve used all 10 included reviews currently available.
Review configuration:
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
023d562b-99a8-485e-8e37-6cc76e36f4f7
📥 Commits
-
Reviewing files that changed from the base of the PR and between 769c889f71d0e43dd38dcfc5b007aea5d79c114c and 1a9e8c1ca2b464a35c6dfed7d4037e947fcab1ea.
📒 Files selected for processing: 4
-
apps/desktop/src/snapShot/DesktopSnapShot.test.tsapps/desktop/src/snapShot/SnapShotAccessibility.tsapps/desktop/src/snapShot/snapShot.test.tsapps/desktop/src/snapShot/snapShot.ts
-
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
a73778ac-9a37-4c16-923c-726617816b1f
📥 Commits
-
Reviewing files that changed from the base of the PR and between 20363c32c9bfdbf49c2716ef11d1f18483fcc01b and 74896dd2a01e0ab8ae414fc74b6182d32cbdfc84.
📒 Files selected for processing (4)
-
apps/desktop/src/snapShot/SnapShotAccessibility.test.tsapps/desktop/src/snapShot/SnapShotAccessibility.tsapps/desktop/src/snapShot/snapShot.test.tsapps/desktop/src/snapShot/snapShot.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.
-
📝 Walkthrough
-
The snapshot window matcher now supports macOS Chrome and Chromium browser-title suffixes. It preserves bounds, ownership, exact-title, active-window, and ambiguity checks. Accessibility lookup passes platform and bundle identity data.
Changes: Chrome accessibility matching
Layer / File(s) Summary Window matching behavior
apps/desktop/src/snapShot/snapShot.ts,apps/desktop/src/snapShot/snapShot.test.tsfindAccessibleWindownow filters by bounds before title matching and supports macOS Chrome and Chromium title suffixes. Tests cover platform restrictions, bounds, ambiguity, exact-title preference, and browser-suffixed titles.Accessibility identity wiring
apps/desktop/src/snapShot/SnapShotAccessibility.ts,apps/desktop/src/snapShot/SnapShotAccessibility.test.tsAccessibility window ownership now includes an optional bundle identifier. The reader passes platform and bundle information to findAccessibleWindow. Tests cover matching and rejection of unrelated process or application data.Priority: ➖ Normal
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
bil0000
Merge Risk: ⚪ Minimal · up to
16cc0-
The Chrome accessibility-title matching path preserves ownership, bounds, exact-match preference, and ambiguity rejection. No actionable merge-blocking risk remains.
Pre-merge checks:
4 · 1-
Failed checks: 1 warningCheck name Status Explanation Resolution Docstring Coverage Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold. Passed checks: 4 passed-
Check name Status Explanation Linked Issues check The changes satisfy the coding requirements in [ #10896]. macOS Chrome and Chromium bundle IDs accept the browser title suffix after bounds filtering. Exact title matches take priority. Non-macOS, non-…Out of Scope Changes check The changes stay within [ #10896]. They modify SnapShot window matching, accessibility identity propagation, and focused matcher and accessibility tests. No unrelated product behavior or unrelated file…Title check The title clearly summarizes the main change: adding Chrome application text handling to macOS SnapShots. Description check The description explains the problem, implementation, scope, linked issue, verification results, test limitations, and human follow-up requirements. It provides sufficient detail for review. Full details: Linked Issues check
-
Explanation
The changes satisfy the coding requirements in [
#10896]. macOS Chrome and Chromium bundle IDs accept the browser title suffix after bounds filtering. Exact title matches take priority. Non-macOS, non-browser, Wayland, unrelated-title, wrong-bounds, and ambiguous matches remain rejected. The accessibility reader passes platform and bundle ID data, and tests verify that the Chrome accessibility tree is restored without using another process or application.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within [
#10896]. They modify SnapShot window matching, accessibility identity propagation, and focused matcher and accessibility tests. No unrelated product behavior or unrelated files are changed.
-
-
Comment `@coderabbitai help` to get the list of available commands.✨ Finishing Touches 💡 1
-
📝 Generate docstrings 💡
-
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
-
- Create PR with unit tests
- Commit unit tests in branch `fix/desktop-chrome-snapshot-title`
-
-
Bugbot is paused — on-demand spend limit reached
Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.
A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.
github-actions[bot](GitHub profile, opens in a new tab) removed labels📱 Native Change
All clear
Posted via Macroscope — Effect Service Conventionsjuliusmarminge added labelsmacroscope-review
- apps/desktop/src/snapShot/SnapShotAccessibility.ts line 138OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -134,3 +134,5 @@134134 sourceTitle,135135 bounds: active.bounds,136136 clientBounds: active.clientBounds,137+ platform,138+ bundleId: active.owner.bundleId,
🟠 High
snapShot/SnapShotAccessibility.ts:138When
windowsForPidreturns no windows, the fallback searches every app, and the suppliedbundleIdletsfindAccessibleWindowsuffix-match a different Chrome process or profile with the same title and bounds. Its accessibility tree is then persisted as the captured window’s context. Restrict this fallback to candidates verified against the owner, or return no context when the PID-scoped lookup fails; the capturedbundleIdalone does not authenticate app-list candidates.🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/desktop/src/snapShot/SnapShotAccessibility.ts around line 138: When `windowsForPid` returns no windows, the fallback searches every app, and the supplied `bundleId` lets `findAccessibleWindow` suffix-match a different Chrome process or profile with the same title and bounds. Its accessibility tree is then persisted as the captured window’s context. Restrict this fallback to candidates verified against the owner, or return no context when the PID-scoped lookup fails; the captured `bundleId` alone does not authenticate app-list candidates.Confirmed and fixed in 1a9e8c1ca2. The browser bundle ID is now supplied only when the candidate windows came from the captured PID. The all-app fallback cannot use suffix matching. The reader regression populated App.list with another Chrome PID at the same title/bounds: it failed before the fix and passes now. All 201 focused tests, scoped lint, and desktop typecheck pass; native macOS capture remains unverified.
This removes the Chrome suffix-match path, but the all-app fallback can still exact-match an unrelated app’s title and bounds without verifying its PID/owner. The original cross-process context concern remains; please restrict fallback candidates to the captured owner or return no context when PID lookup fails.
The remaining exact-title fallback is already present on main in readCapturedWindowAccessibility and findAccessibleWindow; this PR does not introduce or broaden it. The new suffix capability is now limited to PID-scoped windows, so the regression introduced here is fixed. Both independent whole-diff reviewers traced this distinction and confirmed the Linux Flatpak AT-SPI fallback remains intact. Broadly removing the existing fallback would change unrelated Linux behavior and is outside this focused Chrome title fix. Current-head correctness and approvability checks pass; native macOS proof remains listed in the description.
juliusmarminge assignedjuliusmarminge
Taking over this one as maintainer for batch desktop-app-07. I will keep the focused macOS Chrome title fix, constrain accessibility matching to the captured process, and recheck implementation and tests against current main. Native macOS Chrome verification remains outstanding.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge merged this6b43524
juliusmarminge closed this
Sign in to join this conversation.
Approvability#
Verdict: Approved at
1a9e8c1Macroscope's review found this PR approvable — This is a narrowly scoped macOS accessibility bug fix that preserves exact-title matching and only permits a bounded Chrome/Chromium suffix fallback with strict process, bounds, and ambiguity safeguards. Targeted regression tests cover the new behavior and cross-process protection.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).