experiments in a post-browser web
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(window): prevent macOS Space switching when opening cmd palette

Add visibleOnAllWorkspaces to modal/palette windows (e.g. cmd palette)
so they appear on the user's current macOS Space instead of pulling
them back to the Space where the window was originally created.

Two-part fix:
1. After new modal window creation: setVisibleOnAllWorkspaces(true)
2. On keepLive window reuse: reinforce visibleOnAllWorkspaces before show()

+27 -6
+13 -6
app/page/page.js
··· 80 80 const MIN_HEIGHT = 150; 81 81 const MARGIN = 8; // Resize handle margin on each side 82 82 const TRIGGER_ZONE_HEIGHT = 8; // Transparent strip above webview for hover trigger 83 + const PANEL_WIDTH = 280; // Width of page info / entities panels 84 + const PANEL_OVERLAP = PANEL_WIDTH * 0.25; // 70px overlaps the page 85 + const PANEL_OVERHANG = PANEL_WIDTH - PANEL_OVERLAP; // 210px extends beyond page 83 86 84 87 // --- Parse URL parameters --- 85 88 // URL params represent the webview's position in screen coordinates ··· 274 277 widgetContainer.style.top = `${webviewTop}px`; 275 278 } 276 279 277 - // Page Info Panel — top-left, below navbar when visible 280 + // Page Info Panel — top-left, 75% off-page / 25% overlapping 278 281 if (pageInfoPanel) { 279 - pageInfoPanel.style.left = `${webviewLeft}px`; 282 + pageInfoPanel.style.left = `${webviewLeft - PANEL_WIDTH + PANEL_OVERLAP}px`; 280 283 pageInfoPanel.style.top = `${webviewTop + 8}px`; 284 + pageInfoPanel.style.width = `${PANEL_WIDTH}px`; 281 285 } 282 286 283 - // Entities Panel — right side, below navbar when visible 287 + // Entities Panel — right side, 75% off-page / 25% overlapping 284 288 if (entitiesPanel) { 285 - entitiesPanel.style.left = `${webviewLeft + webviewWidth - 280}px`; 289 + entitiesPanel.style.left = `${webviewLeft + webviewWidth - PANEL_OVERLAP}px`; 286 290 entitiesPanel.style.top = `${webviewTop + 8}px`; 291 + entitiesPanel.style.width = `${PANEL_WIDTH}px`; 287 292 } 288 293 } 289 294 ··· 925 930 } 926 931 927 932 // Show page info and entities panels alongside navbar 933 + // Expand window to fit panel overhang on each side 928 934 if (pageInfoPanel) pageInfoPanel.classList.add('visible'); 929 935 if (entitiesPanel) entitiesPanel.classList.add('visible'); 936 + setWindowPadding(PANEL_OVERHANG * 2); 930 937 } 931 938 932 939 function hide() { ··· 939 946 } 940 947 navbar.classList.remove('visible'); 941 948 // Hide page info and entities panels alongside navbar 949 + // Shrink window back to normal 942 950 if (pageInfoPanel) pageInfoPanel.classList.remove('visible'); 943 951 if (entitiesPanel) entitiesPanel.classList.remove('visible'); 944 - // Window stays the same size (always includes navbar space). 945 - // Just update trigger zone and resize handle visibility. 952 + setWindowPadding(0); 946 953 updatePositions(); 947 954 navbar.inputElement?.blur(); 948 955 showSource = null;
+14
backend/electron/ipc.ts
··· 2185 2185 DEBUG && console.log('Reused window transient from appFocused:', existingData.params.transient, 'appFocused:', coordinator.isAppFocused()); 2186 2186 2187 2187 if (!isHeadless()) { 2188 + // Reinforce visibleOnAllWorkspaces before showing — on macOS, this 2189 + // ensures the window appears on the user's current Space instead of 2190 + // pulling them back to the Space where the window was first created. 2191 + if (process.platform === 'darwin' && (options.modal === true || options.alwaysOnTop === true)) { 2192 + existingWindow.window.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true }); 2193 + } 2188 2194 existingWindow.window.show(); 2189 2195 existingWindow.window.focus(); 2190 2196 } ··· 2358 2364 // Create new window 2359 2365 const win = new BrowserWindow(winOptions); 2360 2366 { const actualBounds = win.getBounds(); console.log(`[window-open:actual] Window ${win.id} actual bounds after creation: (${actualBounds.x},${actualBounds.y}) ${actualBounds.width}x${actualBounds.height}`); } 2367 + 2368 + // Reinforce visibleOnAllWorkspaces after creation — on macOS the constructor 2369 + // flag can be unreliable. This ensures modal/palette windows (e.g. cmd palette) 2370 + // appear on the current Space rather than pulling the user to the creation Space. 2371 + if (options.modal === true && process.platform === 'darwin') { 2372 + win.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true }); 2373 + DEBUG && console.log('[window-open] Set visibleOnAllWorkspaces for modal window', win.id); 2374 + } 2361 2375 2362 2376 // Reinforce alwaysOnTop after creation — on macOS the constructor flag alone 2363 2377 // is unreliable; calling setAlwaysOnTop with 'floating' level ensures it stays