diff --git a/frontend/src/lib/components/Badge.svelte b/frontend/src/lib/components/Badge.svelte deleted file mode 100644 index ef989507..00000000 --- a/frontend/src/lib/components/Badge.svelte +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - diff --git a/frontend/src/lib/components/Button.svelte b/frontend/src/lib/components/Button.svelte deleted file mode 100644 index 256cfff3..00000000 --- a/frontend/src/lib/components/Button.svelte +++ /dev/null @@ -1,106 +0,0 @@ - - -{#if href && !disabled} - - - -{:else} - -{/if} - - diff --git a/frontend/src/lib/components/Card.svelte b/frontend/src/lib/components/Card.svelte deleted file mode 100644 index e5651218..00000000 --- a/frontend/src/lib/components/Card.svelte +++ /dev/null @@ -1,59 +0,0 @@ - - -
- -
- - diff --git a/frontend/src/lib/components/ChipGroup.svelte b/frontend/src/lib/components/ChipGroup.svelte deleted file mode 100644 index 79073123..00000000 --- a/frontend/src/lib/components/ChipGroup.svelte +++ /dev/null @@ -1,95 +0,0 @@ - - -
- {#if label} - {label} - {/if} -
- {#each items as item (item.id)} - - {/each} -
-
- - diff --git a/frontend/src/lib/components/CompanionRail.svelte b/frontend/src/lib/components/CompanionRail.svelte index 36c799b7..3ac37256 100644 --- a/frontend/src/lib/components/CompanionRail.svelte +++ b/frontend/src/lib/components/CompanionRail.svelte @@ -1,9 +1,3 @@ - - - - diff --git a/frontend/src/lib/components/Counter.svelte b/frontend/src/lib/components/Counter.svelte deleted file mode 100644 index 45332b97..00000000 --- a/frontend/src/lib/components/Counter.svelte +++ /dev/null @@ -1,130 +0,0 @@ - - -
-
- - {label} -
-
- - - {value} - - -
-
- - diff --git a/frontend/src/lib/components/CustomItemModal.svelte b/frontend/src/lib/components/CustomItemModal.svelte index 4c73cb2e..4dc2f3ec 100644 --- a/frontend/src/lib/components/CustomItemModal.svelte +++ b/frontend/src/lib/components/CustomItemModal.svelte @@ -258,7 +258,7 @@ {/if} {#if errorKey} -

{$t(errorKey)} diff --git a/frontend/src/lib/components/EmptyState.svelte b/frontend/src/lib/components/EmptyState.svelte deleted file mode 100644 index e38ac097..00000000 --- a/frontend/src/lib/components/EmptyState.svelte +++ /dev/null @@ -1,32 +0,0 @@ - - -

- -

{message}

- {#if cta} - - {/if} -
- - diff --git a/frontend/src/lib/components/EntryComposer.svelte b/frontend/src/lib/components/EntryComposer.svelte index fe31e1a5..29c667f5 100644 --- a/frontend/src/lib/components/EntryComposer.svelte +++ b/frontend/src/lib/components/EntryComposer.svelte @@ -3,12 +3,6 @@ so every date change is a fresh instance (auto-cancels in-flight save timers, resets form state). Reserved density="quick" for PI v13 FAB quick-add consolidation. --> - - -{#if open} -
- -
- {#if title}

{title}

{/if} - -
- {#if onDismiss} - - {/if} -
-{/if} diff --git a/frontend/src/lib/components/Input.svelte b/frontend/src/lib/components/Input.svelte deleted file mode 100644 index 93d0a9a9..00000000 --- a/frontend/src/lib/components/Input.svelte +++ /dev/null @@ -1,103 +0,0 @@ - - -
- {#if label} - - {/if} - {#if type === 'password'} - - - {:else if type === 'email'} - - {:else} - - {/if} - {#if error} - - {/if} -
- - diff --git a/frontend/src/lib/components/README.md b/frontend/src/lib/components/README.md index 6f494bdc..f4671784 100644 --- a/frontend/src/lib/components/README.md +++ b/frontend/src/lib/components/README.md @@ -21,8 +21,8 @@ not at review. 3. **Use the route-shell registry to add routes** (`routeShells.ts`). Do not add a new if/else branch to `+layout.svelte` — add a registry entry. `routeShells.test.ts` enforces structure. -4. **Use interaction primitives** — `ConfirmDelete`, `Modal`, - `HelpHint`, `Toast`. Inline re-inventions are caught by +4. **Use interaction primitives** — `Modal`, `BottomSheet`, + `Toast`. Inline re-inventions are caught by `primitives.test.ts`. Opt out with a `` comment + a reason. 5. **Add i18n keys to all 4 locales** (`de`, `en`, `fr`, `it`). @@ -618,7 +618,7 @@ each surface is also visibly cohort-aware when empty. `onDateChange`, `onJumpToToday`. Owns auto-save (3s debounce), section-jump nav, mobile IntersectionObserver, multi-entry vitals JSON round-trip, copy-previous-day, delete-confirm - banner (primitive-exempt — see ConfirmDelete entry below), + banner, keyboard shortcuts (Ctrl+S, arrow keys for date nav), CIPH-302 incomplete-CTA, CIPH-713 private toggle. Route wraps in `{#key date}` for fresh-instance-per-date semantics. @@ -645,9 +645,8 @@ each surface is also visibly cohort-aware when empty. `password` and `text` for the current session only — visibility is never persisted to localStorage (security). Used wherever a passphrase is entered: `LoginForm`, `SignupFlow` (×2), the - recovery flow on `/login`, the password change in Settings, and - the (unwired) generic `Input.svelte` delegates to it for - `type="password"`. Audit guard in + recovery flow on `/login`, and the password change in + Settings. Audit guard in `PasswordField.test.ts` asserts no other `.svelte` renders a bare ``. - **SignupFlow.svelte** — multi-step signup (username → @@ -686,15 +685,6 @@ each surface is also visibly cohort-aware when empty. axes, no legend, no library — by design. Used by the admin dashboard's sparkline-first metric layout (migration counter, active users, document totals). -- **ConfirmDelete.svelte** (CIPH-834) — the red "Yes delete" + - "Cancel" button pair shown next to a just-tapped delete icon - on an entry card. **No call site imports it today**: the - calendar dropped it with the switch to `DayDetail` (CIPH-910), - and the journal moment-modal, `CompanionRail` (40px pair) and - `EntryComposer` (full-width banner) keep their inline markup - under a `` comment. - It remains the primitive `primitives.test.ts` points new - yes-delete/cancel rows at. - **Modal.svelte** (CIPH-834) — centred dialog over a translucent backdrop. Esc + backdrop click close when `dismissable`. Used for the `/migrate` post-import tour, the @@ -720,11 +710,6 @@ each surface is also visibly cohort-aware when empty. Contract test: `CustomItemModal.test.ts`. Used in `routes/settings/+page.svelte` (tracking tab), the `/setup` wizard and `EntryComposer`. -- **HelpHint.svelte** (CIPH-834) — dismissable inline info - banner (NOT modal). Visually distinct from Toast (Toast is - transient + floating, HelpHint is persistent + inline). - Stateless: callers own the "already seen?" persistence. - Currently defined; not yet wired at any site. - **Tabs.svelte** (CIPH-857) — ARIA tab pattern with roving tabindex + Left/Right/Home/End keyboard nav. Parent owns the URL (passes `current` + `onSelect`). Used on @@ -748,55 +733,24 @@ each surface is also visibly cohort-aware when empty. site is `ExportPeriodPopover` (below 640px); otherwise a Modal-primitive candidate for CIPH-834. -### Primitives defined but not yet wired - -These exist as scaffolding from earlier PIs but no route -currently imports them. Do not add new use sites without also -updating this README and migrating at least one call site as -part of the same change. A future PI will sweep or retire -each. - -- **Badge.svelte** — would replace inline `.badge` + `.badge-*` - usage. Currently every call site uses the CSS class directly. -- **Button.svelte** — would replace inline `btn-primary` / - `btn-secondary` usage. Call sites use the CSS class directly - (only the equally unwired `EmptyState.svelte` imports it). -- **Card.svelte** — would wrap `.card-*` variants. Call sites - use the CSS classes directly (see "Card CSS variants" below). -- **Input.svelte** — would wrap labelled form inputs (delegates - `type="password"` to `PasswordField`). -- **ChipGroup.svelte** — symptom / preset chip selector. Not - currently used; chips are rendered inline in `/log/today`. -- **Counter.svelte** — stepper for episode counts. Not - currently used; `/log/today` renders inline. -- **StatCard.svelte** — the "big number + label" stat tile. - Reports page renders this pattern inline. -- **EmptyState.svelte** — "nothing here yet" panel with CTA. - Used candidate for CIPH-834. Pages currently inline this. -- **SectionDivider.svelte** — asterisk-centred rule. Companion - renders the pattern inline. -- **Skeleton.svelte** — shimmer loading placeholder. Not used; - loading states currently use the `Asterisk mode="loading"` - pattern instead. - ### Interaction primitives — CIPH-834 status -CIPH-834 extracted three primitives. The heuristic test +CIPH-834 extracted three primitives; `ConfirmDelete` and +`HelpHint` were never adopted and were removed on 2026-11-12, +along with ten other never-used scaffolding components (Badge, +Button, Card, ChipGroup, Counter, EmptyState, Input, +SectionDivider, Skeleton, StatCard). The heuristic test [`primitives.test.ts`](./primitives.test.ts) fails if a new inline duplicate appears without either adopting the primitive or declaring an exemption comment. | Primitive | Canonical sites | Exempt sites (with reason) | | --- | --- | --- | -| `ConfirmDelete` | *(none currently)* | `CompanionRail.svelte` (40px compact variant), `EntryComposer.svelte` (full-width banner variant), `routes/journal/+page.svelte` (moment-modal confirm row) | | `Modal` | `routes/migrate/+page.svelte` (post-import tour), `routes/journal/+page.svelte`, `EntryComposer`, `CustomItemModal`, `ExportNoteReview`, the medication dialogs | `routes/settings/+page.svelte` + `routes/admin/+page.svelte` (bespoke danger-chrome dialogs), `routes/calendar/+page.svelte` (right-side day-detail), `routes/+layout.svelte` (quick-add sheet), `BottomSheet.svelte` (it **is** the other modal primitive — mobile bottom sheet) | -| `HelpHint` | *(none yet wired)* | *(n/a)* | Opt-out: add `` to the top of the file. The heuristic is a soft fence: it -catches drift, it does not enforce style. `EmptyState.svelte` -remains un-swept; adoption is deferred to a future PI because -every "nothing here yet" site has bespoke iconography. +catches drift, it does not enforce style. ## Shared math / helper modules @@ -831,7 +785,7 @@ review, not at runtime. ## Card CSS variants Defined in `app.css` (`@layer components`). Used directly as -CSS classes, not via `Card.svelte`. All 7 variants are in use; +CSS classes. All 7 variants are in use; none pruned. (`.card-rhythmic` / `.card-rhythmic-stack` beside them are opt-in padding/gap helpers, not variants.) @@ -912,8 +866,8 @@ When adding a new route: 2. Use only tokens from Spacing / Typography / Color sections. 3. Need a new component? Check the Component inventory first — there is probably already a primitive that covers it. -4. Adding a confirm-delete pattern or a centred dialog? Use - `` / `` / ``. If your variant +4. Adding a centred dialog? Use `` (or `` + on mobile). If your variant genuinely does not fit, declare `` so the heuristic test stays green and the next visual pass knows why you opted out. diff --git a/frontend/src/lib/components/SectionDivider.svelte b/frontend/src/lib/components/SectionDivider.svelte deleted file mode 100644 index 846e6dab..00000000 --- a/frontend/src/lib/components/SectionDivider.svelte +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/frontend/src/lib/components/Skeleton.svelte b/frontend/src/lib/components/Skeleton.svelte deleted file mode 100644 index f7beb0f0..00000000 --- a/frontend/src/lib/components/Skeleton.svelte +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/frontend/src/lib/components/StatCard.svelte b/frontend/src/lib/components/StatCard.svelte deleted file mode 100644 index f71c2ffc..00000000 --- a/frontend/src/lib/components/StatCard.svelte +++ /dev/null @@ -1,45 +0,0 @@ - - -
- {value} - {label} -
- - diff --git a/frontend/src/lib/components/primitives.test.ts b/frontend/src/lib/components/primitives.test.ts index 441769fe..ae9bbbc9 100644 --- a/frontend/src/lib/components/primitives.test.ts +++ b/frontend/src/lib/components/primitives.test.ts @@ -2,8 +2,9 @@ * CIPH-834 — interaction primitives heuristic scan. * * This test is a soft fence, not a ban. It scans `.svelte` files for - * duplicated inline patterns that the new primitives - * (`ConfirmDelete`, `Modal`) were extracted to cover. When it flags + * duplicated inline patterns that the `Modal` primitive was + * extracted to cover. (A `ConfirmDelete` primitive existed too; no + * site ever adopted it and it was removed on 2026-11-12.) When it flags * a site, the author has three options: * * 1. Replace the inline pattern with the primitive (preferred). @@ -68,39 +69,6 @@ function usesPrimitive(src: string, primitive: string): boolean { describe('CIPH-834 — interaction primitive adoption', () => { const files = walkSvelte(SRC_ROOT); - // --- ConfirmDelete heuristic ---------------------------------- - // The inline pattern we look for: a literal `yes_delete` i18n - // key adjacent (within 400 chars) to a `cancel` key. This - // catches the red button + cancel button pair used on entry - // rows. `common.yes_delete` and `common.cancel` are both - // exclusive to this pattern — there's no other use of either - // in the codebase. If the caller is using ``, - // those literals live in the primitive, not in the caller. - it('every site rendering yes_delete + cancel inline uses (or is exempt)', () => { - const offenders: string[] = []; - for (const f of files) { - // Skip the primitive's own source and this test file. - if (f.endsWith('ConfirmDelete.svelte')) continue; - const src = readFileSync(f, 'utf8'); - if (!src.includes('yes_delete')) continue; - // Look for the pair: yes_delete … cancel within a short window. - const idx = src.indexOf('yes_delete'); - const window = src.slice(Math.max(0, idx - 400), idx + 400); - if (!/\bcancel\b/.test(window)) continue; - // This file references the pattern. Does it use the primitive, - // or claim exemption? - if (usesPrimitive(src, 'ConfirmDelete')) continue; - if (isExempt(src, 'ConfirmDelete')) continue; - offenders.push(relative(REPO_ROOT, f)); - } - expect( - offenders, - `Files render an inline yes-delete/cancel pair but neither import ` + - ` nor declare a comment:\n ` + - offenders.join('\n '), - ).toEqual([]); - }); - // --- Modal heuristic ------------------------------------------ // A Modal-shaped div has both `fixed inset-0` AND `aria-modal`. // Bottom sheets, toasts, install banners do not — they use diff --git a/frontend/src/lib/i18n/de.ts b/frontend/src/lib/i18n/de.ts index d9ee18c6..9ddd50a4 100644 --- a/frontend/src/lib/i18n/de.ts +++ b/frontend/src/lib/i18n/de.ts @@ -64,8 +64,6 @@ export default { 'common.date_placeholder_slash': 'TT/MM/JJJJ', 'common.date_placeholder_iso': 'JJJJ-MM-TT', 'common.date_placeholder_us': 'MM/TT/JJJJ', - 'common.decrease_label': '{label} verringern', - 'common.increase_label': '{label} erhöhen', 'common.loading': 'Laden...', 'common.copy': 'Kopieren', 'common.copied': 'Kopiert', diff --git a/frontend/src/lib/i18n/en.ts b/frontend/src/lib/i18n/en.ts index 85a23d5c..8a753879 100644 --- a/frontend/src/lib/i18n/en.ts +++ b/frontend/src/lib/i18n/en.ts @@ -60,8 +60,6 @@ export default { 'common.date_placeholder_slash': 'DD/MM/YYYY', 'common.date_placeholder_iso': 'YYYY-MM-DD', 'common.date_placeholder_us': 'MM/DD/YYYY', - 'common.decrease_label': 'Decrease {label}', - 'common.increase_label': 'Increase {label}', 'common.loading': 'Loading...', 'common.copy': 'Copy', 'common.copied': 'Copied', diff --git a/frontend/src/lib/i18n/fr.ts b/frontend/src/lib/i18n/fr.ts index a4ccc4fa..5a216ece 100644 --- a/frontend/src/lib/i18n/fr.ts +++ b/frontend/src/lib/i18n/fr.ts @@ -60,8 +60,6 @@ export default { 'common.date_placeholder_slash': 'JJ/MM/AAAA', 'common.date_placeholder_iso': 'AAAA-MM-JJ', 'common.date_placeholder_us': 'MM/JJ/AAAA', - 'common.decrease_label': 'Diminuer {label}', - 'common.increase_label': 'Augmenter {label}', 'common.loading': 'Chargement...', 'common.copy': 'Copier', 'common.copied': 'Copié', diff --git a/frontend/src/lib/i18n/it.ts b/frontend/src/lib/i18n/it.ts index b716379e..5a6cf82e 100644 --- a/frontend/src/lib/i18n/it.ts +++ b/frontend/src/lib/i18n/it.ts @@ -60,8 +60,6 @@ export default { 'common.date_placeholder_slash': 'GG/MM/AAAA', 'common.date_placeholder_iso': 'AAAA-MM-GG', 'common.date_placeholder_us': 'MM/GG/AAAA', - 'common.decrease_label': 'Riduci {label}', - 'common.increase_label': 'Aumenta {label}', 'common.loading': 'Caricamento...', 'common.copy': 'Copia', 'common.copied': 'Copiato', diff --git a/frontend/src/lib/palette-migration.test.ts b/frontend/src/lib/palette-migration.test.ts index da9f6c7d..3054eed6 100644 --- a/frontend/src/lib/palette-migration.test.ts +++ b/frontend/src/lib/palette-migration.test.ts @@ -101,7 +101,6 @@ describe('CIPH-891 — high-leverage primitives migrated to --accent', () => { // the migration landed and didn't get reverted. const PRIMITIVE_FILES = [ 'app.css', - 'lib/components/Button.svelte', 'lib/components/BottomNav.svelte', ]; const SRC_ROOT = resolve(__dirname, '..'); diff --git a/frontend/src/routes/journal/+page.svelte b/frontend/src/routes/journal/+page.svelte index c66acf8a..4425cdd2 100644 --- a/frontend/src/routes/journal/+page.svelte +++ b/frontend/src/routes/journal/+page.svelte @@ -1,10 +1,3 @@ -