mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
v1.4.16 phase B5e: fill the `data-slot="rec-feedback-slot"` reserved by B5c. The RationaleCard now mounts `<RecommendationFeedback>` when the rec carries every attribute the feedback endpoint validates — id, severity, metricSource.type, and a metricSource.timeRange that's in the four-window vocabulary (`last7days` / `last30days` / `last90days` / `allTime`). Defence-in-depth via `asFeedbackTimeRange()`: a rec with an out-of-vocabulary timeRange (e.g. `"lastFortnight"` from a future provider that drifted) leaves the slot empty rather than rendering a feedback row that would 422 on submit. Same gate handles legacy recs without an id — the slot stays empty so plain-string recs from v1.4.14/v1.4.15 cached payloads can't suddenly produce thumbs that have nothing to attribute server-side. Confidence-meter slot (B5d's territory) is untouched — that's filled by the parallel B5d worker. Tests: 3 new rec-card scenarios pin the wiring (thumbs render when fully attributed, hidden when no id, hidden on bad timeRange). Existing rec-card tests retrofit `useMutation` + `useAuth` mocks so the component's TanStack Query mutation stays inert during SSR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>