Skip to main content

@ai-coach/vault-view-feat-climb

Seven-step learning climb ladder, ng-diagram structure drawing board, and freehand sketch pad for the vault view. It is lazy-loaded at /climb and connects ClimbStore to the Stairs, Draw, and Sketch tabs.

What it does not do​

  • No direct HTTP calls. Structure, reveal, generate, and sketch endpoints are invoked through ClimbStore in @ai-coach/vault-view-data-access.
  • No sibling feature imports. @nx/enforce-module-boundaries restricts type:feat to type:ui, type:data-access, type:util, and scope:shared.
  • No leaked internal sub-components. Only ClimbFeatureComponent is exported from src/index.ts; smart tabs, diagram board, and composite views stay private to this library.

Architecture fit​

[apps/vault-view route '/climb']
│
▼
[ClimbFeatureComponent] ──provides──▶ [ClimbStore]
│ │ │
▼ ▼ ▼
[StairsTab] [DrawTab → Board + RevealPanel] [SketchTab] ──▶ [@ai-coach/vault-view-ui]

Internal architecture & rules​

  • Typed component folders & suffixes (DEC-AIC-0063): The route entry lives directly at src/lib/climb.component.ts (ClimbFeatureComponent, vault-climb-feature); stateful smart components live under src/lib/smart/<name>/ (*SmartComponent, vault-*-smart: climb-draw-tab/, climb-sketch-tab/, climb-board/, climb-board-nodes/); pure input()/output() composites live under src/lib/composite/<name>/ (*CompositeComponent: climb-stairs-tab/, climb-reveal-panel/).
  • Preview-before-write UX: Structure saves, Generate recordings, and PNG sketch uploads always preview first in <vault-result-panel> before the user confirms the write.
  • Interactive drawing isolation: ClimbBoardSmartComponent encapsulates ng-diagram (provideNgDiagram(), custom concept and layer node templates) behind load() and drawing().
  • Component standards (DEC-AIC-0062): ChangeDetectionStrategy.OnPush everywhere, external .html/.css files for templates over ~40 lines, explicit public/private member accessibility, and zero comments in source code (DEC-AIC-0011).

Public surface​

  • ClimbFeatureComponent (vault-climb-feature) — Root route feature component providing ClimbStore, tab switching, book/topic selection, and keyboard shortcuts (A, P, ↑/↓).

How to extend it​

  1. Add any new climb API calls or state signals to ClimbStore in @ai-coach/vault-view-data-access and pure climb step helpers to @ai-coach/vault-view-util.
  2. Create or update a private OnPush component in src/lib/smart/<name>/ (*SmartComponent) or src/lib/composite/<name>/ (*CompositeComponent) using @ai-coach/vault-view-ui atoms and molecules.
  3. Wire it into ClimbFeatureComponent or the owning tab without exporting private components from src/index.ts.
  4. Run npm exec nx lint @ai-coach/vault-view-feat-climb, npm exec nx typecheck @ai-coach/vault-view-feat-climb, and npm exec nx test @ai-coach/vault-view-feat-climb.

Running & testing​

Unit tests run in Vitest; ngc type-checks all templates, ng-diagram node templates, and strict signal bindings.

npm exec nx test @ai-coach/vault-view-feat-climb
npm exec nx lint @ai-coach/vault-view-feat-climb
npm exec nx typecheck @ai-coach/vault-view-feat-climb

Key ADRs​

  • DEC-AIC-0059 — Establishes the Angular layered frontend and feature library split for the vault view.
  • DEC-AIC-0062 — Codifies smart container responsibilities, OnPush, external templates/styles, and Nx guardrails.
  • DEC-AIC-0063 — Adopts feature, smart, and composite component suffixes and directory rules.
  • DEC-AIC-0051 — Defines workspace tags and @nx/enforce-module-boundaries constraints.
  • DEC-AIC-0060 — Governs the eight-section package README structure and Docusaurus ingestion.