Skip to content

Memories and Settings screen conformance#386

Merged
sysread merged 3 commits into
mainfrom
claude/so-tech-debt-audit-8zr2gf
Jul 3, 2026
Merged

Memories and Settings screen conformance#386
sysread merged 3 commits into
mainfrom
claude/so-tech-debt-audit-8zr2gf

Conversation

@sysread

@sysread sysread commented Jul 3, 2026

Copy link
Copy Markdown
Owner

SYNOPSIS

Layer 3 batch two: the Memories and Settings screens brought into conformance with the frontend split, following the BiasProfile pattern. Pure structure, zero behavior change, +150 primitive tests.

PURPOSE

Both screens carried their decision logic inline - Memories its body-surface cascade, action vocabulary, and form validation; Settings its usage aggregation math, validation/error copy, and notice tables. The convention says those live in src/lib/ui/ companions.

DESCRIPTION

  • Memories (2,107 -> 1,976): new screen-scoped src/lib/ui/memories.ts (443 lines) - the 6-way body-surface precedence cascade, the Reaffirm/Doubt/Delete busy/done/error vocabulary + notices, edit-form validation w/ exact error copy, save-state footer, relation-kind sentinels; librarian-strip primitives extended memory-librarian.ts. 37 new tests.
  • Settings (2,582 -> 2,378): usage aggregation (per-model/currency fan-out, token attribution, formatting) moved to usage.ts (61 -> 293); picker fallbacks to image-model-picker.ts; new screen-scoped settings.ts (231) - password validation, the six-toggle confirmation copy table, notification-permission copy map (incl. the Chromium prior-deny gotcha), About-button cascade. 82 tests across the touched files.
  • Three named return-shape types (MemoriesBodySurface, UsageBucket, CurrencyTotal) carry notes explaining why they're exported w/ no named importer - QA flagged them as borderline-dead; knip counts return-type positions as live.

Notes:

  • no component splits, deliberately: Memories' sections tangle w/ cross-row guards and the librarian singleton; Settings' pane state lives at modal level and survives tab switches - conditionally-mounted pane components would reset it (a behavior change). Rationale in the commit messages.
  • QA exercised boot + Memories + Settings + Usage panel w/ zero console errors; gate green (1,760 tests, svelte-check, lint, build, knip)

Generated by Claude Code

claude added 3 commits July 3, 2026 21:12
The Memories panel carried its display decisions inline in the
.svelte file - the body-surface precedence cascade, the per-card
action-status vocabulary and captions, edit/delete/relation form
validation, the duplicate-edge error sniff, the relative-time and
confidence formatters, the empty-state copy, and the librarian
strip's headings and step glyphs. Per the frontend-organization
convention (and following the BiasProfile pattern-setter), those
are UI-behavior primitives a port to another framework would carry
across unchanged, so they now live in a new src/lib/ui/memories.ts
companion (with the strip copy joining the existing
memory-librarian.ts module, and the picker debounce reusing
memories-list.ts's SEARCH_DEBOUNCE_MS). The screen keeps only
Svelte wire-up: runes, fetch orchestration, timers, and markup
that picks values the primitives decide. Zero behavior change -
same rendered output, interactions, and styles.

Every extracted primitive gains plain-vitest coverage
(tests/memories.test.ts, extensions to
tests/memory-librarian-ui.test.ts), and docs/dev/memory.md's file
inventory now names the new module.
The Settings modal carried its display decisions inline in the
.svelte file - the Usage pane's bucket fan-out, per-currency totals,
formatters, pill tooltips, and bar scaling; the Security pane's
password-form validation; the auto-apply toggles' confirmation copy;
the notification-permission reconciliation; the config-export
filename; and the About pane's build-time formatter and action
label. Per the frontend-organization convention (following the
BiasProfile and Memories pattern-setters), those are UI-behavior
primitives a port to another framework would carry across unchanged,
so they now live with their feature companions: the usage display
math joins relativeHue in src/lib/ui/usage.ts, the image-picker
label and override rules join src/lib/ui/image-model-picker.ts, and
the genuinely screen-level decisions land in a new
src/lib/ui/settings.ts. The screen keeps only Svelte wire-up: runes,
persist orchestration, drag/touch gestures, and markup that picks
values the primitives decide. Zero behavior change - same rendered
output, interactions, and styles.

Every extracted primitive gains plain-vitest coverage
(tests/settings.test.ts, extensions to tests/usage-hue.test.ts and
tests/image-model-picker.test.ts), and docs/dev/settings.md's file
inventory now names the new module. No components were split out:
every pane's local state (draft lists, custom usage ranges, form
fields) lives at the modal level so it survives tab switches;
conditionally mounting a pane component would reset that state on
every tab change.
QA flagged MemoriesBodySurface, UsageBucket, and CurrencyTotal as
borderline-dead exports - each is the named return shape of an
exported function with no consumer importing the name. Knip counts
the return-type position as a live use and the repo treats a
review false positive as missing documentation, so each type now
carries the one-line note that prevents the next audit from
re-flagging it.
@sysread sysread merged commit 9109cb8 into main Jul 3, 2026
1 check passed
@sysread sysread deleted the claude/so-tech-debt-audit-8zr2gf branch July 3, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants