experiments in a post-browser web
10
fork

Configure Feed

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

refactor(tile-preload,ipc): flip features-schema + get-window-id to strict + delete legacy (Phase 3.6e)

- tile-preload: api.features.settingsSchema now routes strictly through
tile:features:settings-schema; v1-compat fallback to feature-settings-schema removed
- tile-preload: api.window.getId now routes strictly through tile:window:get-id;
v1-compat fallback to get-window-id removed; hasWindowCapability() guard dropped
- ipc.ts: deleted ipcMain.handle('feature-settings-schema') legacy handler
- ipc.ts: deleted ipcMain.handle('get-window-id') legacy handler
- Pre-verified: zero invoke('feature-settings-schema'|'get-window-id') callers in app/ or features/

+6 -42
+1 -32
backend/electron/ipc.ts
··· 215 215 // - lastFocusedVisibleWindowId: Last focused visible window (for per-window cmds) 216 216 // 217 217 // IPC handlers: 218 - // - get-window-id: Returns the calling window's ID 219 218 // - get-focused-visible-window-id: Returns lastFocusedVisibleWindowId 220 219 // ============================================================================ 221 220 ··· 1178 1177 } 1179 1178 }); 1180 1179 1181 - ipcMain.handle('feature-settings-schema', async (ev, data) => { 1182 - try { 1183 - const extPath = getExtensionPath(data.id); 1184 - if (!extPath) { 1185 - return { success: false, error: `Extension ${data.id} not found` }; 1186 - } 1187 - 1188 - const manifest = loadExtensionManifest(extPath); 1189 - if (!manifest || !manifest.settingsSchema) { 1190 - return { success: true, data: null }; 1191 - } 1192 - 1193 - const schemaPath = path.join(extPath, manifest.settingsSchema); 1194 - if (!fs.existsSync(schemaPath)) { 1195 - return { success: true, data: null }; 1196 - } 1180 + } 1197 1181 1198 - const schemaContent = fs.readFileSync(schemaPath, 'utf-8'); 1199 - const schema = JSON.parse(schemaContent); 1200 - return { success: true, data: schema }; 1201 - } catch (error) { 1202 - const message = error instanceof Error ? error.message : String(error); 1203 - return { success: false, error: message }; 1204 - } 1205 - }); 1206 - } 1207 1182 1208 1183 /** 1209 1184 * Theme settings storage keys ··· 3528 3503 ipcMain.on(IPC_CHANNELS.RENDERER_LOG, (_ev, msg) => { 3529 3504 const shortSource = msg.source?.replace('peek://app/', '').replace('peek://ext/', 'ext/') || 'unknown'; 3530 3505 console.log(`[${shortSource}]`, ...(msg.args || [])); 3531 - }); 3532 - 3533 - // Get current window ID (the window that sent the IPC message) 3534 - ipcMain.handle('get-window-id', (ev) => { 3535 - const win = BrowserWindow.fromWebContents(ev.sender); 3536 - return win ? win.id : null; 3537 3506 }); 3538 3507 3539 3508 // Get app-level preferences
+5 -10
backend/electron/tile-preload.cts
··· 828 828 /** 829 829 * Get the Electron BrowserWindow id for the calling renderer. 830 830 * 831 - * No `window` capability required — the tile's token is the 832 - * authority (a tile always knows its own window). Falls back to 833 - * the un-gated legacy `get-window-id` channel for v1-compat tiles. 831 + * Routes strictly through `tile:window:get-id`. No `window` 832 + * capability required — the tile's token is the authority 833 + * (a tile always knows its own window). 834 834 */ 835 835 getId: () => { 836 836 if (!tokenValid) return Promise.reject(new Error('Not initialized')); 837 - if (hasWindowCapability()) { 838 - return ipcRenderer.invoke('tile:window:get-id', { token: tileToken }); 839 - } 840 - return ipcRenderer.invoke('get-window-id'); 837 + return ipcRenderer.invoke('tile:window:get-id', { token: tileToken }); 841 838 }, 842 839 }; 843 840 ··· 1612 1609 : featuresCompat.resolvePublisher(query as string); 1613 1610 }, 1614 1611 settingsSchema: (id: unknown) => { 1615 - return hasFeaturesCapability() 1616 - ? featuresStrict.settingsSchema(id as string) 1617 - : ipcRenderer.invoke('feature-settings-schema', { token: tileToken, id }); 1612 + return featuresStrict.settingsSchema(id as string); 1618 1613 }, 1619 1614 1620 1615 // ── Admin surfaces (strict-only) ─────────────────────────────────