experiments in a post-browser web
10
fork

Configure Feed

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

fix(tests): disable cmd panel close-on-blur + showSelf window.show under headless

+20 -4
+11 -2
backend/electron/ipc.ts
··· 2373 2373 2374 2374 // Set up modal behavior if requested 2375 2375 // Delay blur handler attachment to avoid race condition where focus events 2376 - // are still settling after window creation (can cause immediate close) 2377 - if (options.modal === true) { 2376 + // are still settling after window creation (can cause immediate close). 2377 + // 2378 + // In test profiles, skip the close-on-blur handler entirely. Under 2379 + // parallel Playwright workers (fullyParallel + workers > 1), focus 2380 + // events flicker between windows in ways they don't in real user 2381 + // sessions, causing modal cmd panels to close mid-test with 2382 + // "Target page, context or browser has been closed" errors on any 2383 + // subsequent .press() / .evaluate() call. OS-integration behavior 2384 + // for close-on-blur should be covered by a dedicated serial suite, 2385 + // not smoke. 2386 + if (options.modal === true && !isTestProfile()) { 2378 2387 setTimeout(() => { 2379 2388 if (!win.isDestroyed()) { 2380 2389 win.on('blur', () => {
+9 -2
backend/electron/tile-ipc.ts
··· 33 33 } from './tile-launcher.js'; 34 34 import { parseManifestFile } from './tile-manifest.js'; 35 35 import { publish, subscribe, unsubscribe, scopes, type Scope } from './pubsub.js'; 36 - import { DEBUG, TILE_STRICT } from './config.js'; 36 + import { DEBUG, TILE_STRICT, isHeadless } from './config.js'; 37 37 import { publishCapabilityViolation } from './tile-violations.js'; 38 38 import { getFeatureRegistry } from './feature-startup.js'; 39 39 import { getAtprotoSource } from './feature-startup.js'; ··· 2740 2740 if (!win || win.isDestroyed()) { 2741 2741 return { success: false, error: 'Tile window not found' }; 2742 2742 } 2743 - win.show(); 2743 + // In headless test runs, keep the window hidden. Otherwise it pops 2744 + // foreground and steals OS focus from other Electron instances in 2745 + // parallel Playwright workers, which triggers blur on modal cmd panels 2746 + // and breaks unrelated tests. The tests that assert showSelf's effect 2747 + // check state via pubsub / evaluate, not visual presence. 2748 + if (!isHeadless()) { 2749 + win.show(); 2750 + } 2744 2751 return { success: true }; 2745 2752 } catch (err) { 2746 2753 const message = err instanceof Error ? err.message : String(err);