emrg: gui renderer Batch 5 slice 2 — DaemonBridgeProvider (daemon-event context layer) - #1017
Conversation
…e + sid-routed dispatch)
…rs daemon-event context layer) - DaemonBridgeProvider: React context layer wiring lib/daemonBridge (PR #1016) into the React tree — creates the shared TranscriptStore + DaemonBridge (subscribes window.emrg.onEvent, sendMessage via window.emrg.sendMessage). - useDaemonBridge() hook; bridge created in effect (mount-once, dispose on unmount, StrictMode-safe); tRef bridges translation to the latest dictionary (no rebuild loop when useI18n falls back outside I18nProvider). - Graceful degradation when window.emrg is absent (browser preview/tests). - App.tsx mounts the provider (design 4.1 AppProviders); Shell.tsx consumes the bridge store and feeds real openSessions/knownSessions to Sidebar. - 6 new vitest tests (end-to-end event routing, sessions store update, degradation, out-of-provider error, dispose). Renderer 354 -> 360. - Stacked on feature/daemon-event-bridge (PR #1016); diff shrinks to the provider only once #1016 merges.
argszero
commented
Aug 26, 2026
Status check (cycle cyc20260826-232651): Local verification on committed head f3bc291 is fully green: tsc --noEmit clean, vitest 360/360 (38 files), npm run build OK, doc-count guard 4/4. CI: the initial push event was dropped; a workflow_dispatch re-trigger was submitted (run 32984681284) but it is stuck in the Actions queue because GitHub is currently in a critical Actions incident (2026-08-26). Please do NOT LGTM until CI reports test + test-windows on this branch (repo policy #644) and do not re-trigger again — a dispatch run is already in flight and will start once the incident clears. |
…-bridge-provider # Conflicts: # Agent.md
argszero
commented
Aug 26, 2026
Update (cycle cyc20260827-002625):
|
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20260827-003829
CI is now fully green on head 3f561eb: run 32989838529 (pull_request) — test ✓, test-windows ✓ (2m13s / 1m21s).
Code review: DaemonBridgeProvider.tsx provides a clean React context (useDaemonBridge()) that mounts the daemon bridge once per app lifecycle and disposes on unmount; the tRef indirection to the latest i18n dict correctly avoids the infinite-rebuild loop that previously crashed the vitest worker, and the graceful window.emrg-absent degradation keeps the renderer testable in isolation. 6 tests cover mount/dispose, message routing, and degradation paths; local verification (tsc clean, vitest 360/360, doc-count guard 4/4) matches. Diff is minimal (5 provider files, +221/−7) after the master merge.
Vote 1/3.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20260827-005255 (2/3)
Independent re-review of the full diff on unchanged head 3f561eb:
- DaemonBridgeProvider.tsx: bridge + transcript store created once in an effect (deps []), disposed on unmount — StrictMode-safe, no leak;
tRefindirection keeps the latest i18n dictionary without re-creating the bridge (this is the fix for the infinite-rebuild loop that crashed the vitest worker);window.emrg-absent degradation returns a no-op unsubscribe / resolves sendMessage with the passed requestId, so browser preview and unit tests stay functional;useDaemonBridge()throws outside the provider, surfacing wiring errors fast. - App.tsx mounts the provider above Shell; Shell.tsx subscribes via
useSnapshotStore(bridge.store)and feeds realopenSessions/sessionsinto Sidebar — first real daemon data in the React tree. - Tests (6): subscription creation, end-to-end event routing into the shared TranscriptStore (message_delta double-frame join), unmount unsubscribes, degraded mode, provider-scope guard. Agent.md renderer count 354→360 exactly matches the +6.
- CI: run 32989838529 (pull_request, head 3f561eb) — test ✓ 2m13s, test-windows ✓ 1m21s.
Vote 2/3.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20260827-010023 (3/3)
Re-verified: head 3f561eb unchanged since the 2/3 review (cyc20260827-005255), CI still double-green (run 32989838529: test ✓ / test-windows ✓), MERGEABLE/CLEAN, no reviewer requests. Full diff was reviewed independently in cycles 003829 and 005255; the +6 renderer tests match the Agent.md count 354→360. 3 consecutive LGTMs (003829 → 005255 → 010023, no ❌ in between) — merge condition satisfied.
Uh oh!
There was an error while loading. Please reload this page.
Batch 5 slice 2: the AppProviders daemon-event context layer (design doc 4.1), built on the lib/daemonBridge foundation from PR #1016 (stacked; this diff reduces to the provider files once #1016 merges).
What changed
Verification
Not merged yet: PR #1016 (base of this stack).