From 54484ec8a09206fad7336cafbf8b5384cba081cc Mon Sep 17 00:00:00 2001 From: null Date: Fri, 3 Jul 2026 12:47:07 -0500 Subject: [PATCH] docs(qa): archive IMP-CODE-01 (money formatter consolidation) Co-Authored-By: Claude Opus 4.8 --- HISTORY.md | 1 + docs/QA_PLAN.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index a4aa372..a35f9d6 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -18,6 +18,7 @@ ### ๐Ÿงน QA Cleanup +- **[Client] One source of truth for money formatting** โ€” the client had ~15 hand-rolled currency formatters (local `fmt`/`money`/`fmtFull`/`fmtDollars`/โ€ฆ across pages and components) alongside a canonical `fmt` in `lib/utils` used at ~190 sites โ€” the same rules copy-pasted with inconsistent handling of negatives, whole-dollar, cents-vs-dollars, and blank input. Added `client/lib/money.js` (`formatUSD` / `formatUSDWhole` / `formatCentsUSD`, with `signed`/`dash`/`whole` options) as the single implementation; inputs are coerced so `null`/`''`/`NaN` never render as `$NaN` and `-0` never shows as `-$0.00`. `lib/utils.fmt` now delegates to it (byte-identical โ€” guarded by the existing `utils.test.js` suite) and the 15 local formatters were removed in favor of it. Tests: `client/lib/money.test.js`. (was IMP-CODE-01) - **[Build] Split the vendor bundle** โ€” the main `index` chunk was ~659 kB (over Vite's 500 kB warning). Added `build.rollupOptions.output.manualChunks` (`vite.config.mjs`) to split React, Radix, framer-motion, and TanStack into separately-cacheable vendor chunks; the index chunk dropped to ~334 kB and the warning is gone. (was QA-B0-01) - **[Deps] Removed unused markdown libraries** โ€” `react-markdown`, `rehype-sanitize`, and `remark-gfm` were declared but never imported (client markdown is rendered by a custom `MarkdownText` component). Removed all three and corrected the security notes: the actual XSS defense is React auto-escaping + the restrictive custom renderer (https-only link hrefs, no `dangerouslySetInnerHTML` anywhere), not rehype-sanitize. (was QA-B14-03) - **[Debt] Removed dead `totalInterestPaid`** โ€” unused outside its own export, and its unrounded accumulation diverged from `amortizationSchedule`'s per-month rounding. Removed from `services/aprService.js`. (was QA-B7-02) diff --git a/docs/QA_PLAN.md b/docs/QA_PLAN.md index 401600f..55fc951 100644 --- a/docs/QA_PLAN.md +++ b/docs/QA_PLAN.md @@ -214,7 +214,7 @@ graduate to `roadmap.md`/`FUTURE.md`. | ID | Lens | Area (`file`/page) | Proposal (what & why) | Effort | Status | |----|------|--------------------|-----------------------|--------|--------| -| IMP-CODE-01 | Code | `client/` (~10 files, ~30 sites) | **No shared client money formatter.** Server has `utils/money.js`; the client formats currency inline with `toLocaleString`/`Intl.NumberFormat` scattered across ~10 components. Add `client/utils/money.js` `formatUSD(cents)` and migrate call sites โ†’ one consistent format (esp. negatives), single source of truth for the cents model. | M | ๐Ÿ”ต Noted | +| IMP-CODE-01 | Code | `client/lib/money.js` (+16 files) | ~~No shared client money formatter.~~ **Shipped `a15f00c`:** added `client/lib/money.js` (`formatUSD`/`formatUSDWhole`/`formatCentsUSD`); `lib/utils.fmt` delegates to it and 15 local formatters were removed. `null`/`NaN`/`-0` all handled. Test `client/lib/money.test.js`; full client suite + build green. | M | โœ… Shipped | | IMP-CODE-02 | Code | `db/database.js` (4,174 ln) | **Oversized module.** One file mixes the migration engine, query helpers, settings, and connection lifecycle. Split into cohesive modules (behavior-preserving, test-guarded) for navigability and lower merge-conflict risk. | L | ๐Ÿ”ต Noted | | IMP-CODE-03 | Code | `services/*match*`, `bankSync*` | **Overlapping match logic.** `transactionMatchService` / `matchSuggestionService` / `merchantStoreMatchService` each write `match_status` + bill/payment links; QA-B5-04 showed how easily these drift out of sync. Extract one canonical "set/clear match" helper so state transitions live in one place. | M | ๐Ÿ”ต Noted | | IMP-IA-01 | IA | Sidebar ยท `/data` | **Central features under an overflow menu.** Data (import/export/backups) and account pages are reachable only via the account overflow dropdown + `Ctrl+K`, not the primary nav. For how central import/export/backup is, consider a primary-nav or labeled "Manage" entry so it's easier to find. | S | ๐Ÿ”ต Noted |