Skip to main content

@ai-coach/vault-view

The minimal, lazy-loaded Angular application shell for the vault view. It bootstraps the browser UI, renders the persistent shell header, handles global keyboard shortcuts, provides design tokens and theme variables, and lazy-loads the Graph, Plans, and Climb feature routes.

What it does not do​

  • No feature pages or domain logic. Feature screens live in libs/vault-view/feat-graph, libs/vault-view/feat-plans, and libs/vault-view/feat-climb.
  • No direct backend or vault imports. @nx/enforce-module-boundaries restricts scope:vault-view to scope:vault-view and scope:shared (architecture:layered). All vault data arrives over HTTP via frontend-owned DTOs in @ai-coach/vault-view-data-access.
  • No component-specific styles in global CSS. src/styles.css holds design tokens, theme variables, base resets, and presentation-mode visibility; UI primitive styles live in libs/vault-view/ui and feature styles live beside their components.
  • No direct globalThis coupling in shell state or shortcuts. Browser state flows through injected DOCUMENT in ShellStore and pure shortcut handlers.

Architecture fit​

  • Scope: scope:vault-view
  • Style: architecture:layered (type:app, app:vault-view)
  • Depends on: @ai-coach/vault-view-data-access, @ai-coach/vault-view-ui, @ai-coach/vault-view-util, and lazy-loaded @ai-coach/vault-view-feat-graph, @ai-coach/vault-view-feat-plans, @ai-coach/vault-view-feat-climb
  • Used by: Built as an Nx task dependency of @ai-coach/vault-adapter-view and served on 127.0.0.1 by @ai-coach/vault-view-server
Browser ──HTTP──▶ [@ai-coach/vault-view-server] ──serves dist/browser──▶ [@ai-coach/vault-view]
│
┌───────────────────┬───────────────────┼───────────────────┐
▼ (lazy) ▼ (lazy) ▼ (lazy) ▼
[feat-graph] [feat-plans] [feat-climb] [ui / data-access / util]

Internal architecture & rules​

  • Zoneless standalone bootstrap: appConfig registers provideZonelessChangeDetection(), provideRouter(appRoutes, withComponentInputBinding()), and provideHttpClient(withInterceptors([vaultTokenInterceptor])).
  • Lazy-loaded feature routes: Every top-level route (/, /plans, /climb) uses loadComponent so feature bundles (including ng-diagram for Climb) stay out of the initial shell chunk.
  • Component standards: Every component uses ChangeDetectionStrategy.OnPush, explicit public/private member accessibility, separate .css files (styleUrl), no inline styles, and no source comments (DEC-AIC-0011).
  • Testable shell shortcuts: Global keyboard shortcuts (P toggles presentation mode, Escape exits it) are delegated to a pure handleShellShortcut helper guarded by isGlobalShortcut.

Public surface​

  • / (path: '') — Lazy-loads GraphFeatureComponent from @ai-coach/vault-view-feat-graph (vault link graph, filters, note reader, and progressive distillation).
  • /plans — Lazy-loads PlansFeatureComponent from @ai-coach/vault-view-feat-plans (goal chain tree and effort timeline).
  • /climb — Lazy-loads ClimbFeatureComponent from @ai-coach/vault-view-feat-climb (seven-step learning ladder, structure drawing board, and sketch pad).
  • /** — Redirects unknown paths to /.
  • Built static bundle in dist/browser/ (index.html, main.js, styles.css, and lazy chunk-*.js files) consumed by @ai-coach/vault-adapter-view.

See the vault view guide and glossary for how each view works.

How to extend it​

  1. Create or update the feature library under libs/vault-view/feat-<name> with its own OnPush container component and external .css files.
  2. Add a lazy loadComponent (or loadChildren) entry in src/app/app.routes.ts and register its navigation item in AppComponent.
  3. Add or update unit tests in src/app/*.spec.ts covering route laziness, config, or shortcut behavior.
  4. Run npm exec nx lint @ai-coach/vault-view, npm exec nx typecheck @ai-coach/vault-view, npm exec nx test @ai-coach/vault-view, and npm exec nx build @ai-coach/vault-view.

Running & testing​

Start the local vault view server (which serves the built bundle for your vault):

coach-vault-view --vault /path/to/vault

Or run the Angular dev server directly during frontend work:

npm exec nx serve @ai-coach/vault-view

See the vault view guide for all server options and browser shortcuts.

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

Key ADRs​

  • DEC-AIC-0059 — Migrates the vault view to an Angular layered application with frontend-owned DTOs.
  • DEC-AIC-0061 — Splits the loopback HTTP view host into apps/vault-view-server.
  • DEC-AIC-0062 — Establishes Angular layer responsibilities, component standards, lazy routes, and Nx guardrails for vault-view.
  • DEC-AIC-0063 — Adopts the six-role component taxonomy (feature, smart, composite, shell, UI atoms and molecules) with explicit type suffixes.
  • DEC-AIC-0051 — Defines the workspace apps/ + libs/ layout and @nx/enforce-module-boundaries rules.