experiments in a post-browser web
10
fork

Configure Feed

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

fix(nav): ensure floating navbar works, permanently remove inline navbar

+39 -7
+10 -1
app/page/index.html
··· 29 29 -webkit-mask-image: -webkit-radial-gradient(white, white); 30 30 } 31 31 32 - /* Floating navbar - command-palette style overlay, NOT embedded */ 32 + /* 33 + * FLOATING NAVBAR — DO NOT ADD AN INLINE/EMBEDDED NAVBAR 34 + * 35 + * The navbar is a FLOATING overlay shown via Cmd+L or hover trigger. 36 + * It is NOT an embedded bar at the top of the page. 37 + * It does NOT use -webkit-app-region: drag. 38 + * 39 + * Any inline/embedded navbar was deliberately removed. 40 + * Do not re-add it under any circumstances without explicit user approval. 41 + */ 33 42 .navbar { 34 43 position: fixed; 35 44 top: 40px;
+12 -2
app/page/page.js
··· 6 6 * - Floating navbar overlay (Cmd+L to show, Escape/click-outside to dismiss) 7 7 * NOT embedded in window chrome — floats over content like a command palette 8 8 * - Resize via IPC to resize the BrowserWindow 9 + * 10 + * FLOATING NAVBAR — DO NOT ADD AN INLINE/EMBEDDED NAVBAR 11 + * 12 + * The navbar is a FLOATING overlay shown via Cmd+L or hover trigger. 13 + * It is NOT an embedded bar at the top of the page. 14 + * It does NOT use -webkit-app-region: drag. 15 + * 16 + * Any inline/embedded navbar was deliberately removed. 17 + * Do not re-add it under any circumstances without explicit user approval. 9 18 */ 10 19 11 20 import api from '../api.js'; ··· 58 67 // Start initialization 59 68 initWebview(); 60 69 61 - // --- Resize via IPC (drag on navbar handled natively by -webkit-app-region: drag) --- 70 + // --- Resize via IPC --- 62 71 63 72 let isResizing = false; 64 73 ··· 125 134 }); 126 135 127 136 // Cmd+L: show floating navbar with URL focus 128 - api.subscribe('page:show-navbar', () => show({ focusUrl: true }), api.scopes.WINDOW); 137 + // Published from main process with GLOBAL scope (both host and webview guest fire this) 138 + api.subscribe('page:show-navbar', () => show({ focusUrl: true }), api.scopes.GLOBAL); 129 139 130 140 // --- Nav button actions --- 131 141
+17 -4
backend/electron/ipc.ts
··· 2142 2142 // NOT the host's. We use did-attach-webview to intercept when the guest attaches 2143 2143 // and set up a setWindowOpenHandler that routes popups through Peek's window system 2144 2144 // instead of letting Electron create raw default BrowserWindows. 2145 + // 2146 + // Also adds Cmd+L interception on guest webContents for the floating navbar. 2147 + // (Keystrokes inside the webview never reach the host's before-input-event.) 2145 2148 if (url.startsWith('http://') || url.startsWith('https://')) { 2146 2149 win.webContents.on('did-attach-webview', (_event, guestWebContents) => { 2147 - console.log(`[webview-popup] Guest webContents attached to window ${win.id}, adding setWindowOpenHandler`); 2150 + console.log(`[webview-popup] Guest webContents attached to window ${win.id}, adding setWindowOpenHandler + Cmd+L`); 2151 + 2152 + // Cmd+L inside the webview guest: show the floating navbar 2153 + guestWebContents.on('before-input-event', (event, input) => { 2154 + if (input.type !== 'keyDown' || !input.meta) return; 2155 + if (input.key === 'l') { 2156 + publish('peek://system/', PubSubScopes.GLOBAL, 'page:show-navbar', { windowId: win.id }); 2157 + event.preventDefault(); 2158 + } 2159 + }); 2148 2160 2149 2161 guestWebContents.setWindowOpenHandler(({ url: popupUrl }) => { 2150 2162 if (popupUrl.startsWith('http://') || popupUrl.startsWith('https://')) { ··· 2279 2291 // Add escape key handler to all windows 2280 2292 addEscHandler(win); 2281 2293 2282 - // Add Cmd+L shortcut for web pages to show nav bar 2283 - // Web pages are now loaded inside peek://page container which handles nav 2294 + // Add Cmd+L shortcut on the HOST webContents as a fallback. 2295 + // The primary Cmd+L handler is on the webview guest (added via did-attach-webview above). 2296 + // This host-level handler fires when the page container's own DOM has focus (rare, 2297 + // but possible before the webview loads or if the user clicks outside the webview). 2284 2298 if (url.startsWith('http://') || url.startsWith('https://')) { 2285 2299 win.webContents.on('before-input-event', (event, input) => { 2286 2300 if (input.type !== 'keyDown' || !input.meta) return; 2287 2301 if (input.key === 'l') { 2288 - // Show the page container's nav bar 2289 2302 publish('peek://system/', PubSubScopes.GLOBAL, 'page:show-navbar', { windowId: win.id }); 2290 2303 event.preventDefault(); 2291 2304 }