You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(desktop): clicking a preview field in an inactive macOS window now types into it - #31777
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.
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.
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 option acceptFirstMouse: true implements 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 #22095 and 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 sets acceptFirstMouse: true next to the existing disableAutoHideCursor: 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 option acceptFirstMouse: true implements 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
The reason will be displayed to describe this comment to others. Learn more.
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 pointerdown per click. 17 real OS clicks (3 into an already focused window, 14 that activated it) produced exactly 17 pointerdown events across the top frame and the cross-site iframe. The closest two were 6 s apart, and every run's keys arrived once as test. 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. acceptFirstMouse lets the window's view accept the original mouse-down instead of swallowing it. It does not synthesize a second event.
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.”
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.
🤖 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 main needs 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
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
acceptFirstMousedefaults 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: trueon 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.
testtestapp got key t focus:DIVactiveElementisWEBVIEW, no app keydownsOn
main, the page logged nopointerdownin any frame for the six activating clicks. Each focused click logged one.vp run check:changedpasses. I added no test because the change is aBrowserWindowconstructor 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 throughpreview_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.