Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 15d4f0f. Configure here.
| if (environment.platform === "darwin" && !runSync(Ref.get(desktopState.quitting))) { | ||
| event.preventDefault(); | ||
| window.hide(); | ||
| } |
There was a problem hiding this comment.
Fullscreen close hides to black
Medium Severity
On macOS, ordinary main-window close now calls preventDefault and hide without leaving fullscreen first. Hiding a native fullscreen BrowserWindow is a known Electron/AppKit failure mode that leaves a black screen instead of a clean hide, so closing from fullscreen can break the intended dismiss-and-restore flow.
Reviewed by Cursor Bugbot for commit 15d4f0f. Configure here.
ApprovabilityVerdict: Needs human review This PR changes macOS window close behavior from actually closing to hiding the window, which is a significant runtime behavior change affecting user experience. The author is not a frequent contributor to this file, adding a small risk signal. You can customize Macroscope's approvability policy. Learn more. |


Problem
On macOS, closing T3 Code's last window destroys the renderer while the desktop server remains running. PreviewAutomationHosts lives in that renderer, so MCP preview requests then fail with no available preview automation host until the app is activated again.
Fix
Proof
Risk and visual changes
Low lifecycle risk, limited to macOS main-window close handling. The window still disappears immediately, so there is no visual change. A genuine application Quit still destroys the window and completes shutdown.
Known limitation: this is covered by focused desktop lifecycle tests; it does not add a packaged Electron integration test.
Implemented with GPT-5.6-sol through the Codex harness in T3 Code.
Note
Medium Risk
Touches macOS main-window close lifecycle and depends on the
quittingflag to still allow real shutdown. Incorrect gating could leave a hidden window or block Quit/updater paths.Overview
On macOS, closing the main window no longer destroys the renderer. The
closehandler now hides the window (viapreventDefault) unlessDesktopState.quittingis set, so preview automation hosts in the renderer keep working while the desktop server is still running.Genuine Quit / updater / relaunch shutdown still closes normally once
quittingis true. Non-macOS close behavior is unchanged.Adds regression tests for hide-on-close vs allow-close-during-quit, and wires
DesktopStateinto the window layer/tests.Reviewed by Cursor Bugbot for commit 15d4f0f. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Keep preview automation alive by hiding the main window on macOS close instead of quitting
closeevent handler inDesktopWindow.tsnow callsevent.preventDefault()andwindow.hide()instead of destroying the window, unless the app is in a quitting state.DesktopState.quittingvia a synchronousRefcheck to distinguish a user close from an actual quit.Macroscope summarized 15d4f0f.