@ai-coach/vault-view-feat-graph
Interactive vault link graph, filter sidebar, note reader, and progressive distillation feature for the vault view. It is lazy-loaded at / and wires GraphStore state to the SVG force canvas, detail views, and focus-mode distillation editor.
What it does not do
- No direct HTTP calls or raw backend imports. All API calls and state live in
@ai-coach/vault-view-data-access;@nx/enforce-module-boundariesrestrictstype:feattotype:ui,type:data-access,type:util, andscope:shared. - No sibling feature imports. Feature libraries (
feat-graph,feat-plans,feat-climb) never import each other. - No leaked internal sub-components. Only
GraphFeatureComponentis exported fromsrc/index.ts; all smart and composite sub-components stay private to this library.
Architecture fit
- Scope:
scope:vault-view - Style:
architecture:layered(type:feat) - Depends on:
@ai-coach/vault-view-data-access,@ai-coach/vault-view-ui,@ai-coach/vault-view-util - Used by:
@ai-coach/vault-view(lazy-loaded on/)
[apps/vault-view route '/']
│
▼
[GraphFeatureComponent] ──provides──▶ [provideGraphStores()]
│ │ │
▼ ▼ ▼
[Canvas] [Filters] [Detail views & Focus reader] ──▶ [@ai-coach/vault-view-ui]
Internal architecture & rules
- Typed component folders & suffixes (DEC-AIC-0063): The route entry lives directly at
src/lib/graph.component.ts(GraphFeatureComponent,vault-graph-feature); stateful smart components live undersrc/lib/smart/<name>/(*SmartComponent,vault-*-smart:graph-canvas/,graph-filters/,graph-detail-panel/,focus-reader/,passage-editor/,note-reader/); pureinput()/output()domain composites live undersrc/lib/composite/<name>/(*CompositeComponent:graph-canvas-controls/,graph-page-detail/,graph-book-detail/,graph-chapter-detail/,graph-note-detail/,graph-overview-detail/,note-blocks/,summary-editor/). - Separated canvas concerns:
graph-canvas/splits pure SVG scene builders (graph-canvas-scene.ts), camera/pointer navigation (graph-camera.controller.ts), and floating controls (graph-canvas-controls/) fromGraphCanvasSmartComponent. - Focused detail views:
GraphDetailPanelSmartComponentdelegates rendering to five pureinput()/output()composite views (Page,Book,Chapter,Note,Overview) composed from@ai-coach/vault-view-uiatoms and molecules. - Component standards (DEC-AIC-0062):
ChangeDetectionStrategy.OnPusheverywhere, external.html/.cssfiles for templates over ~40 lines, explicitpublic/privatemember accessibility, and zero comments in source code (DEC-AIC-0011).
Public surface
GraphFeatureComponent(vault-graph-feature) — Root route feature component providingprovideGraphStores()and coordinating keyboard shortcuts, canvas framing, filters, detail views, and focus distillation.
How to extend it
- Add any new state or API methods to the matching store in
@ai-coach/vault-view-data-accessand pure layout/formatting helpers to@ai-coach/vault-view-util. - Create a private
OnPushcomponent insrc/lib/smart/<name>/(*SmartComponentif injecting a store) orsrc/lib/composite/<name>/(*CompositeComponentif purelyinput()/output()) using atoms and molecules from@ai-coach/vault-view-ui. - Wire the new component into
GraphFeatureComponentorGraphDetailPanelSmartComponentwithout exporting it fromsrc/index.ts. - Run
npm exec nx lint @ai-coach/vault-view-feat-graph,npm exec nx typecheck @ai-coach/vault-view-feat-graph, andnpm exec nx test @ai-coach/vault-view-feat-graph.
Running & testing
Unit tests run in Vitest; ngc verifies all external templates and strict signal bindings.
npm exec nx test @ai-coach/vault-view-feat-graph
npm exec nx lint @ai-coach/vault-view-feat-graph
npm exec nx typecheck @ai-coach/vault-view-feat-graph
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-boundariesconstraints. - DEC-AIC-0060 — Governs the eight-section package README structure and Docusaurus ingestion.