[#54] feat: D3 force-directed plugin graph + consumes edges #88
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Competitor
Kind/Documentation
Kind/Enhancement
Kind/Epic
Kind/Feature
Kind/Security
Kind/Story
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Scope/Core
Scope/Cross-Plugin
Scope/Plugin-System
Scope/Single-Plugin
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ultanio/cobot!88
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "nazim/cobot:feat/d3-plugin-graph"
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?
Closes #54
Changes
Replaces the static circle layout in the plugin graph with an interactive D3.js force-directed visualization.
Before
After
d3.interpolateCoolspectrum) with gradient legend-nameexcludes,+nameincludes, plain text searchesconsumesedges added toget_plugin_graph_data()— shows capability-based aggregation relationships (e.g. loop consumes llm, tools)Files changed
cobot/plugins/web/templates/plugins.html— full rewrite with D3cobot/plugins/web/plugin.py— addedconsumesedge generationTests
153 passed, 0 failed.
🔌 Plugin Architecture Review — PR #88
PR: [#88] feat: D3 force-directed plugin graph + consumes edges
Issue: Closes #54 (Phase 2: Web admin panel)
Author: nazim
Files changed: 2 (
web/plugin.py,web/templates/plugins.html)Diff: ~465 lines
✅ What's Good
consumesedges inget_plugin_graph_data()— Clean addition (17 lines), follows exact same pattern as existing dependency/optional/implements edges. Correctly iteratesmeta.consumesand matches againstother.meta.capabilities. Well done.D3 force simulation — Proper use of
d3.forceSimulationwith charge, collision, center, and link forces. Drag behavior is correct (alphaTarget on start/end).Filter system — Layer/edge/text filters are well-designed. The
-name/+namefilter syntax is clever and useful for agents.Hover highlight — Connected-node highlighting with dimming is a nice UX touch.
Detail panel — Click-to-inspect showing version, layer, capabilities, extension points, implements.
⚠️ Concerns
1. External CDN dependency (blocking)
Cobot's philosophy is self-sovereign — it should work offline, on air-gapped VPS, behind firewalls. Loading D3 from jsdelivr makes the plugin graph non-functional without internet access.
Fix: Vendor D3 into
cobot/plugins/web/static/js/d3.min.jsand reference it locally:D3 v7 minified is ~270KB — acceptable for a bundled dependency.
2. Inline CSS replaces extracted stylesheet (blocking)
PR #81 specifically extracted CSS from
plugins.htmlintostatic/css/graph.cssto follow Cobot's CSS extraction convention. This PR puts all styles back inline in a<style>block.Fix: Move the new styles into
static/css/graph.css(replacing the old circle-layout styles). Keep the<link>tag in the template.3. Hardcoded color values (non-blocking)
The inline CSS uses hardcoded hex colors (
#1a1c24,#333,#0d0f14, etc.) instead of the CSS custom properties defined inmain.css(var(--bg-secondary),var(--border), etc.).Suggestion: Use the existing CSS variables for consistency.
4. No
consumesfield in PluginMeta fallback (non-blocking)The code does
for capability in meta.consumes— should usegetattr(meta, 'consumes', [])or verify the field has a default.5. No tests for
consumesedge generation (non-blocking)Add a test that creates two mock plugins where one consumes a capability the other provides, and verify the edge appears in the graph data.
🔧 Required Changes (blocking)
static/css/graph.css— follow the extraction convention from PR #81💡 Suggestions (non-blocking)
getattrformeta.consumesconsumesedge generationVerdict: NEEDS-REVISION
The feature itself is excellent — the D3 visualization is a huge upgrade over the static circle layout, and the consumes edges are cleanly implemented. Just needs the two blocking items fixed (vendor D3, extract CSS) to align with Cobot's self-sovereign philosophy and existing conventions.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.