Skip to content

Component spec — TreeViewer

Component spec — TreeViewer

Stub component: wiki/src/components/TreeViewer.astro

Wireframe reference: /ui/wireframes/tree-viewer/

API reference: GET /tree/state (/tech/api/tree-state/)


Rendering modes

ModeDescriptionPhase
staticSVG snapshot from @walkrpg/data topology. No walker state, no allocation. Used for wiki documentation embeds.Phase 9 (current)
interactiveReact component with tap/click, zoom, pan, confirm modal, mastery popover. Requires walker allocation state from API.Phase 11

Prop contract

The full prop contract is documented in wiki/src/components/TreeViewer.astro as a comment block. Key shapes:

  • topology — cluster, node, keystone, mastery data from GET /tree/state or directly from @walkrpg/data.
  • allocations — walker’s current node and keystone allocations (all provisional: false in mock mode).
  • available — computed available unlocks from the server.
  • availablePoints — integer, drives the header counter.
  • onAllocate — callback for interactive mode; fires before POST /tree/allocate.

Visual states

See /ui/wireframes/tree-viewer/ for the complete node-state visual spec. Summary:

StateFillBorderLabel
Allocated (small)--color-region-plenny 80%2dp accentVisible
Unallocated reachable--color-surface-variant2dp mutedVisible
Locked (prereq)--color-surface2dp disabledVisible
Path preview--color-surface-variant2dp warning dashedVisible
Notable (any)Larger shape3dpVisible
MasteryDouble ring3dp goldVisible
Keystone locked--color-surface3dp disabledVisible + lock glyph
Keystone unlocked--color-surface-elevated3dp warning pulseVisible
Keystone allocatedAccent fill3dp accentVisible

Open questions (phase 11 blockers)

  1. POST /tree/allocate spec — backend-engineer to author before phase 11. See prop contract comment in TreeViewer.astro for expected shape.
  2. Mastery pick endpointPOST /tree/allocate or separate POST /tree/mastery/pick? Needs mechanics-designer + backend-engineer alignment.
  3. Keystone cost — do keystones consume available points, or are they purely quest-gated? mechanics-designer to confirm. See tree-viewer wireframe FLAG_LEAD note.
  4. Pan + zoom model — phase 11 adds full pan/zoom for the 150-200 node production tree. The phase 9 starter cluster fits one screen at standard scale; no pan needed in phase 9.