refactor: migrate callers from legacy peek://ext/id to v2 peek://id
Both URL schemes resolved to the same filesystem path via the
backward-compat shim in backend/electron/protocol.ts. The legacy
form is a v1 leftover. Mixed usage caused real bugs this session
(groups resident:true broken by a Playwright substring-match
collision between resident URL and test-opened URL), and the
general pattern is a landmine waiting to surface in whatever
tile gets resident next.
This commit migrates all CALLERS to the canonical v2 form. The
protocol.ts compat shim is intentionally left in place — removing
it is a follow-up once we're confident no external callers
(chrome extensions, tauri, long-lived session data) still point
at the legacy form.
By bucket:
- backend/electron/: 14 files (main.ts, ipc.ts, tile-ipc.ts,
tile-launcher.ts, session.ts + test, entry.ts, cmd-glue.ts,
hud-glue.ts, closed-window.test.ts, pubsub.test.ts,
lazy-loading.test.ts, izui-state.test.ts, space-mode.test.ts)
- features/: 30 files (background.js, home.js, manifests)
- app/: 7 files (cmd, config, settings, hud)
- tests/: 10 files (smoke, cmd-state-machine, cmd-chain,
websearch-cmd, module-health, groups-context, pagestream, hud,
fixtures, helpers, unit)
Non-trivial edits:
- tests/helpers/window-utils.ts + tests/fixtures/desktop-app.ts:
generic 'peek://ext/' prefix checks changed to
startsWith('peek://') + substring filter on path
- backend/electron/session.ts: URL validation regex replaced with
URL parser that handles both forms (still need to parse
session data saved under the legacy URL)
- backend/electron/tile-ipc.ts: log source shortener updated
Included in this commit:
ALSO includes the hud.spec.ts:393 flake fix — added a setMode
default + waitForHudModeValue handshake at the start of the
'HUD displays group mode with name' test. The test was racing
the mode widget's webview subscription on a freshly reopened HUD,
passing in isolation but failing when run after test 349 in the
full suite. Mirrors the proven pattern in test 152.
Tests: HUD Extension 10/10, Command Execution 8/8, no regressions.