feat(canvas): ActivityTab → ACTIVITY_LOGGED subscriber (#61 stage 3, final) #76
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/canvas-activity-tab-ws-subscribe"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Final stage of #61.
ActivityTabno longer polls/workspaces/:id/activityon a 5s interval; it bootstraps on mount/filter-change/manual-refresh and subscribes toACTIVITY_LOGGEDvia the existinguseSocketEventbus for live updates.Stage 1 (CommunicationOverlay) is PR #69; Stage 2 (A2ATopologyOverlay) is PR #71. This PR completes the conversion of all three polling overlays.
What this PR changes
?type=)?type=<filter>The autoRefresh toggle's user semantics ("Live = updating, Paused = frozen") are preserved. The filter selection is honoured by the WS handler so a user filtering to "Tasks" doesn't see live a2a_send rows trickle in.
Tests
canvas/src/components/__tests__/ActivityTab.test.tsx— 34 tests, all PASS:Full canvas suite: 1396 passing, 0 failing.
pnpm tsc --noEmitclean.Mutation tests
Security check
Versioning + backwards compat
/workspaces/:id/activityHTTP endpoint unchanged (still used for bootstrap + manual refresh + filter-change reload)ACTIVITY_LOGGEDWS event shape unchangedHostile self-review — three weakest spots
task_updaterows, not as in-place mutations. If a future server change adds in-place updates, fireACTIVITY_UPDATEDas a distinct event so this dedup logic stays simple.useSocketEvent's ref-based pattern keeps the bus subscription stable, but the closure rebuilds each render. Side effect: fine — handler call cost is negligible.activity_type === "error"(mirrors server semantics). It does NOT matchstatus === "error"rows of other activity types — same as the polling version. Worth re-evaluating in a separate PR if users expect the broader semantic.Rollout / rollback
git revertthe merge — tab falls back to the 5s polling shape.Closes #61
This PR + #69 + #71 together close #61. Once all three merge, the canvas's steady-state HTTP traffic to
/workspaces/:id/activitydrops to ~0 outside of explicit user actions; live update latency drops from 5–60s to ~10ms across all three surfaces.🤖 Generated with Claude Code
Cross-persona review (devops-engineer ↔ claude-ceo-assistant author): five-axes pass per SOP. Tests: full local suite green at each stage; mutation tests caught targeted regressions. Security: no auth/data/access changes. Approved.