Skip to content

feat(web): /graph route MVP — lazy-loaded 3D force graph (TASK-1733) - #701

Merged
xarmian merged 2 commits into
mainfrom
feat/graph-route-mvp
Jun 5, 2026
Merged

feat(web): /graph route MVP — lazy-loaded 3D force graph (TASK-1733)#701
xarmian merged 2 commits into
mainfrom
feat/graph-route-mvp

Conversation

@xarmian

@xarmian xarmian commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

The first visible slice of PLAN-1730: a full-viewport 3D force-directed graph of the workspace at /{username}/{workspace}/graph, fed by the TASK-1731 endpoint through the TASK-1732 client.

  • Lazy by construction: 3d-force-graph (pulls Three.js) is imported only via dynamic import() inside onMount. Verified: Three.js lands in its own chunk (~1.3 MB) referenced only by the graph route's node via dynamic import — entry bundle unchanged.
  • Encoding: node color = collection, node size = subtree (child_count), blocks edges red + directional arrow, structural (parent/implements/supersedes/split-from) brighter than soft (wiki-link/related).
  • Interaction MVP: orbit/zoom from the lib, hover tooltip (ref — title, HTML-escaped), click → item page (refs resolve in the slug param via ResolveItem).
  • Scope control: active items only by default, "Show completed" toggle refetches in place; node/edge count readout; loading/error/empty states.
  • Lifecycle: plain non-reactive renderer handle (CONVE-1688), _destructor() teardown, ResizeObserver sizing, stale-response guard on workspace switch, title effect separated per CONVE-606.
  • Nav: graph in the shared destinations source (desktop Sidebar + mobile More sheet) + RESERVED_SLUGS.

Context

Implements TASK-1733 under PLAN-1730. Unblocks TASK-1734/1735/1736/1738 (interaction, search/filters, SSE liveness, layout tuning).

Test plan

  • make check — lint, vuln, Go tests, web build + svelte-check all green (0 errors)
  • svelte-autofixer MCP validation — no issues
  • Lazy-chunk verification (chunk referenced only via dynamic import from the graph node)
  • Visual check post-merge via make install (graph endpoint + page land together on the running server)

xarmian added 2 commits June 5, 2026 22:38
New full-viewport graph page at /{username}/{workspace}/graph rendering
the TASK-1731 endpoint via 3d-force-graph. Three.js loads only through
a dynamic import inside onMount, landing in its own ~1.3MB chunk
referenced solely by the graph route node — entry bundle unchanged.

Node color = collection (local hex palette; the chart PALETTE's CSS
vars can't reach WebGL), node size = 1 + 2×child_count, blocks edges
red with directional arrows, structural links brighter than soft ones.
Click navigates to the item page (ResolveItem accepts refs in the slug
param). Active items by default with a "Show completed" toggle that
refetches in place; workspace switches refetch with a stale-response
guard. Teardown via _destructor + ResizeObserver disconnect.

Nav: 'graph' added to destinations.ts (NavKey, RESERVED_SLUGS, primary
destinations, getActiveKey) and a Sidebar entry after Insights — the
mobile More sheet picks it up from the shared source automatically.

Parent: PLAN-1730.
…ion slug per Codex review (round 1)

1. The renderer-sync effect now pushes empty graphData when the
   reactive payload is null (workspace switch in flight / load error)
   instead of early-returning — the previous workspace's nodes no
   longer linger behind the loading overlay.
2. 'graph' added to reservedCollectionSlugs so a collection can't
   shadow the /{username}/{workspace}/graph route, matching the
   frontend's RESERVED_SLUGS.
@xarmian
xarmian merged commit db3917f into main Jun 5, 2026
4 checks passed
@xarmian
xarmian deleted the feat/graph-route-mvp branch June 5, 2026 22:45
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.

1 participant