refactor(groups): collapse into single tile (non-resident)
Fifth consolidation in the series, after websearch (commit 2426191a),
entities (31ae6cdd), lex (74567f3f), tag-actions (682f9d87).
Groups is the one case where resident:true is explicitly wrong.
Root cause of the earlier attempt's test breakage (all 5
tests/desktop/groups-context.spec.ts tests regressed to mode stuck
at default) was a Playwright URL substring-match collision, NOT the
bootstrap pattern. With resident:true, a hidden startup window
loads peek://groups/home.html at boot. The tests open a second
groups window via the legacy peek://ext/groups/home.html URL.
sharedApp.getWindow('groups/home.html', ...) substring-matches
BOTH and returns the hidden one (created first). Clicks hit the
hidden window, setMode wrote to windowId N while the test checked
windowId M, mode looked stuck. Verified via diag during this
session: setMode returned {success:true, windowId:13}, test checked
windowId:35.
Websearch, entities, lex, tag-actions don't hit this because their
test URLs match the resident URL exactly. Groups tests use the
legacy /ext/ prefix — legitimate reason to not make it resident.
Solution: consolidate to one tile WITHOUT resident:true. Groups is
invoked lazily via the 'groups' noun command and Cmd+G shortcut
(registered declaratively in main.ts for CONSOLIDATED_EXTENSION_IDS).
On first invocation the tile launches, an async IIFE at module
top-level runs api.initialize then initBackground (noun registration,
setGroupMode/exitGroupMode/openGroup, settings load/save, shutdown),
then the existing DOMContentLoaded listener fires showGroups for
the UI. No URL collision, no extra setMode writes at boot.
Changes:
- manifest.json: single home tile entry with flat window fields, no
resident flag. Kept the existing pubsub/commands/datastore caps.
- home.js: merged 648 lines of background.js logic into a dedicated
block before const init. DOMContentLoaded hookup and showGroups/
showAddresses entirely untouched.
- background.js and background.html deleted (886 + 37 lines).
- Net -286 lines.
Tests: Group Mode Context 5/5 (was 0/5 before merge), Groups
Navigation 1/1, no regressions.