fix(desktop): clicking a preview field in an inactive macOS window now types into it #31777
main fromrefs/pull/31777/head·opened View on GitHubProblem#
On macOS, clicking a field in the embedded Browser preview and typing should put the text in that field. When the click is the one that brings the T3 window to the front, the text lands in the chat composer and the field stays empty (#22095). This hits sign-in pages hardest, since the workaround of having the agent type for you does not suit passwords.
Electron's acceptFirstMouse defaults to false on macOS, so the click that activates the window never reaches the page. Focus stays in the composer, and the keys follow it. Windows and Linux deliver that click, which is why it did not reproduce there.
Change#
Set acceptFirstMouse: true on the macOS main window, so the activating click reaches the web contents like any other click. As a side effect, a click on an inactive window now also acts on whatever it lands on, buttons included.
Scope and approval#
Fixes #22095, which is triaged as accepted. A comment from whoisaldo on the issue proposed this same one-line change and left the click-through decision to maintainers. Preview popups, the splash, and the recovery window have no composer, so they are unchanged.
Verification#
Proved on a dev desktop build (macOS 27, Electron 44.10.1) with real OS mouse and keyboard events (CGEvent), against a page with a top-frame input and a cross-site out-of-process iframe input.
| Scenario | Before | After |
|---|---|---|
T3 focused, composer focused, click iframe field, type test | field 3/3 | field 3/3 |
Finder in front, one click on the cross-site iframe field activates T3, type test | composer 4/4, app logs app got key t focus:DIV | field 10/10, host activeElement is WEBVIEW, no app keydowns |
| Same, clicking the top-frame field | composer 3/3 | field 4/4 |
On main, the page logged no pointerdown in any frame for the six activating clicks. Each focused click logged one.
| Before | After |
|---|---|
![]() | ![]() |
vp run check:changed passes. I added no test because the change is a BrowserWindow constructor option, and a test would only mirror it. Not checked: the packaged Nightly, the App Store Connect page itself, and a preview opened by an agent through preview_open.
Reviewed with sol-loop: 1 round with gpt-6.1-sol on high. Sol verdict: approved
Created with Claude Opus 5.5 in Claude Code, running in T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — This fixes preview-field focus by allowing the first click into inactive macOS main windows. It also changes the default interaction for buttons throughout those windows, requiring a human decision on that broader click-through behavior.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Important
Review skipped#
Review was skipped as selected files did not have any reviewable changes.
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 70b0529
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
7c42d0f9-92e4-4781-9c4f-737e87772b71
Commits-
Reviewing files that changed from the base of the PR and between 33d2adf08664ae4da0b9211128acd59ebef823c0 and 452251322e68d5d849ef1e661138f89d6c4bec97.
You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
- Trigger review
Walkthrough
-
On macOS,
DesktopWindow.createWindownow setsacceptFirstMouse: truealongsidedisableAutoHideCursor. Other platforms receive neither option.Changes: macOS Window Input
Layer / File(s) Summary macOS window options
apps/desktop/src/window/DesktopWindow.tsThe macOS window options add acceptFirstMouse: trueand retaindisableAutoHideCursor. Other platforms receive no additional options.Estimated code review effort: 1 (Trivial) | ~4 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
juliusmarminge
Merge Risk:
Minimal · previous review33d2a-
On macOS, clicking an inactive window now also activates the control under the click, which lets keyboard input reach preview fields. No concrete regression risk was found. The author reports manual verification on macOS. A native-input automated test is not practical in the current infrastructure.
Pre-merge checks:
4-
Check name Status Explanation Title check The title names the change: clicking a preview field in an inactive macOS window now types into it. The raw summary shows DesktopWindow.createWindow enabling acceptFirstMouse on macOS, which addresses… Description check The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the bug, expected behavior, and environment. The Change section explains the o… Linked Issues check [ #22095] The objective is that physical keyboard input after a physical click in a cross-origin iframe field in the macOS embedded preview enters that field. The whole-PR diff against the merge base c…Out of Scope Changes check [ #22095] The whole-PR diff changes only the macOS main window options in DesktopWindow.ts. The new optionacceptFirstMouse: trueimplements the fix for#22095. The PR description names the side effe…Full details: Title check
-
Explanation
The title names the change: clicking a preview field in an inactive macOS window now types into it. The raw summary shows DesktopWindow.createWindow enabling acceptFirstMouse on macOS, which addresses this behavior. The title follows conventional commit form and is specific, so it describes the main change.
Full details: Description check
-
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the bug, expected behavior, and environment. The Change section explains the one-line fix and its side effect. The Scope section links issue
#22095and states why the change is limited to the main window. The Verification section gives a results table, before and after screenshots, what was not checked, and the agent model used. The template asks for a conventional commit title, and the title meets that requirement.
Full details: Linked Issues check
-
Explanation
[
#22095] The objective is that physical keyboard input after a physical click in a cross-origin iframe field in the macOS embedded preview enters that field. The whole-PR diff against the merge base changes one option in apps/desktop/src/window/DesktopWindow.ts. On darwin, the main window now setsacceptFirstMouse: truenext to the existingdisableAutoHideCursor: true. This lets the click that activates an inactive window reach the web contents, so focus moves to the clicked field. The PR description reports before and after CGEvent results on macOS 27 with Electron 44.10.1, including a cross-site iframe field. I did not re-run that verification. The change since the previous review is a comment addition and reformatting of the same option, with no behavioral change. No automated test was added. The issue does not require one, and the change is a constructor option. Non-coding checks (packaged Nightly, App Store Connect page, preview_open) are not coding requirements.
Full details: Out of Scope Changes check
-
Explanation
[
#22095] The whole-PR diff changes only the macOS main window options in DesktopWindow.ts. The new optionacceptFirstMouse: trueimplements the fix for#22095. The PR description names the side effect: a click on an inactive main window also activates controls under the click, including buttons. This is a direct consequence of the chosen fix and is disclosed. Preview popups, splash, and recovery windows use other constructors and are not changed by the diff. No unrelated file changes appear in the reviewed diff.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Independent Worker16 review — GPT-6 (OpenAI), nonauthor and separate from dpearson2699. Exact reviewed HEAD:
9f3a5b34bb995000df067b7e6fd0bafc0b78c2e6; recorded PR basec52df24d285a072ad9c3f7ab5b3656c0be1cb0f5; current main re-read atbfb388415e8d3d39e5a7b3844fa7bc299c64f725(one commit ahead, changing only web menu files; no overlap with this one-file candidate).I read the complete
apps/desktop/src/window/DesktopWindow.tschange and its main-window construction context. The option is applied only to the macOS main BrowserWindow; Windows/Linux options remain unchanged, and this diff does not change preview routing, window/session identity, permission scopes or native-consent handling. The reported activation-click loss is consistent with Electron's inactive-window behavior. The PR's author-reported real HID/keyboard before/after evidence is relevant, but is not independently observed by this review.Product decision remains open.
acceptFirstMouseapplies to the whole main BrowserWindow, not just the embedded preview. The first click that activates an inactive window will therefore also reach buttons and other controls. The issue's maintainer comment explicitly leaves that broader click-through behavior to maintainers, and Macroscope's current verdict is NEEDS HUMAN APPROVAL. I found no explicit maintainer acceptance of that interaction change in the current issue/PR readback. I am therefore leaving a COMMENT rather than an APPROVE; this is not a claim of a source-code P1/P2.Before landing, please obtain an explicit maintainer decision that this whole-window first-click behavior is intended. A safe acceptance case should cover one activation click on a non-destructive control (exactly one action, no replay/double activation), alongside the preview-field case; retain the negative that other platforms and unrelated windows are unchanged. The author already documents that preview popups/splash/recovery windows are not changed.
Exact-head checks read: normal PR CI #42150926026 SUCCESS; Test job #127674011312 reports 35 files / 246 tests and 110 files / 1,025 tests, with existing
DesktopWindow.test.ts26/26. Build and Typecheck, Lint, Check, Agent Context Budget #42150926034 and Mobile Fingerprint Check #42150926018 succeeded. Mobile EAS Preview, Release Smoke, Test Web, Rust and Mobile Native Static Analysis were SKIPPED, not passed. Current-main-composed CI is not evidenced after the unrelatedbfb3884main commit.Acceptance boundary: packaged Nightly, the App Store Connect page, and agent-opened
preview_openacceptance remain NOT RUN. The PR's macOS HID test is author-reported. Those unperformed checks are not treated as a blanket source-merge veto; the explicit human decision about global click-through is the outstanding gate.Disposition: COMMENTED — source review complete, no P1/P2 code defect found, no approval or landing custody granted.
- @@ -403,4 +403,4 @@403403 minHeight: 620,404404 show: false,405405 autoHideMenuBar: true,406- ...(environment.platform === "darwin" ? { disableAutoHideCursor: true } : {}),406+ // Without it, macOS drops the activating click and keys stay in the composer, not the preview.
Note
🤖 Claude Opus 5.5 responding on behalf of dpearson2699
Agreed. Whole-window click-through is a product call for maintainers, and this PR does not try to make it.
On replay, here is what I observed. In the post-fix runs, the test page logged a trusted
pointerdownper click. 17 real OS clicks (3 into an already focused window, 14 that activated it) produced exactly 17pointerdownevents across the top frame and the cross-site iframe. The closest two were 6 s apart, and every run's keys arrived once astest. So each activating click reached the page once, with no second delivery.The check on a T3 control, such as one activating click on "Toggle right panel", was not run. My only basis for expecting the same there is an inference.
acceptFirstMouselets the window's view accept the original mouse-down instead of swallowing it. It does not synthesize a second event. dpearson2699(GitHub profile, opens in a new tab) linked this to fix #22095
tanstack-source added labelsbug
Additional comments: 1-
apps/desktop/src/window/DesktopWindow.ts-484-484: 1
-
484-484: Major · Maintainability & Code Quality · Heavy lift **Unverified finding** Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Add a regression test for inactive-window focus.
No test covers the reported failure. Add a macOS test that activates the window by clicking a cross-site iframe input, then verifies that keyboard input reaches that field rather than the composer. The test must exercise native focus behavior; checking the constructor option alone would not catch the regression.
As per coding guidelines, “Logic, data, state, and protocol bugs get a failing test first.”
Source: Coding guidelines
-
Review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 95cb068
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
76f72310-e89e-42a3-94ad-1b5d61bcfac5
Commits-
Reviewing files that changed from the base of the PR and between 9f3a5b34bb995000df067b7e6fd0bafc0b78c2e6 and 33d2adf08664ae4da0b9211128acd59ebef823c0.
Files selected for processing: 1-
apps/desktop/src/window/DesktopWindow.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
-
Note
🤖 Claude Opus 5.5 responding on behalf of dpearson2699
Not adding this test. The repo has no harness that can run it.
The bug only appears when a real OS click activates an inactive window. Electron delivers clicks it synthesizes, and clicks sent to an already focused window, either way. So a test that would fail on
mainneeds a macOS runner with Accessibility trust to post CGEvents, a second app to take focus, and a launched desktop build. CI has no Electron end-to-end setup, and its one macOS job only runs mobile static analysis. Building that harness is a separate project. A test that only checks the constructor option would just repeat the line, as CodeRabbit's walkthrough also notes.The proof for this change is the before and after runs in the PR description: real CGEvent clicks against a cross-site iframe field. The composer got the text 4/4 times before the fix. The field got it 10/10 times after.
Sign in to join this conversation.


Codex Review Summary#
This comment shows the latest Codex review activity on this pull request.
9f3a5b3ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.