Skip to content

feat: Interactive Canvas — Blueprint, Guided Tour, Corkboard & Stack Studio#26

Merged
New1Direction merged 41 commits into
mainfrom
feat/canvas-engine
Jun 16, 2026
Merged

feat: Interactive Canvas — Blueprint, Guided Tour, Corkboard & Stack Studio#26
New1Direction merged 41 commits into
mainfrom
feat/canvas-engine

Conversation

@New1Direction

Copy link
Copy Markdown
Owner

Interactive Canvas — turn a scan into a draggable, shareable map

Adds RepoLens's visual layer: one zero-build canvas engine powering three scopes, plus narrated tours and .excalidraw/SVG export. The goal is the "fun, addictive, must-have" surface — make evaluations something you see and arrange, not just read.

Stacked PR. Base is feat/scan-ledger (this work builds on the ledger's idb v4 + backup v2). It reaches main once the ledger merges. The 37 commits here are all additive — mostly new files; the few existing-file edits are additive (idb v4→v5, store.js/backup.js round-trip, output-tab/library/stack-tab view wiring, themes.css).

What's included

Phase 1 — Blueprint + Guided Tour + export

  • A new Canvas tab: a repo's Deep Dive (atoms/lineage) → an interactive, pan/zoom/draggable architecture map, color-coded by kind, roots highlighted.
  • Guided Tour: spotlights the architecture node-by-node in dependency order with narration (Back/Next/auto-play, keyboard ←/→/Esc, reduced-motion safe).
  • Export: .excalidraw (opens hand-drawn in excalidraw.com / Obsidian / VS Code) and SVG.
  • Arrangements persist in a new scenes IndexedDB store (v4→v5, additive) and round-trip through the backup envelope.

Phase 2 — Corkboard

  • A Corkboard view toggle in the Library: every scanned repo a draggable manila card, related repos joined by colored "red string" (alternatives / synergies / head-to-heads / combined ideas), shaded by fit, filterable by Collection, arrangement saved.

Phase 3 — Stack Studio

  • A View on canvas toggle in the existing Tech-Stack Builder: repos laid out in adoption order, joined by their integrations, gaps shown as dashed cards. Reuses the existing STACK_BUILD generation — no new AI path.

Architecture

  • One pure scene model (scene.js) + a vanilla Pointer-Events SVG engine (canvas-engine.js). Each scope is a small data adapter (blueprint-adapter.js, library-scene.js, stack-scene.js) + a layout (canvas-layout.js: layoutBlueprint/layoutCorkboard/layoutStack).
  • Key invariant: layout is pure + memoized; visual state (selection/tour/spotlight) is a separate overlay pass — no relayout on interaction.
  • A repair-graph.js pass normalizes messy LLM graph data. Exporters in canvas-export.js. Zero new dependencies; MV3-CSP-safe; theme-aware across all 13 themes.
  • Design spec + per-phase plans under docs/superpowers/specs/ and docs/superpowers/plans/. Inspired by Egonex-AI/Understand-Anything (concepts only — no React/ELK).

Testing

  • 800 tests passing. Pure logic is unit-tested (scene, repair-graph, layouts, all three adapters, tour, exporters, store scenes, backup scenes, library-graph, engine geometry/nodeClass).
  • Per the repo's no-DOM-test-env convention, the DOM glue (engine, tour-runner, view wiring) is verified live in a browser — each scope was driven end-to-end through its real pipeline and screenshotted.
  • Built subagent-driven: spec → plan → TDD → spec/quality review per task.

Notable fixes caught during review / live verification

  • Exporter XSS: coordinates are now numerically coerced before reaching SVG attributes.
  • Corkboard edge-join: store edges key by hashed node-ids (nodeIdFor); the adapter now joins them back to repoIds, so the red string actually connects (was silently dropping).
  • Collection filter: idea nodes with empty sources no longer leak past the filter.
  • Dropped a DOM-shim test-infra misstep in favor of pure-geometry tests + live verification.

Test plan

  • Load the unpacked extension; scan a repo; run Deep Dive; open the Canvas tab → nodes render, drag persists across a tab switch, Guided Tour spotlights step-by-step, .excalidraw downloads and opens in excalidraw.com.
  • Open the LibraryCorkboard: cards render with fit colors, string connects related repos (after running Alternatives/Synergies/Versus), drag persists across reload, the Collection filter narrows the board.
  • Multi-select 2–6 repos → Tech-Stack BuilderView on canvas: layer-colored cards in adoption order, integration string, dashed gap cards.
  • npx vitest run is green (800).

Out of scope (follow-ups)

  • Phase 1.5: search-to-focus over the canvas (BM25) + Scan-Ledger diff overlay (changed repos light up on re-scan).
  • Persisting/sharing the stack scene; force-directed Corkboard layout for very large libraries.

🤖 Generated with Claude Code

New1Direction and others added 30 commits June 16, 2026 00:24
…/import

Add scene CRUD to store.js using existing idbPut/idbGet/idbGetAll/idbDelete
helpers. Wire scenes into exportStores, importStores (including replace-mode
clear), and clearLibrary. Update store-backup snapshot assertion to include
the new scenes count.
Add `scenes` to `MAX_ROWS` (cap 2000), `buildBackup`, `validateBackup`,
`emptyValue`, and `summarizeBackup` — mirroring the `snapshots` pattern
exactly. Validator (`sceneOk`) requires `id`, `scope`, `nodes[]`, and
`edges[]`. Update pre-existing `backup.test.js` assertions to include the
new `scenes` field; add `tests/backup-scenes.test.js` for the new path.
Adds a tiny in-repo DOM environment (tests/dom-shim.js + dom-environment.js,
wired via a resolve.alias in vitest.config.js) so the one DOM-bound test runs
without jsdom — the repo ships no DOM dep and npm install is unavailable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…port

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, persist, open on dblclick

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@New1Direction New1Direction changed the base branch from feat/scan-ledger to main June 16, 2026 18:55
@New1Direction New1Direction merged commit c3e45d2 into main Jun 16, 2026
1 check passed
@New1Direction New1Direction deleted the feat/canvas-engine branch June 16, 2026 18:56
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