From 1bde3fc618ed0dadcfbe6168a5ae56d04b56d026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Mon, 2 Nov 2026 21:22:16 +0100 Subject: [PATCH] chore: drop exports nothing imports knip 6.44 follows the members a dynamic import reads, and the Insights page reads two of the derived barrel's: the barrel now exports those two, whose building blocks are imported from their own modules. BAND_VAR had no reader, and the drawer re-exported useResettableValue for a test that only imports nextResettableValue. The size and version-stamp baselines take the lower numbers. --- .../baselines/source-function-lines.json | 10 ++--- .../baselines/version-stamp-comments.json | 7 ++-- .../insights/coach-panel/coach-drawer.tsx | 11 ++--- .../insights/derived/band-tokens.ts | 14 ------- src/components/insights/derived/index.ts | 41 ++----------------- 5 files changed, 14 insertions(+), 69 deletions(-) diff --git a/src/__tests__/baselines/source-function-lines.json b/src/__tests__/baselines/source-function-lines.json index a9e9c0346..e4bb6649d 100644 --- a/src/__tests__/baselines/source-function-lines.json +++ b/src/__tests__/baselines/source-function-lines.json @@ -1,7 +1,7 @@ { "$comment": "Production functions over 200 lines, keyed \"file :: name\", and their length. Maintained by src/__tests__/source-size-ratchet.test.ts.", "count": 345, - "total": 111929, + "total": 111918, "entries": { "app/achievements/page.tsx :: AchievementsPage": 206, "app/api/admin/backups/upload/route.ts :: apiHandler(arg)": 275, @@ -45,7 +45,7 @@ "app/coach/plans/page.tsx :: CoachPlansBody": 216, "app/insights/catalog/page.tsx :: MetricCatalogPage": 204, "app/insights/medications/page.tsx :: InsightsMedikamentePage": 265, - "app/insights/page-client.tsx :: InsightsPageClient": 376, + "app/insights/page-client.tsx :: InsightsPageClient": 375, "app/labs/page.tsx :: LabsPage": 228, "app/medications/page-client.tsx :: MedicationsPageClient": 590, "app/notifications/page.tsx :: NotificationsPage": 327, @@ -93,7 +93,7 @@ "components/documents/document-card.tsx :: DocumentCard": 354, "components/documents/document-detail-sheet.tsx :: DocumentDetailSheet": 325, "components/documents/document-facts-review.tsx :: DocumentFactsSection": 242, - "components/documents/document-facts-review.tsx :: FactRow": 262, + "components/documents/document-facts-review.tsx :: FactRow": 261, "components/documents/document-filter-bar.tsx :: DocumentFilterBar": 348, "components/documents/document-record-links.tsx :: DocumentRecordLinks": 202, "components/documents/document-timeline.tsx :: DocumentTimeline": 314, @@ -139,7 +139,7 @@ "components/labs/lab-history-list.tsx :: LabHistoryList": 534, "components/labs/lab-list.tsx :: LabList": 308, "components/labs/ocr-review-dialog.tsx :: OcrReviewDialog": 359, - "components/labs/ocr-row-editor.tsx :: OcrRowEditor": 393, + "components/labs/ocr-row-editor.tsx :: OcrRowEditor": 386, "components/layout/auth-shell.tsx :: AuthShell": 518, "components/layout/bottom-nav.tsx :: BottomNav": 262, "components/layout/capture-picker.tsx :: CapturePicker": 235, @@ -205,7 +205,7 @@ "components/settings/import-panel/csv-import-card.tsx :: CsvImportCard": 212, "components/settings/import-panel/dose-history-import-card.tsx :: DoseHistoryImportCard": 225, "components/settings/import-panel/health-connect-import-card.tsx :: HealthConnectImportCard": 293, - "components/settings/import-panel/record-csv-import-card.tsx :: RecordCsvImportSheet": 460, + "components/settings/import-panel/record-csv-import-card.tsx :: RecordCsvImportSheet": 458, "components/settings/insights-pill-order-section.tsx :: InsightsPillOrderSection": 255, "components/settings/integrations/connections-panel.tsx :: ConnectionsPanel": 230, "components/settings/integrations/document-sources-card.tsx :: SourceForm": 306, diff --git a/src/__tests__/baselines/version-stamp-comments.json b/src/__tests__/baselines/version-stamp-comments.json index 5b300a524..69c0ee030 100644 --- a/src/__tests__/baselines/version-stamp-comments.json +++ b/src/__tests__/baselines/version-stamp-comments.json @@ -1,7 +1,7 @@ { "$comment": "Comment lines that open with a release version, per file under src/. Maintained by src/__tests__/version-stamp-ratchet.test.ts.", - "count": 2895, - "total": 9225, + "count": 2894, + "total": 9223, "entries": { "__tests__/account-payload-consumer-guard.test.ts": 2, "__tests__/acting-account-boundary-guard.test.ts": 7, @@ -917,7 +917,7 @@ "components/insights/coach-panel/chat-bubble.tsx": 25, "components/insights/coach-panel/coach-conversation.tsx": 40, "components/insights/coach-panel/coach-drawer-body.tsx": 6, - "components/insights/coach-panel/coach-drawer.tsx": 14, + "components/insights/coach-panel/coach-drawer.tsx": 13, "components/insights/coach-panel/coach-hero.tsx": 2, "components/insights/coach-panel/coach-input.tsx": 12, "components/insights/coach-panel/coach-model-picker.tsx": 1, @@ -958,7 +958,6 @@ "components/insights/derived/coach-read-strip.tsx": 2, "components/insights/derived/composite-score-anatomy.tsx": 6, "components/insights/derived/coverage-meter.tsx": 1, - "components/insights/derived/index.ts": 1, "components/insights/derived/provenance-explainer.tsx": 2, "components/insights/derived/ring-hues.ts": 2, "components/insights/derived/score-anatomy-view.tsx": 3, diff --git a/src/components/insights/coach-panel/coach-drawer.tsx b/src/components/insights/coach-panel/coach-drawer.tsx index 0cb3e4327..d04bc39eb 100644 --- a/src/components/insights/coach-panel/coach-drawer.tsx +++ b/src/components/insights/coach-panel/coach-drawer.tsx @@ -22,14 +22,9 @@ import { useIsMobile } from "@/hooks/use-is-mobile"; import { CoachConversation } from "./coach-conversation"; -// v1.12.0 — `useResettableValue` + `nextResettableValue` moved into -// `./use-resettable-value` so the shared `` surface -// can seed its composer without importing the drawer shell. Re-exported -// here for the existing prefill-controller unit test import path. -export { - useResettableValue, - nextResettableValue, -} from "./use-resettable-value"; +// `nextResettableValue` lives in `./use-resettable-value` beside its hook; +// it is re-exported here for the prefill-controller unit test's import path. +export { nextResettableValue } from "./use-resettable-value"; /** * v1.28.52 (Documents R3) — the full-page target the maximize control hands diff --git a/src/components/insights/derived/band-tokens.ts b/src/components/insights/derived/band-tokens.ts index e53e8841c..4ad059b2d 100644 --- a/src/components/insights/derived/band-tokens.ts +++ b/src/components/insights/derived/band-tokens.ts @@ -43,20 +43,6 @@ export const BAND_BORDER_CLASS: Record = { red: "border-destructive/40", }; -/** - * The raw CSS variable per band — used where a Recharts `fill` needs an - * actual colour string rather than a Tailwind class (the score ring's - * ``). Reads the semantic tokens so dark and Alucard light - * modes track the AA-safe light overrides automatically (the - * `--dracula-*` primitives carry no light override and would fail AA on - * the white card). - */ -export const BAND_VAR: Record = { - green: "var(--success)", - yellow: "var(--warning)", - red: "var(--destructive)", -}; - /** * Map a 0..100 score to its band. Mirrors the thresholds the existing * health-score blend uses (≥ 70 green, ≥ 40 yellow, else red) so a diff --git a/src/components/insights/derived/index.ts b/src/components/insights/derived/index.ts index 9fe957b53..4a955b4c8 100644 --- a/src/components/insights/derived/index.ts +++ b/src/components/insights/derived/index.ts @@ -1,43 +1,8 @@ /** - * v1.10.0 — the derived-metrics design-system primitives barrel. - * - * Four reusable, presentational components that extend the existing token + - * sentiment vocabulary; none introduce a new colour system. Reused across - * the dashboard, Insights pages, the Coach / briefing and the doctor/FHIR - * report. See `.planning/v1.10-build/design-sota-and-direction.md`. + * The derived-metrics surfaces the Insights page loads on demand. Their + * building blocks (score ring, coverage meter, band tokens and the rest) are + * imported from their own modules by whatever uses them. */ -export { ScoreRing, type ScoreRingProps } from "./score-ring"; -export { CoverageMeter, type CoverageMeterProps } from "./coverage-meter"; -export { - SparklineDeltaTile, - type SparklineDeltaTileProps, -} from "./sparkline-delta-tile"; -export { - ProvenanceExplainer, - type ProvenanceExplainerProps, - type ProvenanceStandard, -} from "./provenance-explainer"; -export { - ScoreAnatomyView, - type ScoreAnatomyViewProps, - type AnatomyContributor, -} from "./score-anatomy-view"; -export { - bandForScore, - clampScore, - BAND_NUMBER_CLASS, - BAND_PROGRESS_CLASS, - BAND_BORDER_CLASS, - BAND_VAR, - type ScoreBand, -} from "./band-tokens"; - -// ── W2b vitals dashboard surface + query hook ──────────────────────── export { VitalsDashboard } from "./vitals-dashboard"; export { WellnessScores } from "./wellness-scores"; -export { - useDerivedMetric, - type DerivedMetricResponse, - type UseDerivedMetricOptions, -} from "./use-derived-metric";