docs: record redesign verification — 255 tests, new shell description, run-from-root warning

E2E walked in the real app: login split panel, shell (groups/badge/health),
Ctrl+K palette with live client search, dashboard, clients chips, Client 360
(tabs + pulse ribbon click-through), document view + PDF, reports chips,
dark mode, 420px drawer. Verification session minted directly in the dev DB
and deleted after; servers stopped; stray apps/hq/data DB removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat/client-detail-redesign
Thomas Joise 5 days ago
parent c22fc5ba1e
commit 062ddd0737

@ -43,14 +43,17 @@ distilled to what applies to HQ. A change that breaks one does not land.
| Append-only audit | Every mutation calls `writeAudit(db, userId, action, entity, id, before, after)` in the **same transaction** as the change. The audit log is append-only — never update or delete rows. Previews and the public share route write nothing. | `audit.ts` | | Append-only audit | Every mutation calls `writeAudit(db, userId, action, entity, id, before, after)` in the **same transaction** as the change. The audit log is append-only — never update or delete rows. Previews and the public share route write nothing. | `audit.ts` |
| Client id is the future tenant id | `client.id` is a client-generated UUIDv7 that becomes `tenant_id` when the cloud tier stands up — same rows, promoted once. Never re-key clients. | `repos-clients.ts` | | Client id is the future tenant id | `client.id` is a client-generated UUIDv7 that becomes `tenant_id` when the cloud tier stands up — same rows, promoted once. Never re-key clients. | `repos-clients.ts` |
| No silent caps | Every list that can grow paginates or warns; never silently truncate. | reports, directory queries | | No silent caps | Every list that can grow paginates or warns; never silently truncate. | reports, directory queries |
| Strict TS, green before landing | Strict TypeScript everywhere; `npm run typecheck` and `npm test` both clean before anything lands. Money math is locked by tests — a rounding change without a test change does not land. | `tsc`, vitest (177 tests) | | Strict TS, green before landing | Strict TypeScript everywhere; `npm run typecheck` and `npm test` both clean before anything lands. Money math is locked by tests — a rounding change without a test change does not land. | `tsc`, vitest (255 tests) |
## Running it ## Running it
``` ```
npm install # workspace root, once npm install # workspace root, once
# backend (serves API on :5182, and the built web UI + public /share links) # backend (serves API on :5182, and the built web UI + public /share links)
cd apps/hq && npm start # build-server.mjs → dist/server.cjs; first boot prints a one-time owner password # RUN FROM THE REPO ROOT — the DB path resolves to ./data/hq.db from CWD, so
# `cd apps/hq && npm start` would boot a fresh empty DB in apps/hq/data instead.
npm run build --workspace @sims/hq
node apps/hq/dist/server.cjs # first boot on an empty data/ prints a one-time owner password
# frontend dev (Vite on :5183, proxies /api and /share to :5182) # frontend dev (Vite on :5183, proxies /api and /share to :5182)
cd apps/hq-web && npm run dev cd apps/hq-web && npm run dev
``` ```
@ -60,7 +63,7 @@ cd apps/hq-web && npm run dev
- Env: `HQ_DATA_DIR` (DB location), `SIMS_PIN_PEPPER` (set once, never change), `HQ_SECRET_KEY` - Env: `HQ_DATA_DIR` (DB location), `SIMS_PIN_PEPPER` (set once, never change), `HQ_SECRET_KEY`
(before Gmail), `GOOGLE_*` (Gmail), `AWS_*` (Cost Explorer), `HQ_PORT` (default 5182). (before Gmail), `GOOGLE_*` (Gmail), `AWS_*` (Cost Explorer), `HQ_PORT` (default 5182).
- Health check: `GET /api/health``{ ok: true }`. - Health check: `GET /api/health``{ ok: true }`.
- Verified state: `npm install` + typecheck clean, 177 tests pass. Exercise real flows end - Verified state: `npm install` + typecheck clean, 255 tests pass. Exercise real flows end
to end before claiming done. to end before claiming done.
## Docs (kept in `docs/`) ## Docs (kept in `docs/`)

@ -25,7 +25,7 @@ document and conversation we've had with them.
## Build state (start here) ## Build state (start here)
Working codebase, not a plan. `npm install` + typecheck are clean and **177 tests pass**. Working codebase, not a plan. `npm install` + typecheck are clean and **255 tests pass**.
Current state and run-vs-pending detail live in **[STATUS.md](STATUS.md)**; the go-live Current state and run-vs-pending detail live in **[STATUS.md](STATUS.md)**; the go-live
runbook (server, HTTPS, backups, Gmail/AWS/import wiring, the Postgres switch) is in runbook (server, HTTPS, backups, Gmail/AWS/import wiring, the Postgres switch) is in
**[docs/DEPLOY-HQ.md](docs/DEPLOY-HQ.md)**. **[docs/DEPLOY-HQ.md](docs/DEPLOY-HQ.md)**.

@ -17,11 +17,11 @@ append-only audit trail, an APEX cutover importer, and a background scheduler.
| --- | --- | | --- | --- |
| `npm install` | clean | | `npm install` | clean |
| `npm run typecheck` (root + workspaces) | clean, no errors | | `npm run typecheck` (root + workspaces) | clean, no errors |
| `npm test` (`vitest run`) | **177 tests pass across 46 files** | | `npm test` (`vitest run`) | **255 tests pass across 55 files** |
The 177 figure was re-counted from source (`it(`/`test(` blocks) and matches the The 255 figure is the live `vitest run` count (grew with the pipeline/follow-up
suite. Test files: 43 under `apps/hq/test/`, plus one each in and redesign work). Test files live under `apps/hq/test/`, `apps/hq-web/test/`,
`packages/{domain,auth,billing-engine}/test/`. and `packages/{domain,auth,billing-engine,ui}/test/`.
## Architecture ## Architecture
@ -180,9 +180,11 @@ Everything below is implemented and exercised by tests via the Express router
## Frontend screens (`apps/hq-web`) ## Frontend screens (`apps/hq-web`)
Shell (`Layout.tsx`): left nav, top bar with theme switcher + logout, and a Shell (`Layout.tsx`): grouped sidebar (WORK / CATALOG / INSIGHT / ADMIN) with
Gmail-disconnected banner. Nav is Dashboard / Clients / Modules / Reports / New lucide icons and a reminder-queue count badge, top bar with Ctrl+K command
Document, plus **Document Template** for owners. Routes (`main.tsx`): palette, Gmail status pill, theme/accent switcher and user chip, plus the
Gmail-disconnected banner. Owner-only items (Employees, Document Template)
appear in ADMIN; the warm ops-console restyle is the 2026-07-17 redesign spec. Routes (`main.tsx`):
| Route | Screen | What it does | | Route | Screen | What it does |
| --- | --- | --- | | --- | --- | --- |

Loading…
Cancel
Save