Skip to content

[Feature] Interactive Visual Codebase & Dependency Topology Explorer in Admin Dashboard - #8

Merged
spelech merged 1 commit into
mainfrom
feature/visual-topology-explorer
Aug 25, 2026
Merged

[Feature] Interactive Visual Codebase & Dependency Topology Explorer in Admin Dashboard#8
spelech merged 1 commit into
mainfrom
feature/visual-topology-explorer

Conversation

@spelech

@spelech spelech commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #4

Implements an Interactive Visual Codebase & Dependency Topology Explorer within the ContextCortex Admin Dashboard, bridging static AST relationship graphs, API route hierarchies, and client caller links into an interactive, force-directed graph canvas.

Backend Enhancements

  • REST Endpoints in app/api/routes.py & app/services/topology.py:
    • GET /admin/api/graph/topology: Gathers indexed files, AST symbols, AST relationships, and API server/client routes into graph nodes (file, module, class, function, route) and edges (IMPORTS, CALLS, DEFINES, HANDLES, ROUTES_TO). Supports multi-view filtering (files, symbols, routes, full), BFS subgraph scoping from root_node by depth, pagination limits, and cross-repo __all__ exploration.
    • GET /admin/api/graph/node-details: Returns rich entity metadata, source code preview/signature, line ranges, inbound callers/importers, outbound callees/imports, and git provider permalinks.
  • Pydantic Schemas: Added TopologyNode, TopologyEdge, TopologyStats, TopologyResponse, NeighborDetail, NodeDetailsResponse in app/models/schemas.py.
  • Backend Tests: Added comprehensive test suite in tests/backend/test_topology_graph.py (13 tests verifying graph construction, view types, 404 handling, BFS traversal, and benchmark scaling on 500+ nodes).

Frontend Enhancements

  • Topology Component (frontend/src/TopologyExplorer.tsx):
    • Interactive SVG force-directed physics graph with repulsion, spring tension, and center gravity simulation.
    • Pan (drag canvas), Zoom (mouse wheel & control buttons), reset view, and minimap viewport.
    • Dynamic filtering by node type (File, Class, Function, Route) and edge type (IMPORTS, CALLS, DEFINES, HANDLES, ROUTES_TO).
    • Search bar with instant autocomplete and focus/zoom centering on matching nodes.
    • Slide-over Inspector Drawer detailing code snippets, line ranges, incoming/outgoing neighbor chips, and permalink navigation.
    • SVG and JSON graph export capability.
  • Dashboard Integration: Added dedicated "Topology" tab and icon in frontend/src/App.tsx.
  • Frontend Tests: Added unit tests in frontend/src/tests/TopologyExplorer.test.tsx and Playwright E2E spec in frontend/e2e/topology.spec.ts.

Validation

  • pytest -v: 277 passing tests across all backend test modules.
  • python3 scripts/generate_requirements.py: Automated SRS generated and verified against live test suite.
  • npm run test & npm run build: 82 passing frontend tests and clean TypeScript/Vite production build.

@spelech spelech left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: Interactive Visual Codebase & Dependency Topology Explorer (PR #8)

✅ Verification & Findings:

  • Backend Graph Topology REST APIs: GET /admin/api/graph/topology and GET /admin/api/graph/node-details efficiently aggregate files, symbols, AST relationships, and API routes with flexible view filters, depth BFS traversal, and cross-repo support.
  • Frontend Topology Component: Interactive force-directed canvas with pan/zoom/drag, minimap, type/edge filtering, autocomplete search-to-focus, SVG/JSON export, and slide-over inspector drawer.
  • Comprehensive Test Coverage:
    • Backend: 13 new pytest tests in tests/backend/test_topology_graph.py (277 total backend tests passing).
    • Frontend: 82 Vitest unit tests passing across all components, Playwright E2E spec added, clean TypeScript build.

Approved and ready for merge once Docker CI pipeline finishes.

@spelech
spelech merged commit fd7773b into main Aug 25, 2026
2 checks passed
@spelech
spelech deleted the feature/visual-topology-explorer branch August 25, 2026 05:01
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.

[Feature] Interactive Visual Codebase & Dependency Topology Explorer in Admin Dashboard

1 participant