Add shared event batching helper for live

Task 9110 · Done · Coder · created · updated

Task 9106 made `useLiveRefetch` read every stream event through `useEventStream().recentEvents`, not only `lastEvent`. Other effects still read only `lastEvent`, so an event followed by another in the same React render is never heard: - `apps/web/src/pages/taskDetail/useTaskDetailLoad.ts`: the seed-drop effect (a quiet `control_message` then a foreign event leaves a stale seed) and the worktree reload effect (a `worktree` then a `task` event skips `loadWorktrees()`). - `apps/web/src/hooks/useTaskTree.ts`, `apps/web/src/components/WorktreePool.tsx`, `apps/web/src/components/tasks/TaskRunMetrics.tsx`, `apps/web/src/lib/liveCast.ts`: same pattern. Requirement: give these readers one shared "events since last seen" helper next to `useLiveRefetch`, and use it everywhere `lastEvent` drives a refetch. Out of scope: server-side event relay and queue size; `useLiveRefetch` itself (already fixed). Done means: - Each listed effect reacts to an event that a later event in the same render would have hidden, with a unit test per hook. - `./dc check quick` is green.

Outcome

Added useEventsSinceSeen next to useLiveRefetch and moved every id-filtered lastEvent refetch onto it; 6 per-hook tests fail on old code and pass now. Quick gate green; PR #6673 queued in the merge lane. No UI surface affected. Memory: none applied.

Pull request

Artifacts

Activity

  • Created
  • Run
  • Runner started
  • Runner ended (done)