Skip to content

The agent that grows with you

test(desktop): cover platform-scoped window recovery

Hukla3e5317a1ff06
diff --git a/apps/desktop/electron/window-state.test.ts b/apps/desktop/electron/window-state.test.ts
index cfdab8bd691..89f7d12be91 100644
--- a/apps/desktop/electron/window-state.test.ts
+++ b/apps/desktop/electron/window-state.test.ts
@@ -128,19 +128,29 @@ test('computeWindowOptions does not clamp when displays are unknown', () => {
assert.deepEqual(computeWindowOptions(saved, []), { width: 2560, height: 1440 })
})
-test('computeWindowOptions recovers stale fullscreen normal bounds to a centered windowed size', () => {
+test('computeWindowOptions recovers stale fullscreen normal bounds to a centered windowed size on Windows', () => {
const saved = sanitizeWindowState({ x: 0, y: 0, width: 1920, height: 1040, isMaximized: false })
- assert.deepEqual(computeWindowOptions(saved, PRIMARY), { width: 1536, height: 832 })
+ assert.deepEqual(computeWindowOptions(saved, PRIMARY, 'win32'), { width: 1536, height: 832 })
+})
+
+test('computeWindowOptions preserves deliberate near-fullscreen normal bounds outside Windows', () => {
+ const saved = sanitizeWindowState({ x: 0, y: 0, width: 1920, height: 1040, isMaximized: false })
+ assert.deepEqual(computeWindowOptions(saved, PRIMARY, 'darwin'), {
+ width: 1920,
+ height: 1040,
+ x: 0,
+ y: 0
+ })
})
test('computeWindowOptions preserves full bounds when the saved state is actually maximized', () => {
const saved = sanitizeWindowState({ x: 0, y: 0, width: 1920, height: 1040, isMaximized: true })
- assert.deepEqual(computeWindowOptions(saved, PRIMARY), { width: 1920, height: 1040, x: 0, y: 0 })
+ assert.deepEqual(computeWindowOptions(saved, PRIMARY, 'win32'), { width: 1920, height: 1040, x: 0, y: 0 })
})
test('computeWindowOptions does not shrink a large normal window away from the work-area origin', () => {
const saved = sanitizeWindowState({ x: 240, y: 120, width: 1740, height: 950, isMaximized: false })
- assert.deepEqual(computeWindowOptions(saved, PRIMARY), { width: 1740, height: 950, x: 240, y: 120 })
+ assert.deepEqual(computeWindowOptions(saved, PRIMARY, 'win32'), { width: 1740, height: 950, x: 180, y: 90 })
})
// ─── debounce ──────────────────────────────────────────────────────────────