experiments in a post-browser web
10
fork

Configure Feed

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

fix modal windows so that focus is returned to previous app, and update callers all to use same api

+12 -24
+1 -4
app/cmd/index.js
··· 21 21 key: address, 22 22 height, 23 23 width, 24 - // Using modal parameter so it hides on escape/blur 25 - //modal: true, 26 24 27 25 // Keep resident in the background 28 26 keepLive: true, ··· 53 51 detachedDevTools: true, 54 52 }; 55 53 56 - // Use the modal window API to open the window 57 - windows.createWindow(address, params) 54 + windows.openModalWindow(address, params) 58 55 .then(result => { 59 56 console.log('Command window opened:', result); 60 57 })
+1 -3
app/groups/index.js
··· 19 19 const params = { 20 20 key: address, 21 21 height, 22 - width, 23 - // Not using modal so window stays open when clicking elsewhere 24 - modal: false 22 + width 25 23 }; 26 24 27 25 // Use the window creation API
+1 -3
app/index.js
··· 40 40 key: settingsAddress, 41 41 transparent: true, 42 42 height, 43 - width, 44 - // Settings window should stay open when clicking elsewhere, so not modal 45 - modal: false 43 + width 46 44 }; 47 45 48 46 console.log('Opening settings window with params:', params);
+1 -5
app/peeks/index.js
··· 26 26 persistState: item.persistState || false, 27 27 28 28 // Create a unique key for this peek using its address 29 - key: `peek:${item.address}`, 30 - 31 - // Use modal behavior (closes on escape/blur) 32 - modal: true 29 + key: `peek:${item.address}` 33 30 }; 34 31 35 - // Use the modal window API for peeks 36 32 windows.openModalWindow(item.address, params) 37 33 .then(result => { 38 34 console.log('Peek window opened:', result);
+1 -3
app/scripts/index.js
··· 27 27 script: str, 28 28 domEvent: 'dom-ready', 29 29 closeOnCompletion: true, 30 - }, 31 - // Make script windows hidden and auto-close 32 - modal: false 30 + } 33 31 }; 34 32 35 33 // For script windows, we use createWindow for more control
+1 -4
app/slides/index.js
··· 133 133 keepLive: item.keepLive || false, 134 134 persistState: item.persistState || false, 135 135 136 - // Add modal parameter - this will make the window hide when unfocused or when escape is pressed 137 - modal: true, 138 - 139 136 x, 140 137 y, 141 138 }; 142 139 143 140 // Open the window 144 - api.window.open(item.address, params).then(result => { 141 + windows.openModalWindow(item.address, params).then(result => { 145 142 if (result.success) { 146 143 console.log('Successfully opened slide with ID:', result.id); 147 144 // Store the window ID for future reference
+4 -1
app/windows.js
··· 16 16 * @returns {Promise<Object>} - Promise resolving to the window API result 17 17 */ 18 18 const openModalWindow = (address, params = {}) => { 19 - // Set modal flag to true 19 + // Modal closes on escape/blur but app keeps focus (see below) 20 20 params.modal = true; 21 21 22 + // Panel returns focus to previously active app 23 + params.type = 'panel'; 24 + 22 25 //console.log('Opening modal window with params:', params); 23 26 24 27 // Always use the IPC API
+2 -1
package.json
··· 33 33 "@electron-forge/plugin-fuses": "^7.8.0", 34 34 "@electron/fuses": "^1.8.0", 35 35 "electron": "^35.1.3" 36 - } 36 + }, 37 + "packageManager": "yarn@4.10.3" 37 38 }