Skip to content

fix(desktop): macOS SnapShot skips the screen-sharing indicator window - #36320

Open
juliusmarminge wants to merge 2 commits into
mainfrom
factory/pr-34015-a1794597635
Open

juliusmarminge wants to merge 2 commits into
mainfrom
factory/pr-34015-a1794597635

Conversation

@juliusmarminge

Copy link
Copy Markdown
Member

Item 1 is right and is fixed. The previous head dropped every window under 100pt wide and under 28pt tall whenever a larger one existed, so a small titled palette (e.g. 'Mini timer' 80x24) in front of a document lost to the document, which main does not do. The filter in apps/desktop/src/snapShot/ActiveWindow.ts now drops a window only when it is under both size limits AND its title is exactly "Window", the title issue #33947 reports for the macOS 26 sharing indicator (66x20 or 31x20). It stays position-independent, so the earlier round's exact-top-edge objection does not return, and the fallback to the unfiltered list when nothing else is visible is kept. Tests in the existing foreground-palette table: replaced the 80x60 and 400x24 rows, which could not catch this, with an 80x24 'Mini timer' row (fails on the previous head: expected 1, got 2; passes now) and a 400x300 window titled 'Window' that must stay selected; the lone-window test now uses the title 'Window' so it exercises the fallback. The two indicator rows from the first round still pass. Limits: the title match rests on the single window list in the issue; I assumed, without confirming on a Mac, that 'Window' is AppKit's unlocalized default title. If macOS localizes it, the indicator would be captured again on non-English systems. Not verified on a real macOS 26 machine; none is available here. No open pull request exists for the branch, so nothing was watched.

Supersedes #34015. The change is @Mnigos's; their commits are kept.

Reproduction on main

On macOS 26, enable SnapShots in T3 Code Desktop and grant Screen Recording and Accessibility permissions. Have another app capture the T3 window through ScreenCaptureKit, such as a video-call window share or ChatGPT computer use. Bring T3 Code frontmost and press double-Shift: main captures the tiny indicator. This PR should capture the full window when the indicator is horizontally contained within it and shares its exact top coordinate; an indicator offset vertically still passes through the filter. Stop sharing and repeat to confirm a full-window capture without the indicator. These steps were read from the issue and code, not executed.

Evidence

Being captured: before and after in the real app. This section is filled in before the pull request can merge.

Tests

From apps/desktop: vp test run src/snapShot/ActiveWindow.test.ts with the new tests against the previous head's source: 1 failed (indicator-sized titled palette, expected 1 got 2), 20 passed. Same command with the change: 21 passed. vp run check:changed: format, lint, knip 1/2 and 2/2, typecheck (2 packages) and test (1 file) all pass.

Not in this change

  • A real window of the frontmost app that is under 100pt wide and under 28pt tall is now skipped whenever the app shows any larger window; accepted because nothing that short has a title bar.
  • The issue's other suggested signals (AXDialog role, the WindowSharingSessionButton child) were not used: the lookup reads CGWindowList only, and adding an Accessibility query is a larger change than this bug needs.
  • Windows active-window lookup is untouched; the indicator is a macOS 26 behaviour.
  • A real window of the frontmost app titled exactly 'Window' and under 100x28pt is still skipped when the app shows another window; accepted as the narrowest signal the CGWindowList data offers.
  • Identifying the indicator through Accessibility (AXDialog role, the WindowSharingSessionButton child) would be locale-proof but needs a second query path in the lookup script; not added.
  • Windows active-window lookup is untouched.

Who did the work

  • Written by Claude Fable 5.2, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
  • Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5

Run by the t3code factory in T3 Code.

juliusmarminge and others added 2 commits November 13, 2026 19:37
While another app captures a window, macOS 26 adds a titled 66x20 or
31x20 indicator window in front of it in the app's window list. SnapShot
took it as the active window and returned a capture of that size.

Windows under 100pt wide and under 28pt tall are now left out of the
selection wherever they sit, unless the app shows nothing else.

Fixes #33947

Co-authored-by: Igor Makowski <56691628+Mnigos@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… sharing indicator

Size alone dropped any window under 100x28pt, so a small titled palette
in front of a document lost to the document. The indicator is now
recognised by its size together with its "Window" title.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 13, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at d67d652

Macroscope's review found this PR approvable — The macOS SnapShot lookup now skips tiny sharing-indicator windows while retaining a fallback when no other window exists. The change is limited to foreground-app window selection and does not broaden capture permissions or scope.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

macOS window selection now filters invisible or dimensionless windows and conditionally excludes compact windows titled "Window". Tests cover title-bar and floating indicators, titled palettes, larger windows, and the fallback when a compact "Window" is the only candidate.

Changes: macOS Window Selection

Layer / File(s) Summary
Selection filtering and validation
apps/desktop/src/snapShot/ActiveWindow.ts, apps/desktop/src/snapShot/ActiveWindow.test.ts
Selection filters windows with nonpositive alpha or dimensions. It excludes windows titled "Window" when their width is under 100 or height is under 28, and uses the on-screen candidates if that exclusion removes all candidates. Tests cover indicators, content windows, and fallback selection.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: yorusamaog

Merge Risk: Minimal · up to d67d6

This change makes macOS window selection skip the screen-sharing indicator while still selecting small titled palettes. No merge-blocking issue was found. The remaining uncertainty is that it has not been verified on a real macOS 26 machine and may not work on localized systems.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the macOS SnapShot fix and the screen-sharing indicator window it targets. It matches the main change in ActiveWindow.ts, which filters the indicator window on macOS. It uses the conve…
Description check Passed The description follows the template's sections in substance. Problem is covered in the Reproduction and first paragraphs. Change explains the size-and-title filter and the fallback. Scope links issue…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the macOS SnapShot fix and the screen-sharing indicator window it targets. It matches the main change in ActiveWindow.ts, which filters the indicator window on macOS. It uses the conventional commit form and is specific enough for a reviewer scanning history.

Full details: Description check

Explanation

The description follows the template's sections in substance. Problem is covered in the Reproduction and first paragraphs. Change explains the size-and-title filter and the fallback. Scope links issue #33947 and notes that the work supersedes #34015. Verification lists focused test results and the check:changed run, and it states what was not verified. The Evidence section is a placeholder, and the template asks for before/after screenshots for UI changes. This change is a backend window-selection fix with no UI change, so the gap is minor. The description also repeats some items, including two Windows-untouched bullets and two Accessibility-signal bullets, and it has two 'Who did the work' attributions that add noise without affecting review.

Resolution

Optional cleanup: remove the duplicated bullets under 'Not in this change', and either drop the empty Evidence placeholder or replace it with the before/after capture before merge. The Evidence section states it must be filled before merge.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

Note

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c83e78f and d67d652.

Files selected for processing: 2

  • apps/desktop/src/snapShot/ActiveWindow.test.ts
  • apps/desktop/src/snapShot/ActiveWindow.ts

Limit details: You’ve used all 10 included reviews currently available.

@shivamhwp

Copy link
Copy Markdown
Collaborator

[GPT-6.1 Sol][Codex] on behalf of shivam.

Handoff from the issue-watch investigation. On shiv, macOS 27.0.1 / 26A434, arm64, a background native AppKit fixture captured by a separate ScreenCaptureKit process reproduced the OS indicator twice. The main window was (160,208,900×652); the layer-0, alpha-1 indicator titled Window appeared at (166,214,66×20) during capture and disappeared afterward. Its AXDialog had one AXButton with AXTitle WindowSharingSessionButton; the button's AXIdentifier returned no value. The diagnostic JXA probe read those attributes successfully. Its direct AX-to-CG ID mapping used a private API diagnostically, not a proposed production dependency.

An offline replay of the observed CG list selected the indicator on both baseline e9e934bb3db7b13c8d09f103a59f317935e0bd72 and the historical #34015 head 3cef659bc9dee56f164b72d46391f81187003b2c: the latter's exact-y condition misses this +6 offset. This is evidence about those snapshots, not a test of this PR.

Our separate experimental branch ends at e02a316f5fcdfe80adec065228a64e91a9c28d42. Its selector recognizes the AX button title or identifier and backs off on ambiguous AX/CG titles, with a budget for optional AX reads. vp test run apps/desktop/src/snapShot/ActiveWindow.test.ts and the final vp run check:changed origin/main passed, 22/22 tests, on matching file bytes. Fail-first comparisons produced 2 failures / 19 passes on baseline for the indicator rows, and 1 failure / 21 passes on the earlier experimental head for a CG-title collision missing from AX metadata.

Unproven: integrated T3 shortcut and attachment dimensions on Mac or Linux, reporter macOS 26, the final production JXA trust/timeout calls and T3 subprocess permission inheritance. No T3 before/after images were obtained, and no checks were run against #36320. The fixture stayed in the background, so it does not prove the foreground-app path. The experimental fix was not declared ready.

Evidence below renders the saved native output, historical replay, and final check transcript as images. These are diagnostic transcripts, not desktop screenshots. No further work or pushes from this thread.

Native AX and CG output

Historical selector replay

Final check transcript

@juliusmarminge

Copy link
Copy Markdown
Member Author

The automated pipeline stopped on this pull request and will not merge it:

the fix is written and reviewed, but proving it needs something no worker has:

  • Permanent blocker: A macOS 26 desktop host is required, with Screen Recording and Accessibility permissions and another app capturing the T3 Code window through ScreenCaptureKit. This worker is Linux; macOS desktop access outside the device pool is unavailable under the task constraints.
  • The tiny indicator capture on base, full-window capture on head, vertically offset indicator behavior, and capture after stopping sharing were not observed.

It stays open for a person to finish or close.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants