DEC-AIC-0062: Establish Angular frontend architecture standards, UI component types, and Nx guardrails for vault-view
Draft
Status: draft · 2026-11-30
Context
DEC-AIC-0059 migrated the vault view frontend into an Angular layered application (apps/vault-view and libs/vault-view/{data-access,ui,feat-climb,feat-graph,feat-plans,util}) with frontend-owned DTOs and Nx module-boundary tags (scope:vault-view, architecture:layered, type:app|feat|ui|data-access|util).
Before refactoring the individual frontend layers, two gaps remained (observed: repository @ 2026-11-30): only libs/vault-view/util had a Vitest test target, none of the seven vault-view projects had a typecheck target or Angular-specific ESLint rules (angular-eslint), and several components used inline styles: blocks, omitted ChangeDetectionStrategy.OnPush, or mixed browser globals into stores.
Decision
- Enforce strict layer responsibilities across
scope:vault-view:data-access(libs/vault-view/data-access): Pure HTTP API services and focused signal stores/facades. No rawglobalThis.locationordocumentaccess inside stores (inject AngularRouter/DOCUMENTor pass values through explicit inputs), and no god-stores.ui(libs/vault-view/ui): Pure presentational components driven exclusively byinput()andoutput(), withChangeDetectionStrategy.OnPushand zerodata-accessimports or injection (type:uimay depend only ontype:uiandtype:util). UI components fall into three explicit types:- Primitives (atoms): low-level design-system building blocks (for example,
StatusPill,GlassCard, buttons, inputs, badges). - Composite / wrapper UI components: presentational components that wrap and compose other
uicomponents (for example, headers, filter bars, toolbars, detail panels, section cards, empty states) while remaining purelyinput()/output()-driven with nodata-accessinjected. - Layout / shell UI components: structural presentational frames composing
uicomponents and<ng-content>slots, with nodata-accessinjected.
- Primitives (atoms): low-level design-system building blocks (for example,
feat-*(libs/vault-view/feat-climb,feat-graph,feat-plans): Thin smart containers that binddata-accessfacades touicomponents and coordinate feature interactions.util(libs/vault-view/util): Pure, framework-free TypeScript helpers.
- Enforce component and file standards:
- Explicit
ChangeDetectionStrategy.OnPushon every component (zoneless-ready). - Explicit
public/private(orprotected) access modifiers on every class member. - No inline styles at all:
@Component({ styles })and staticstyle="..."attributes in templates are forbidden; every component's styles live in a separate.cssfile referenced viastyleUrl. - External
.htmltemplates whenever an inline template exceeds ~40 lines; soft cap of ~250 LOC per file. - Lazy-loaded feature routes in
apps/vault-view/src/app/app.routes.ts. - No comments in source code (DEC-AIC-0011).
- Explicit
- Wire automated guardrails across
apps/vault-viewand all sixlibs/vault-view/*libraries:- Angular ESLint (
angular-eslint): Configured ineslint.config.mjsforapps/vault-viewandlibs/vault-view/*with hard'error'rules forvaultcomponent/directive selectors,@typescript-eslint/explicit-member-accessibility,no-restricted-syntaxbanning@Component({ styles }), and@angular-eslint/template/no-inline-styles(withallowBindToStyle: true). Pre-existingOnPushand template accessibility violations start at'warn'and promote to'error'as each layer is refactored. - Nx
typechecktargets:ngc --noEmit -p tsconfig.jsononapps/vault-viewand all Angularlibs/vault-view/*libraries (tsc --noEmitonlibs/vault-view/util). - Nx
testtargets: Vitest (vitest.config.mtswithwatch: falseandpassWithNoTests: true) acrossapps/vault-viewand all sixlibs/vault-view/*libraries.
- Angular ESLint (
Consequences
- Contributors and AI agents have one authoritative specification for how
vault-viewlayers, UI component types (primitives, composite wrappers, and layout shells), styles, templates, and tests are structured. - Every
vault-viewproject now exposeslint,typecheck, andtestthrough Nx, catching template errors, strict typing regressions, and boundary violations in CI. - Existing inline styles, missing
OnPush, and template accessibility warnings are surfaced immediately bynx lintand will be eliminated and promoted to errors during the subsequent layer-refactoring PRs.