Priority: P2
User request
When the user closes BadCode after resizing the desktop app window, the next launch should reopen at the same size.
Current test result
A quick packaged-app test on May 26, 2026 showed the basic persist/restore path working: resizing the desktop window, closing BadCode, and reopening restored the window size.
However, there is still a maximized-window edge case:
- Maximize the desktop window.
- Close BadCode while maximized.
- Reopen BadCode. It reopens maximized as expected.
- Click the maximize/restore button again.
- Instead of returning to the previous smaller restored size, the window restores to a nearly full-screen normal window.
This suggests closing while maximized may be overwriting the last normal bounds with maximized/full-screen-sized bounds.
Current code starting points
There appears to already be an intended implementation in apps/desktop/src/window/DesktopWindow.ts:
MAIN_WINDOW_STATE_FILE_NAME = window-state.json
loadPersistedMainWindowState(...) reads persisted width/height/isMaximized.
createWindow(...) applies persisted width and height to the BrowserWindow options.
- The window
close handler calls window.getBounds() and writes width/height/isMaximized.
The likely gap is that window.getBounds() on close can capture maximized bounds. The implementation probably needs to preserve the last normal bounds separately, or avoid replacing normal bounds when window.isMaximized() is true.
Acceptance criteria
Priority: P2
User request
When the user closes BadCode after resizing the desktop app window, the next launch should reopen at the same size.
Current test result
A quick packaged-app test on May 26, 2026 showed the basic persist/restore path working: resizing the desktop window, closing BadCode, and reopening restored the window size.
However, there is still a maximized-window edge case:
This suggests closing while maximized may be overwriting the last normal bounds with maximized/full-screen-sized bounds.
Current code starting points
There appears to already be an intended implementation in
apps/desktop/src/window/DesktopWindow.ts:MAIN_WINDOW_STATE_FILE_NAME = window-state.jsonloadPersistedMainWindowState(...)reads persisted width/height/isMaximized.createWindow(...)applies persistedwidthandheightto theBrowserWindowoptions.closehandler callswindow.getBounds()and writes width/height/isMaximized.The likely gap is that
window.getBounds()on close can capture maximized bounds. The implementation probably needs to preserve the last normal bounds separately, or avoid replacing normal bounds whenwindow.isMaximized()is true.Acceptance criteria