Skip to main content

@ai-coach/vault-view-ui

Reusable, accessible, presentational Angular UI atoms, molecules, and layout shells for the vault view. It centralizes shared visual patterns—buttons, cards, detail drawers, tags, eyebrows, pagers, steppers, metric tiles, segmented groups, result panels, note action links, and the top shell header—so feature libraries stay focused on state wiring.

What it does not do​

  • No data-access, stores, or HTTP calls. @nx/enforce-module-boundaries restricts type:ui inside scope:vault-view to type:ui, type:util, and scope:shared. Every component receives data through input() signals and reports user intent through output() signals.
  • No feature or domain business rules. Graph filtering, planning calculations, and climb scoring belong in libs/vault-view/util, libs/vault-view/data-access, or libs/vault-view/feat-*.
  • No inline styles. Component styles live in dedicated .css files styled exclusively with design tokens from apps/vault-view/src/styles.css.

Architecture fit​

  • Scope: scope:vault-view
  • Style: architecture:layered (type:ui)
  • Depends on: @ai-coach/vault-view-util
  • Used by: @ai-coach/vault-view, @ai-coach/vault-view-feat-graph, @ai-coach/vault-view-feat-plans, @ai-coach/vault-view-feat-climb
[app shell / feat-graph / feat-plans / feat-climb]
│
input() / output() bindings
▼
[@ai-coach/vault-view-ui: atoms / molecules / shell]
│
▼
[@ai-coach/vault-view-util]

Internal architecture & rules​

  • Three UI folders with explicit class suffixes (DEC-AIC-0063):
    • Atoms (src/lib/atoms/, *AtomComponent): ButtonAtomComponent, EyebrowAtomComponent, GlassCardAtomComponent, ResultPanelAtomComponent, SectionCardAtomComponent, StatusPillAtomComponent, TagAtomComponent.
    • Molecules (src/lib/molecules/, *MoleculeComponent): DetailDrawerMoleculeComponent, MetricTilesMoleculeComponent, NoteLinksMoleculeComponent, PagerMoleculeComponent, SegmentedGroupMoleculeComponent, StepperMoleculeComponent.
    • Shell (src/lib/shell/, *ShellComponent): HeaderShellComponent.
  • Zoneless & OnPush everywhere: Every component sets ChangeDetectionStrategy.OnPush, uses standalone imports, and uses vault-* kebab-case element selectors.
  • Separate CSS and external templates: Every component uses standard *.component.{ts,html,css} filenames with styleUrl (never inline styles: or static style="..."), and templates longer than ~40 lines live in a sibling .html file (header.component.html).
  • Shared surface primitives: src/styles/primitives.css (imported by apps/vault-view/src/styles.css) provides .glass and .icon-btn for floating chrome and canvas overlays.
  • Code hygiene: Explicit public/private member accessibility on every class member and zero comments in source code (DEC-AIC-0011).

Public surface​

  • Atoms: ButtonAtomComponent (vault-button), EyebrowAtomComponent (vault-eyebrow), GlassCardAtomComponent (vault-glass-card), ResultPanelAtomComponent (vault-result-panel), SectionCardAtomComponent (vault-section-card), StatusPillAtomComponent (vault-status-pill), TagAtomComponent (vault-tag).
  • Molecules: DetailDrawerMoleculeComponent (vault-detail-drawer), MetricTilesMoleculeComponent (vault-metric-tiles, MetricTileItem), NoteLinksMoleculeComponent (vault-note-links), PagerMoleculeComponent (vault-pager), SegmentedGroupMoleculeComponent (vault-segmented-group, SegmentedOption), StepperMoleculeComponent (vault-stepper, StepperItem).
  • Shell: HeaderShellComponent (vault-shell-header, ShellNavItem).

How to extend it​

  1. Choose the tier (src/lib/atoms/<name>/, src/lib/molecules/<name>/, or src/lib/shell/<name>/) and create <name>.component.ts and <name>.component.css (plus <name>.component.html if the template exceeds ~40 lines) with ChangeDetectionStrategy.OnPush, a vault-* selector, matching *AtomComponent/*MoleculeComponent/*ShellComponent class suffix, and signal input()/output() APIs only.
  2. Style using CSS custom properties from apps/vault-view/src/styles.css so dark and light themes work automatically.
  3. Re-export the component and its public option/item interfaces from src/index.ts.
  4. Add Vitest unit tests in src/lib/ui-primitives.spec.ts, then run npm exec nx lint @ai-coach/vault-view-ui, npm exec nx typecheck @ai-coach/vault-view-ui, and npm exec nx test @ai-coach/vault-view-ui.

Running & testing​

Unit tests run in Vitest with Angular's zoneless TestBed and component resource resolution—no real browser or backend server is required.

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

Key ADRs​

  • DEC-AIC-0059 — Establishes the Angular layered frontend architecture for the vault view.
  • DEC-AIC-0062 — Codifies OnPush, separate CSS/HTML standards, and Nx lint/typecheck/test guardrails.
  • DEC-AIC-0063 — Splits UI into atoms/, molecules/, and shell/ with explicit component type suffixes.
  • DEC-AIC-0051 — Defines workspace tags and @nx/enforce-module-boundaries rules.
  • DEC-AIC-0060 — Governs the eight-section package README structure and Docusaurus ingestion.