experiments in a post-browser web
10
fork

Configure Feed

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

refactor(window-placement): Phase 4 - slides renderer no longer computes x/y, main process owns placement

+8 -39
+8 -39
features/slides/background.js
··· 58 58 const height = item.height || 600; 59 59 const width = item.width || 800; 60 60 61 - const screen = { 62 - height: window.screen.height, 63 - width: window.screen.width 64 - }; 65 - 66 - let x, y, center = null; 67 - 68 - switch(item.screenEdge) { 69 - case 'Up': 70 - x = (screen.width - width) / 2; 71 - y = 0; 72 - break; 73 - case 'Down': 74 - x = (screen.width - item.width) / 2; 75 - y = screen.height; 76 - break; 77 - case 'Left': 78 - x = 0; 79 - y = (screen.height - item.height) / 2; 80 - break; 81 - case 'Right': 82 - x = screen.width; 83 - y = (screen.height - item.height) / 2; 84 - break; 85 - default: 86 - center = true; 87 - console.log('[ext:slides] unknown screen edge'); 88 - } 89 - 90 - console.log('[ext:slides] execute slide', item.screenEdge, x, y); 61 + console.log('[ext:slides] execute slide', item.screenEdge); 91 62 92 63 const key = `${item.address}:${item.screenEdge}`; 93 64 ··· 142 113 keepLive: item.keepLive || false, 143 114 persistState: item.persistState || false, 144 115 145 - x, 146 - y, 147 - 148 - // Phase 2: pass `screenEdge` through alongside the legacy x/y so the 149 - // window-open path in main records `placement: { mode: 'edge', edge }` 150 - // on the registry. The renderer math above stays in place — Phase 4 151 - // deletes it once main-process `computePlacement` is wired up. When 152 - // both screenEdge AND explicit x/y are present, intent wins over 153 - // coords (see ipc.ts placement-derivation precedence). 116 + // Slides emit `screenEdge` ('Up'|'Down'|'Left'|'Right'); the 117 + // window-open path in main maps it to `placement: { mode: 'edge', edge }` 118 + // and computes bounds via `computeInitialBounds` against the cursor's 119 + // display every time the slide opens (and re-anchors via 120 + // `computePlacement` on reuse + display-change). The renderer no 121 + // longer computes x/y — main owns placement. See backend/electron/ 122 + // window-placement.ts and ipc.ts edgeMap. 154 123 screenEdge: item.screenEdge, 155 124 156 125 // tracking