refactor(core): consolidate hud resident into core background renderer
Moves HUD's `hud` command + CmdOrCtrl+H shortcut registration from a
standalone hud-resident BrowserWindow created by hud-glue.ts into the
core background renderer. app/hud/background.js now exports
initHud/uninitHud; app/index.js awaits initHud() after initCmd +
initPage. app/hud/index.html and backend/electron/hud-glue.ts are
deleted.
The macOS did-become-active / did-resign-active handlers that hide
and restore non-focusable alwaysOnTop overlay windows (HUD) move
inline into main.ts's existing focus handler — they only need the
main process `app` and `BrowserWindow` APIs.
Moves the HUD sheet-config seeding from background.js into hud.js so
the overlay reads/writes its own layout in its own tile's namespace.
Previously background.js wrote the config to the `hud` tile's
namespace and the overlay read it back via `getExtKey('hud', ...)`.
Now that background.js runs inside core (tileId='core'), it would
write to the wrong namespace; owning the config in the overlay avoids
the cross-tile dependency entirely. background.js opens the HUD
window with a sensible default size; the overlay auto-resizes to its
widget layout on load (unchanged behaviour).
Also addresses a related namespace-collision for cmd: its
`api.settings.set('prefs', ...)` now running inside core would write
to `core_prefs` instead of `cmd_prefs`, breaking the cmd panel
window (which still has tileId='cmd' and reads from its own
namespace). cmd/background.js persists directly via
`api.datastore.setRow('feature_settings', 'cmd_prefs', ...)` to keep
the logical cmd namespace regardless of which tile runs the code.
Retargets the v2-pubsub reproducer test from the now-removed cmd
resident window to the core background renderer as publisher, and
from the now-removed hud resident to any eager feature tile as
subscriber.
Replaces external-url.spec.ts' post-publish 500ms sleep with a
deterministic subscribe-then-wait on `window:opened` — under parallel
workers the sleep was occasionally too short. Main publishes
window:opened as soon as the new window registers, so the test can
wait on the event directly instead of polling.
HUD tests (10/10), hybrid-settings (3/3), groups-context (5/5), and
core.spec (7/7) all pass. Full desktop suite: 217/218 pass (the one
failure is a shutdown-hang flake in page-redirect.spec.ts unrelated
to consolidation; passes in isolation).