chore: remove three components nothing renders

personal-record-badge.tsx, intake-history-editable.tsx and
intake-history-preview.tsx had no importer outside their own tests and
the preview, so they rendered nowhere while four guard tests kept them
listed as live surfaces. They go with their tests, their guard entries
and the strings only they used.

GET /api/personal-records stays: the native app reads it. The
resolved-field guard now records its benchmark band as a native-only
field instead of naming the deleted badge as its reader.
This commit is contained in:
Marc-André Bombeck committed 2026-11-11 20:03:00 +01:00
1 parent af673a63da
commit 5449933c4f
22 files changed
+14 -957

No files matched your search

@@ -153,7 +153,6 @@
"components/medications/dose-strength-curve.tsx :: DoseStrengthCurve": 266,
"components/medications/glp1-medication-card.tsx :: Glp1MedicationCard": 405,
"components/medications/injection-site-picker.tsx :: InjectionSitePicker": 287,
"components/medications/intake-history-editable.tsx :: IntakeHistoryEditable": 224,
"components/medications/intake-history-list-v2.tsx :: IntakeHistoryListV2": 403,
"components/medications/intake-import-dialog.tsx :: IntakeImportDialog": 208,
"components/medications/log-intake-dialog.tsx :: LogIntakeDialog": 267,
@@ -869,7 +869,6 @@
"components/insights/__tests__/metric-stat-strip.test.tsx": 3,
"components/insights/__tests__/metric-target-summary-unit-preference.test.tsx": 1,
"components/insights/__tests__/metric-target-summary.test.tsx": 8,
"components/insights/__tests__/personal-record-badge.test.tsx": 1,
"components/insights/__tests__/rhythm-events-card.test.tsx": 1,
"components/insights/__tests__/sleep-stage-stacked-bar.test.tsx": 5,
"components/insights/__tests__/sub-page-shell.test.tsx": 4,
@@ -1031,7 +1030,6 @@
"components/insights/nutrients/micronutrients-card.tsx": 3,
"components/insights/nutrients/types.ts": 4,
"components/insights/period-narrative-card.tsx": 1,
"components/insights/personal-record-badge.tsx": 2,
"components/insights/prose-blocks.tsx": 1,
"components/insights/recovery/recovery-metric-block.tsx": 2,
"components/insights/recovery/recovery-section.tsx": 3,
@@ -1127,7 +1125,6 @@
"components/medications/__tests__/intake-edit-dialog-seed.test.tsx": 1,
"components/medications/__tests__/intake-history-list-v2-row-actions.test.tsx": 1,
"components/medications/__tests__/intake-history-list-v2.test.tsx": 4,
"components/medications/__tests__/intake-history-preview-bulk-toolbar.test.tsx": 2,
"components/medications/__tests__/inventory-section-actions.test.tsx": 1,
"components/medications/__tests__/inventory-section-summary.test.tsx": 2,
"components/medications/__tests__/log-injection-site-dialog.test.tsx": 1,
@@ -1163,7 +1160,6 @@
"components/medications/glp1-medication-card.tsx": 36,
"components/medications/injection-site-picker.tsx": 2,
"components/medications/intake-edit-dialog.tsx": 2,
"components/medications/intake-history-editable.tsx": 2,
"components/medications/intake-history-list-v2.tsx": 13,
"components/medications/intake-import-dialog.tsx": 1,
"components/medications/log-injection-site-dialog.tsx": 2,
@@ -1200,7 +1196,6 @@
"components/medications/sections/courses-section.tsx": 1,
"components/medications/sections/data-portability-row.tsx": 1,
"components/medications/sections/destructive-zone-section.tsx": 5,
"components/medications/sections/intake-history-preview.tsx": 3,
"components/medications/sections/intake-tracking-section.tsx": 1,
"components/medications/sections/inventory-dialogs.tsx": 3,
"components/medications/sections/inventory-section.tsx": 8,
@@ -234,7 +234,6 @@ describe("daily-reads refetch guard", () => {
const routedThroughHelper = [
"components/medications/take-all-due.ts",
"components/medications/intake-edit-dialog.tsx",
"components/medications/intake-history-editable.tsx",
"components/medications/intake-import-dialog.tsx",
"components/medications/sections/destructive-zone-section.tsx",
"components/medications/use-medication-intake.ts",
@@ -528,13 +528,6 @@ const REGISTRY: DestructiveEntry[] = [
recovery: "permanent",
confirm: ["AlertDialog"],
},
{
file: "components/medications/intake-history-editable.tsx",
destroys: "one intake event, or every selected intake event",
triggers: ["components/medications/intake-history-list-v2.tsx"],
recovery: "tombstoned-no-restore",
confirm: ["AlertDialog"],
},
{
file: "components/medications/dose-history/use-dose-history-ledger.ts",
destroys: "one intake event",
-49
View File
@@ -15,7 +15,6 @@
* - insights.emptyState.* (B4 — per-metric empty states)
* - notifications.admin.* (B5 — admin notification messages)
* - notifications.user.* (B5 — user-facing Telegram test body)
* - personalRecords + workouts (BL-P4-8 — PR + Workout strings)
*/
import { readFileSync, readdirSync } from "node:fs";
import { join } from "node:path";
@@ -46,18 +45,6 @@ for (const locale of LOCALES) {
FLAT_BY_LOCALE.set(locale, flat);
}
function keysForPrefix(prefix: string): Set<string> {
// Source of truth: EN. The locale-integrity test ensures every
// locale carries the same key shape, so EN's view is canonical.
const enFlat = FLAT_BY_LOCALE.get("en");
if (!enFlat) throw new Error("EN bundle did not load");
const set = new Set<string>();
for (const k of enFlat.keys()) {
if (k === prefix || k.startsWith(`${prefix}.`)) set.add(k);
}
return set;
}
const REQUIRED_KEY_SETS: Array<{
label: string;
required: string[];
@@ -143,39 +130,3 @@ describe("v1.4.27 B6 i18n drift-guard — required keys present in every locale"
});
}
});
describe("v1.4.27 B6 i18n drift-guard — PR + Workout strings stay in lockstep", () => {
// BL-P4-8: PR and Workout strings were the trigger for the
// drift-guard ask. Personal-record badge / tooltip live under
// `insights.personalRecord.*`. Workout strings are not yet in the
// bundles — the v1.4.23 batch ingest landed the API, the UI
// surface ships in v1.4.28 / v1.5. The drift-guard keeps the
// namespace anchor live so the workout copy work in v1.4.28 lands
// with parity from the first commit.
const prKeys = [...keysForPrefix("insights.personalRecord")];
it("insights.personalRecord namespace has at least one key (sanity)", () => {
expect(
prKeys.length,
"insights.personalRecord.* keys exist in en.json",
).toBeGreaterThan(0);
});
it.each(LOCALES)(
"messages/%s.json carries every insights.personalRecord.* key with a non-empty value",
(locale) => {
const flat = FLAT_BY_LOCALE.get(locale)!;
const missing: string[] = [];
const empty: string[] = [];
for (const key of prKeys) {
const v = flat.get(key);
if (v === undefined) missing.push(key);
else if (v.trim() === "") empty.push(key);
}
expect(
{ missing, empty },
`Locale ${locale} drifted from the personal-record key set.`,
).toEqual({ missing: [], empty: [] });
},
);
});
@@ -444,12 +444,10 @@ const V143_FIELDS: ResolvedFieldEntry[] = [
{
field: "GET /api/personal-records benchmark",
props: ["awards.ts#benchmark"],
readers: [
{
file: "src/components/insights/personal-record-badge.tsx",
pattern: /fresh\.benchmark/,
},
],
iosOnly: {
reason:
"the band was added for the native records screen (ios #116 item 5); no web surface reads `/api/personal-records` since the never-mounted badge that did was deleted",
},
},
{
field: "GET /api/mood/insights patterns",
@@ -284,9 +284,6 @@ const PINNED_AFFORDANCES: Record<
"toast.success": 4,
},
"src/components/medications/intake-edit-dialog.tsx": { "toast.success": 1 },
"src/components/medications/intake-history-editable.tsx": {
"toast.success": 2,
},
"src/components/medications/intake-history-list-v2.tsx": {
"text-success": 1,
},