Skip to main content

DEC-AIC-0063: Adopt typed component taxonomy (feature, smart, composite, shell, UI atoms and molecules) with explicit type suffixes for vault-view

Draft

Status: draft · 2026-12-02

Context​

DEC-AIC-0062 established layered boundaries (data-access, ui, feat-*, util) and three presentational UI component types (primitives, composites, layout shells) for the Angular vault view. During the decomposition of feat-graph, feat-plans, and feat-climb (observed: repository @ 2026-12-02), two naming and structural gaps emerged:

  1. Stateful sub-components inside feature libraries (such as the graph canvas, filters, detail panel, focus reader, passage editor, and climb draw/sketch tabs) inject data-access stores directly while route-level pages coordinate the route. Calling both "feature components" blurred the boundary between route entry points, stateful interactive slices, and pure input()/output() domain views.
  2. Generic *.component.ts filenames made it impossible to tell from a file path or class name whether a component is an indivisible UI atom, a reusable UI molecule, a layout shell, a pure domain composite, a stateful smart component, or a route-level feature container.

Decision​

  1. Adopt a six-role component taxonomy with role directories, standard *.component.{ts,html,css} filenames, and explicit class/selector suffixes across scope:vault-view:
    • Feature (src/lib/<domain>.component.ts / *FeatureComponent / vault-*-feature): Route-level entry containers directly in libs/vault-view/feat-*/src/lib/ that provide feature-scoped stores, coordinate route shortcuts/layout, and are the sole public export of each feat-* library's src/index.ts.
    • Smart (smart/<name>/*.component.ts / *SmartComponent / vault-*-smart): Private stateful components in libs/vault-view/feat-*/src/lib/smart/<name>/ that inject data-access stores/facades (or diagram/editor services) to own a cohesive interactive slice without polluting presentational views.
    • Composite (composite/<name>/*.component.ts / *CompositeComponent): Pure input()/output()-driven domain-shaped presentational views in libs/vault-view/feat-*/src/lib/composite/<name>/ (such as detail panels, goal trees, timelines, and reveal comparisons) with zero data-access store injection.
    • Shell (shell/<name>/*.component.ts / *ShellComponent): Structural layout and chrome frames in libs/vault-view/ui/src/lib/shell/ composing UI components and <ng-content> slots with zero data-access imports.
    • UI Atoms (atoms/<name>/*.component.ts / *AtomComponent): Indivisible design-system primitives in libs/vault-view/ui/src/lib/atoms/ (Button, Eyebrow, GlassCard, ResultPanel, SectionCard, StatusPill, Tag) with zero data-access imports.
    • UI Molecules (molecules/<name>/*.component.ts / *MoleculeComponent): Small reusable UI widgets in libs/vault-view/ui/src/lib/molecules/ composed from atoms (DetailDrawer, MetricTiles, NoteLinks, Pager, SegmentedGroup, Stepper) with zero data-access imports.
  2. Preserve one-component-per-directory and private feature internals: Every component lives in its own directory alongside its sibling .html/.css files. Feature libraries export only their *FeatureComponent from src/index.ts.
  3. Promote OnPush lint rule to 'error': Since all components across apps/vault-view and libs/vault-view/* now set ChangeDetectionStrategy.OnPush, promote @angular-eslint/prefer-on-push-component-change-detection from 'warn' to 'error' in eslint.config.mjs.

Consequences​

  • Contributors and AI agents can immediately determine a component's dependency rules and state ownership from its directory, file suffix, and class name.
  • libs/vault-view/ui separates indivisible atoms/, composed molecules/, and layout shell/ frames cleanly while keeping all exports accessible through @ai-coach/vault-view-ui.
  • Missing ChangeDetectionStrategy.OnPush on any new or edited vault-view component now fails nx lint immediately.

Alternatives Considered​

  • Keeping uniform *.component.ts suffixes: Rejected because file trees and imports hid whether a component injected stores or remained purely presentational.
  • Creating a separate Nx library for smart components: Rejected as premature fragmentation; keeping smart components private inside their owning feat-* library preserves cohesive feature boundaries and lazy-loading chunks while making their role explicit.