Memories and Settings screen conformance#386
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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 extendedmemory-librarian.ts. 37 new tests.usage.ts(61 -> 293); picker fallbacks toimage-model-picker.ts; new screen-scopedsettings.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.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:
Generated by Claude Code