Skip to content

Add AI Learning Roadmap interactive canvas application - #31204

Closed
AM-Bear wants to merge 2 commits into
anthropics:mainfrom
AM-Bear:claude/continue-ai-roadmap-b77Z1
Closed

AM-Bear wants to merge 2 commits into
anthropics:mainfrom
AM-Bear:claude/continue-ai-roadmap-b77Z1

Conversation

@AM-Bear

@AM-Bear AM-Bear commented Mar 5, 2026

Copy link
Copy Markdown

Summary

This PR introduces a complete interactive canvas-based learning roadmap application built with React and Vite. The application allows users to create, organize, and visualize AI learning paths through an interactive node-and-edge graph system with full persistence via localStorage.

Key Changes

Core Application Structure

  • Main entry point (ai-roadmap.jsx): Multi-board manager with localStorage persistence, hash-based URL routing for direct board access, and board CRUD operations (create, duplicate, rename, delete, import/export)
  • Canvas component (Canvas.jsx): Full-featured interactive canvas with 557 lines implementing:
    • Pan and zoom controls with scroll-to-zoom and fit-to-screen
    • Node creation, editing, deletion, and duplication
    • Edge/connection management with labeled relationships
    • Multi-select with shift+click and drag-to-select box
    • Group/container support with visual grouping and editing
    • Context menus for quick actions
    • Real-time search filtering
    • Keyboard shortcuts (Space for pan, Delete for remove, Escape to cancel)

UI Components

  • Toolbar (Toolbar.jsx): Mode selection (select/connect/delete), node addition, group creation, search, zoom controls, and navigation
  • NodePanel (NodePanel.jsx): Side panel for editing selected node properties (title, category, rank, status, URL, notes) with edge management
  • Sidebar (Sidebar.jsx): Legend view showing categories and controls, plus category management (add/edit/delete)
  • Modals (Modals.jsx): Add node and edit group dialogs with form validation
  • BoardCard (BoardCard.jsx): Board preview cards with thumbnail visualization, rename, duplicate, export, and delete actions
  • Minimap (Minimap.jsx): Collapsible minimap showing canvas overview and viewport indicator
  • UI primitives (ui.jsx): Reusable form field, button, and context menu item components

Data & Utilities

  • Constants (constants.js): Node dimensions, UID generation, color presets, status definitions, and shared inline styles
  • Utils (utils.js): Edge geometry calculation (quadratic Bezier curves), rectangle overlap detection, and board factory function
  • Seeds (data/seeds.js): Default categories and pre-populated learning nodes/edges for demo board

Build Configuration

  • Vite setup (vite.config.js): React plugin configuration
  • Package.json: React 18.3.1 and React DOM dependencies with dev/build/preview scripts
  • HTML entry (index.html): Minimal setup with dark theme styling
  • Main entry (main.jsx): React StrictMode root render

Notable Implementation Details

  • State management: Extensive use of React hooks (useState, useRef, useCallback, useEffect, useMemo) for canvas interactions, selection, dragging, and UI state
  • Coordinate transformation: toC() function converts screen coordinates to canvas coordinates accounting for pan and zoom
  • Persistence: Boards auto-save to localStorage on every change; UID counter is hydrated from saved data to prevent ID collisions
  • URL routing: Hash-based navigation allows direct board access via #board-{id} URLs
  • Canvas rendering: SVG-based with pattern backgrounds, markers for arrows, and transform-based pan/zoom
  • Keyboard/mouse handling: Comprehensive event handling for keyboard shortcuts, pointer events, context menus, and multi-select workflows
  • Dark theme: Consistent dark color scheme (#080c12 background, #0a0e18 panels, #64748b text) with accent colors for categories and status indicators

https://claude.ai/code/session_01KAgvqHrtMK7tX4YGJ9GHPE

claude added 2 commits March 5, 2026 19:11
- Save as ai-roadmap.jsx (main App entry with board manager home)
- localStorage persistence: boards survive page refresh, hydrates on load
- Hash-based URL routing: #board-{id} opens board directly, browser back/forward works
- Split into focused components:
  · Canvas.jsx — full interactive canvas logic
  · components/Toolbar.jsx — top toolbar
  · components/NodePanel.jsx — node editor side panel
  · components/Sidebar.jsx — legend & categories sidebar
  · components/Minimap.jsx — minimap overlay
  · components/Modals.jsx — AddNode and EditGroup modals
  · components/BoardCard.jsx — board card on home screen
  · components/ui.jsx — shared UI primitives (F, FL, GB, CMI)
  · constants.js — NODE_W/H, STATUS, COLOR_PRESETS, uid, FI, TB
  · data/seeds.js — SEED_NODES, SEED_EDGES, DEFAULT_CATS
  · utils.js — edgeGeom, rectsOverlap, makeBoard
- Vite + React project setup (index.html, package.json, vite.config.js)

https://claude.ai/code/session_01KAgvqHrtMK7tX4YGJ9GHPE
Previously, fn(board) was called inside setPanel's callback, reading
the board prop that hadn't updated yet in the same render cycle.

Now fn(board) is called once eagerly before both onUpdate and setPanel,
so both operate on the same derived state with no stale closure risk.

https://claude.ai/code/session_01KAgvqHrtMK7tX4YGJ9GHPE

@AM-Bear AM-Bear left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

PR summary (Add AI Learning Roadmap interactive canvas app)
This PR adds a new Vite/React “ai-roadmap” app (~1,886 LOC) with a multi-board manager, hash routing, localStorage persistence, and a fairly full-featured interactive canvas (nodes/edges/groups/minimap/sidebar/pan/zoom/selection).

What looks solid

Nice end-to-end feature slice: board manager + “open board” view, plus import/export flows, makes this usable immediately.

State update wiring looks correct: Canvas updates are routed through onUpdate={fn => upd(activeId, fn)} which ensures edits land on the active board entry in boards.

Canvas interaction basics are thoughtfully covered: wheel zoom (non-passive), space-to-pan, drag-select, multi-select behavior, etc.

Must-fix before merge

CSS bug in index.html: 100 vw / 100 vh won’t apply
Right now you have spaces in the units:
#root { width: 100 vw; height: 100 vh; } → should be 100vw / 100vh.

Remove the hidden/bidi Unicode characters flagged by GitHub
GitHub is explicitly warning that index.html contains hidden or bidirectional Unicode text. This is a real supply-chain risk class (“Trojan Source”) and should be cleaned before merging.
(Also flagged on package.json as well.)

High-value follow-ups (strongly recommended)

Effect dependencies & StrictMode behavior: Canvas persists pan/zoom via an effect that calls onUpdate(...). In React 18 StrictMode (enabled in main.jsx), effects run twice in dev, which can mean extra writes / extra board updates while developing. Consider guarding (e.g., only persist if values changed from board) or ensuring onUpdate is stable and included in deps.

Inline-style sprawl: This is fine for a contained app, but long-term maintainability will improve a lot if common styles are centralized (CSS file / CSS modules / styled components).

Input validation on import: Import currently parses JSON and trusts structure. Even a lightweight shape check (required fields, arrays) would prevent corrupted boards from bricking the UI.

Nitpicks

package.json formatting (indentation/newlines) is nonstandard; running a formatter (or npm pkg fix style tooling) would reduce diff noise later.

Verdict

Request changes for the 100vw/100vh typo and the hidden/bidi Unicode cleanup. Once those are addressed, I’d be comfortable approving—this is a substantial, cohesive feature addition with good UX fundamentals.

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.

2 participants