Repository navigation
fix(desktop): reveal hidden windows on a bounded fallback and before recovery dialogs - #61743
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
There was a problem hiding this comment.
Looks sound. I read the diff against the base and ran the window tests and tsc -b in packages/desktop; both pass. I couldn't run the desktop app here, so the reveal fallback and the recovery-dialog path aren't verified end to end.
Public API: unchanged. Only internal desktop main-process code changes: wireWindowRecovery now takes { relaunch, reveal }, and there's a new internal reveal-machine module.
The machine follows the desktop State Machines rule (one union, a pure transition, a driver at the edge). Every way out of a hidden state cancels the fallback timer, and the early window and the closed state behave as before. No blocking concerns.
A new desktop window could stay hidden forever, and a recovery dialog could open modal to that hidden window. The reveal gate is now one explicit state machine with a bounded fallback.
Bugs
Cmd+N, or the 2nd+ restored window) starts withshow: falseand shows only after bothready-to-showandWindowThemeReady. If the renderer throws before it applies the theme, or its IPC port never binds,WindowThemeReadynever arrives. Nothing timed out, so the window stayed registered, persisted and invisible.did-fail-load,did-fail-provisional-load,render-process-goneorunresponsivebefore the reveal openeddialog.showMessageBox(win, …)parented to an unmapped window. The user could not relaunch, export logs or quit.Machine
packages/desktop/src/main/windows/reveal-machine.tscancel-timeout; a second Linuxcontent.ready(ready-to-show+did-finish-load), a latetheme.readyand any event afterclosedreturn the same frozen state.createRevealDriverowns the fallbacksetTimeoutand callsshow(reason).windows/index.tskeeps one driver per window in aWeakMap;setWindowThemeReadydispatchestheme.readyinto it.wireWindowRecovery(win, id, { relaunch, reveal })callsreveal()before the firstdialog.showMessageBox."main window visible"log line stays (startup bench milestone); a non-readyreveal addsreason: "timeout" | "recovery".Deleted
contentReady,appliedThemeandrevealedclosure booleans and thethemeReadycallbackWeakMapinwindows/index.ts.Product calls
Deviations from the design
isWindowRevealed/isWindowHiddenselectors: nothing outside the driver reads the reveal state, so they would be dead code.sidecar-service-machine) to keep this PR reviewable.Visual