feat(ui): Force 3D — experimental Threlte view mode (closes #103)#104
Merged
Conversation
Adds a new view mode `force3d` last in the GRAPH_VIEWS dropdown with an EXPERIMENTAL badge. Renders the same artifact dependency graph as 2D Force in a Three.js scene via Threlte v8, simulating positions with d3-force-3d. The chunk is lazy-loaded behind `view === 'force3d'` so non-3D users pay zero bytes. What ships: - shared/config/ui-prefs.ts: GraphViewMeta gains optional `badge`; new `force3d` entry registered last. - shared/ui/select: Select renders a pill-style badge next to the label (used by Force 3D, available to any future entry). - widgets/dependency-graph-3d: new widget — Threlte canvas + d3-force-3d simulation, OrbitControls, kind-colored spheres (R_eff sized), edge segments, theme reactivity (light + dark via data-theme observer). Initial layout uses a phyllotaxis sphere (radius 50) so the simulation starts spread out, then forces shape clusters. - widgets/dependency-graph/ui/DependencyGraph.svelte: lazy-import branch for Force 3D — no Three.js / Threlte in the main bundle. - widgets/dependency-graph/ui/ForceView.svelte: TODO marker for the growth-vision in-Force-mode 2D ↔ 3D switch. Forgeplan trail (full Standard pipeline, R_eff = 1.00 / grade A): - PRD-022 — problem, FRs / NFRs, acceptance, risk register - RFC-019 — Option A (Threlte + d3-force-3d) chosen vs three alternatives - EVID-027 — smoke test with structured fields (verdict / CL / type) Refs: PRD-022 RFC-019 EVID-027 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The experimental single-file ESM bundle inlines all runtime deps. Force 3D adds Three.js + Threlte (~2.4 MB unzipped). Non-3D users still pay 0 bytes in the legacy `dist/` shape (lazy chunk), but the experimental shape can't code-split — so the floor moves to 6M. Documented in RFC-019. Refs: PRD-022 RFC-019 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 7, 2026
fedorovvvv
added a commit
that referenced
this pull request
May 8, 2026
…105) Reverts #104 in full as requested. `git revert -m 1 c60fd77` undoes: - Removes `template/src/widgets/dependency-graph-3d/` (Force 3D widget). - Drops `force3d` from `GRAPH_VIEWS` + `GraphView` union. - Restores `Select.svelte` (no badge support). - Drops `three`, `@threlte/core`, `@threlte/extras`, `d3-force-3d`, `@types/three` from `template/package.json`. - Restores `template/package-lock.json`. - Removes `// TODO(force-mode-2d3d-switch)` from `ForceView.svelte`. - Restores `scripts/build.mjs` `DIST_EXPERIMENTAL_MAX_BYTES` to `3 * 1024 * 1024` (the 3M → 6M bump bundled in PR #104 is reverted in the same commit). - Removes `.forgeplan/prds/PRD-022`, `.forgeplan/rfcs/RFC-019`, `.forgeplan/evidence/EVID-027`. Issue #103 will be reopened after merge — the feature is no longer in the codebase, so its tracking issue should reflect that. ## Test plan - [x] `npm run check` — 0 errors / 0 warnings (1047 files, matches pre-#104 baseline). - [ ] CI matrix (ubuntu / macos / windows) green. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new Force 3D view mode (last in the dropdown, badged
experimental) that renders the artifact dependency graph in a Threlte v8canvas, simulating positions with
d3-force-3d. Chunk is lazy-loaded sonon-3D users pay zero bundle bytes.
Closes #103.
Why
The 2D Force view collapses dense workspaces (~80+ artifacts) into hairballs
where cluster topology becomes illegible. The 3D layout separates orthogonal
sub-graphs spatially. Reference: vasturiano/3d-force-graph; visual style
adapted to Forgeplan tokens (kind colors, status emissive glow, R_eff →
sphere radius).
What changed
shared/config/ui-prefs.ts—GraphViewMeta.badge?+force3dentry last.shared/ui/select— pill badge next to label.widgets/dependency-graph-3d/— new widget: Threlte canvas, scene,NodeMesh, sim builder, theme adapter,d3-force-3dambient types.widgets/dependency-graph/ui/DependencyGraph.svelte— lazyawait import('@/widgets/dependency-graph-3d')only whenview === 'force3d'.widgets/dependency-graph/ui/ForceView.svelte— TODO marker for thefuture in-Force-mode 2D ↔ 3D switch (PRD-022 growth vision).
template/package.json—@threlte/core,@threlte/extras,three,d3-force-3dto deps;@types/threeto devDeps.Forgeplan
vanilla Three, the reference 3d-force-graph wrapper, and r3f.
verdict: supports,CL: 3,type: test),R_eff = 1.00, overall grade A on both PRD and RFC.
Test plan
npm run check— 0 errors / 0 warnings (2105 files).npm run build— production build passes;dependency-graph-3dchunklives in its own client chunk; verified the homepage entry only
references it via dynamic
import('../chunks/...').EXPERIMENTAL badge, 3D scene renders 123 nodes / 104 edges, orbit
drag rotates camera, theme reactivity (light + dark) confirmed.
to a follow-up EvidencePack alongside the in-mode 2D ↔ 3D switch.
🤖 Generated with Claude Code