Skip to content

feat(canvas): A2A topology overlay with animated delegation edges - #751

Merged
HongmingWang-Rabbit merged 1 commit into
mainfrom
feat/issue-744-a2a-topology-overlay
Apr 17, 2026
Merged

feat(canvas): A2A topology overlay with animated delegation edges#751
HongmingWang-Rabbit merged 1 commit into
mainfrom
feat/issue-744-a2a-topology-overlay

Conversation

@molecule-ai

@molecule-ai molecule-ai Bot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • New A2ATopologyOverlay component — null-rendering side-effect that fan-outs GET /workspaces/:id/activity?type=delegation&limit=500&source=agent for every visible node every 60 s, aggregates by source→target pair, and writes directed edges to the a2aEdges Zustand slice
  • Edge styling — violet-500 + animated when last delegation was <5 min ago; blue-500 static otherwise; pointerEvents: none on all edge elements so canvas nodes remain draggable
  • Toolbar toggle — mesh-icon "A2A" button, on by default, persisted to localStorage via molecule:show-a2a-edges
  • Canvas mergeCanvas.tsx combines topology edges and A2A overlay edges via useMemo before passing to ReactFlow; a2aEdges is kept as a separate store slice so nestNode/removeNode don't accidentally clear the overlay
  • 24 new unit tests — pure buildA2AEdges filtering + aggregation + edge properties, formatA2ARelativeTime, and A2ATopologyOverlay component integration (toggle, visible-node filtering, fail-safe error handling)

Closes #744

Test plan

  • npm test — 689 tests, 0 failures
  • npm run build — compiled successfully, no type errors
  • 'use client' self-check — no missing directives
  • Visual: enable A2A toggle, trigger delegations between workspaces, edges appear with correct colour and label
  • Visual: edges disappear within 60 s of toggle-off; reappear on toggle-on
  • Visual: drag a workspace node — overlay edges don't intercept pointer events

🤖 Generated with Claude Code

…sue #744)

- New A2ATopologyOverlay component polls /activity fan-out every 60s and
  writes directed edges to a2aEdges store slice (separate from topology edges)
- buildA2AEdges aggregates delegate rows per source→target pair; violet-500
  animated edge when last call <5 min ago, blue-500 static otherwise
- Toolbar toggle persists to localStorage (molecule:show-a2a-edges)
- Canvas.tsx merges a2aEdges into allEdges via useMemo; pointerEvents:none
  on all edge elements keeps nodes draggable
- 24 new unit tests across pure function, helper, and component suites
- Fix Canvas.a11y and Canvas.pan-to-node store mocks (missing A2A fields)

Closes #744

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@molecule-ai

molecule-ai Bot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor Author

Dev Lead review complete — APPROVED for merge.

Quality gates verified:

  • use client present as first line on all hook-using components
  • Zustand selectors return primitives/functions only (showA2AEdges=bool, a2aEdges=stable array ref)
  • Edge merge via useMemo — correct, no selector-created objects
  • Dark zinc theme: zinc-400/900 fills, violet-500 animated recent edges, blue-500 static
  • buildA2AEdges is a pure exported function with 24 unit tests
  • Toolbar toggle persisted to localStorage
  • 689 total tests pass, build clean, no use client violations

Merge order: after PR #724 lands on main — topology overlay depends on hibernation auto-wake.

@HongmingWang-Rabbit
HongmingWang-Rabbit merged commit b7072d8 into main Apr 17, 2026
6 checks passed
@HongmingWang-Rabbit
HongmingWang-Rabbit deleted the feat/issue-744-a2a-topology-overlay branch April 17, 2026 16:15
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
…overlay

feat(canvas): A2A topology overlay with animated delegation edges
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

canvas: cross-workspace topology overlay — visualize A2A edges between workspace nodes

1 participant