mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-15 23:12:04 +00:00
chore: voice + filename hygiene + wave-4 state wrap
Maintainer-voice sweep across `src/`. ~190 references to the maintainer by first name in code comments and JSDoc neutralised to "the maintainer", "the live tenant", "users", or "the user" depending on context. Three sed passes covering ~50 distinct patterns (`Marc reported`, `Marc wants`, `Marc kept`, `Marc rolled back`, etc.). Test fixtures (`displayName: "Marc B."`, `username: "marc"`, `<HeroStrip userName="Marc">`) kept as opaque test data per the brief. CHANGELOG normalisation. The v1.4.14 + v1.4.15 entries paired a German bullet with its English translation by historical design — the in-app copy is English-default and the user docs are English, so the mixed-language style was a holdover from the early-marathon notes. A one-off node script extracted the `_..._` English paragraph from each bilingual bullet and rewrote the entry as that text. ~44 bullets reduced; one Docs bullet that lost a leading word in the regex fixed by hand. CLAUDE.md → CONTRIBUTING-AI.md rename so the filename is no longer AI-vendor-specific. `CONTRIBUTING.md` reference updated. `AGENTS.md` stays in place for multi-agent compatibility (the conventions doc is shared with Codex / Cursor / etc.). Wave-4 state wrap. STATE.md now records C1–C5 + D + D2 as complete; v1421-backlog.md grew a "Closed in v1.4.22" header listing the 20 items the marathon landed; `.planning/phase-W4-report.md` documents the per-commit decisions, test deltas, and the 23 items deferred to v1.4.23 with reasoning. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
1499e6f83c
commit
363e73cbf2
76 files changed
+1050
-575
No files matched your search
@@ -8,7 +8,7 @@ import { join } from "node:path";
|
||||
*
|
||||
* 1. The dashboard page does NOT mount `<CompareToggle />`. The
|
||||
* comparison-baseline switch belongs on `/insights` only — the
|
||||
* dashboard tile-strip is too tight for it (Marc 2026-05-10).
|
||||
* dashboard tile-strip is too tight for it (maintainer probe 2026-05-10).
|
||||
* The underlying `compareBaseline` value is still consumed by
|
||||
* every dashboard chart; only the on-surface affordance is gone.
|
||||
* 2. The `/insights` page renders exactly ONE page-level refresh
|
||||
@@ -22,7 +22,7 @@ import { join } from "node:path";
|
||||
* 4. The `/insights` page does NOT pass the `aiOverviewTitle`
|
||||
* ("Persönlicher Berater") subtitle into `<InsightAdvisorCard>`.
|
||||
* The CardTitle ("KI-Gesundheitsanalyse") is sufficient framing;
|
||||
* the second subtitle was an empty-section placeholder Marc
|
||||
* the second subtitle was an empty-section placeholder the maintainer
|
||||
* called "Titel da aber NICHTS PASSIERT".
|
||||
* 5. The `stripChartTokens()` matcher catches lowercase + mixed-
|
||||
* case AI-emitted tokens (`metric:blood_pressure_sweet_spot`),
|
||||
@@ -150,7 +150,7 @@ describe("v1.4.19 A3 — /insights polish", () => {
|
||||
});
|
||||
|
||||
describe("v1.4.19 A3 — chart-token leak hardening", () => {
|
||||
// The visible "metric: blood_pressure_sweet" leak Marc saw at the
|
||||
// The visible "metric: blood_pressure_sweet" leak the maintainer saw at the
|
||||
// bottom of /insights was a model-emitted lowercase chart token
|
||||
// that the v1.4.16 strip regex (`/metric:[A-Z_]+/g`) didn't catch
|
||||
// because the character class only matches uppercase. The widened
|
||||
|
||||
@@ -2,7 +2,7 @@ import { describe, expect, it, vi } from "vitest";
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
|
||||
/**
|
||||
* v1.4.19 phase A7 — Marc reported the `/targets` (Zielwerte) page
|
||||
* v1.4.19 phase A7 — the maintainer reported the `/targets` (Zielwerte) page
|
||||
* still surfaces English status labels even when the rest of the UI
|
||||
* renders in German: "Low / On Target / Stable / Moderate" stayed in
|
||||
* the source language. The card titles ("Weight", "Blood pressure",
|
||||
@@ -131,7 +131,7 @@ describe("/targets page — i18n status labels and titles", () => {
|
||||
|
||||
it("translates every status badge category to German", () => {
|
||||
const html = render("de");
|
||||
// Marc explicitly named these in his bug report.
|
||||
// the maintainer explicitly named these in his bug report.
|
||||
expect(html).not.toMatch(/>Low</);
|
||||
expect(html).not.toMatch(/>On target</);
|
||||
expect(html).not.toMatch(/>Stable</);
|
||||
|
||||
@@ -4,7 +4,7 @@ import { renderToStaticMarkup } from "react-dom/server";
|
||||
/**
|
||||
* v1.4.19 phase A7 — `/targets` (Zielwerte) had `space-y-8` between
|
||||
* the page header (h1 + intro) and the first card grid. At Pixel-5
|
||||
* Marc reported "relativ viel Platz" wasted between the overview
|
||||
* the maintainer reported "relativ viel Platz" wasted between the overview
|
||||
* and the first values. Tighten the rhythm to `space-y-6` (24px)
|
||||
* which matches the rest of the admin / settings pages.
|
||||
*/
|
||||
|
||||
@@ -97,7 +97,7 @@ describe("POST /api/ai/test — provider error leak guard", () => {
|
||||
// v1.4.5: credential failures map to 422 (not 502) so Cloudflare
|
||||
// doesn't replace our JSON body with its HTML error page — that
|
||||
// rewrite was the root cause of the "Unexpected token '<'…" client
|
||||
// crash Marc hit when typing a bad OpenAI key.
|
||||
// crash the maintainer hit when typing a bad OpenAI key.
|
||||
expect(response.status).toBe(422);
|
||||
expect(body.error ?? "").not.toMatch(/sk-/);
|
||||
expect(body.error ?? "").not.toMatch(/api\.openai\.com/);
|
||||
@@ -139,7 +139,7 @@ describe("POST /api/ai/test — provider error leak guard", () => {
|
||||
});
|
||||
|
||||
// v1.4 fix: the dropdown in /settings was not honoured — the test always
|
||||
// ran against the SAVED provider (Marc reported "wirft was Komisches raus").
|
||||
// ran against the SAVED provider (the maintainer reported "wirft was Komisches raus").
|
||||
// The route now accepts a JSON override body and forwards the user's
|
||||
// unsaved selection to resolveProviderForTest().
|
||||
describe("POST /api/ai/test — dropdown-aware override", () => {
|
||||
|
||||
@@ -95,7 +95,7 @@ export const POST = apiHandler(async (request: NextRequest) => {
|
||||
// rewritten by Cloudflare. 5xx from origin causes Cloudflare to swap
|
||||
// the body for its own HTML error page — `await res.json()` in the
|
||||
// browser then crashes with `Unexpected token '<', "<!DOCTYPE "`,
|
||||
// which is exactly how Marc encountered this when typing a bad
|
||||
// which is exactly how the maintainer encountered this when typing a bad
|
||||
// OpenAI key. 4xx codes pass through untouched.
|
||||
const status = err.httpStatus ?? 0;
|
||||
let outboundStatus: number;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* PUT /api/dashboard/chart-overlay-prefs — v1.4.18
|
||||
*
|
||||
* Persist a single chart's overlay-prefs (3 toggles) onto the existing
|
||||
* `User.dashboardWidgetsJson` blob. Marc rejected v1.4.16's always-on
|
||||
* `User.dashboardWidgetsJson` blob. the maintainer rejected v1.4.16's always-on
|
||||
* chart overlays (gradient fill, personal-baseline reference line,
|
||||
* target-zone shading); the new pattern is per-chart switches that the
|
||||
* user opts into independently and that persist per user.
|
||||
|
||||
@@ -27,7 +27,7 @@ import type { NextRequest } from "next/server";
|
||||
// Dashboard UI (`src/components/settings/dashboard-layout-section.tsx`
|
||||
// iterates the full layout from `DEFAULT_DASHBOARD_LAYOUT`). Missing
|
||||
// one here makes the PUT 422 silently — the toast surfaces "Layout
|
||||
// konnte nicht gespeichert werden" — and Marc's tile-toggle looks
|
||||
// konnte nicht gespeichert werden" — and the user's tile-toggle looks
|
||||
// like it does nothing because the save round-trip never completes.
|
||||
// v1.4.16 A5 root-cause: `achievements` was absent from this enum so
|
||||
// every save attempted with the achievements widget present (i.e.
|
||||
|
||||
@@ -223,7 +223,7 @@ describe("POST /api/insights/generate — provider error mapping", () => {
|
||||
});
|
||||
|
||||
// v1.4.16 A7.1: rate limit raised from 2 → 10/h, env-configurable.
|
||||
// Marc reported the previous 2/h was too aggressive when iterating on
|
||||
// the maintainer reported the previous 2/h was too aggressive when iterating on
|
||||
// settings. The 10/h ceiling is the new default; the env override lets
|
||||
// operators on a tight LLM budget dial it back without a rebuild.
|
||||
describe("POST /api/insights/generate — rate limit (v1.4.16 A7.1)", () => {
|
||||
|
||||
@@ -22,7 +22,7 @@ import { prisma } from "@/lib/db";
|
||||
* comes back asynchronously when the container is healthy / fails to
|
||||
* start. Without this surface we lose visibility once the deploy is
|
||||
* fired — exactly the gap that produced v1.4.6..v1.4.14's manual
|
||||
* verification recipe (Marc had to SSH and check digests).
|
||||
* verification recipe (the maintainer had to SSH and check digests).
|
||||
*
|
||||
* Payload shape: Coolify sends a free-form JSON object whose exact
|
||||
* fields drift between beta releases. We treat it as `Record<string,
|
||||
@@ -104,7 +104,7 @@ function hasValidSecret(request: NextRequest): boolean {
|
||||
* `src/lib/integrations/status.ts` — fan out a SYSTEM_ALERT through the
|
||||
* existing dispatcher to every user whose role is ADMIN. The dispatcher
|
||||
* silently no-ops when no Telegram channel is configured, so this is
|
||||
* safe even on a first-deploy where Marc hasn't wired the bot yet.
|
||||
* safe even on a first-deploy where the maintainer hasn't wired the bot yet.
|
||||
*/
|
||||
async function notifyAdminsOfFailure(event: NormalizedEvent): Promise<void> {
|
||||
const admins = await prisma.user.findMany({
|
||||
|
||||
+1
-1
@@ -204,7 +204,7 @@
|
||||
* bar. Used by the mobile section strips in `<AdminShell>` and
|
||||
* `<SettingsShell>` so 13 admin / 10 settings entries can swipe
|
||||
* horizontally without painting an always-on scrollbar at the top of
|
||||
* every admin/settings page (a recurring Marc complaint — most
|
||||
* every admin/settings page (a recurring maintainer complaint — most
|
||||
* recently mistaken for a `/admin/api-tokens` table scrollbar in
|
||||
* v1.4.16/17 because the strip sits right above the api-tokens card).
|
||||
*
|
||||
|
||||
+7
-7
@@ -321,7 +321,7 @@ export default function DashboardPage() {
|
||||
// v1.4.15 phase-B4 — recent unlocks dashboard surface. The card itself
|
||||
// self-handles the empty state (CTA → /achievements), so we only need
|
||||
// the layout-toggle gate here. No data-floor check (the empty card is
|
||||
// intentional — Marc wants the user to discover the feature).
|
||||
// intentional — the maintainer wants the user to discover the feature).
|
||||
const showAchievementsCard = isChartVisible("achievements");
|
||||
// v1.4.16 phase D reconcile (CRITICAL C2) — gate the dashboard
|
||||
// insights preview by the layout toggle. The component itself
|
||||
@@ -591,7 +591,7 @@ export default function DashboardPage() {
|
||||
// BP is conceptually one signal but visually two tiles (sys + dia)
|
||||
// so the user sees both numbers side by side at the same size as
|
||||
// every other tile in the strip. v1.4.3 first attempted a
|
||||
// combined tile with `secondary` values — Marc preferred two
|
||||
// combined tile with `secondary` values — the maintainer preferred two
|
||||
// distinct tiles with consistent symmetric widths.
|
||||
trendCards.push({
|
||||
id: "bp-sys",
|
||||
@@ -1083,7 +1083,7 @@ export default function DashboardPage() {
|
||||
// v1.4.15 phase-B4 — slotted at the user's chosen position via
|
||||
// the layout `order`. Default order from
|
||||
// `DEFAULT_DASHBOARD_LAYOUT` puts it last (below the chart row)
|
||||
// which matches Marc's brief "below the chart row".
|
||||
// which matches the maintainer's brief "below the chart row".
|
||||
charts.push({
|
||||
id: "achievements",
|
||||
order: widgetOrder("achievements"),
|
||||
@@ -1125,7 +1125,7 @@ export default function DashboardPage() {
|
||||
return (
|
||||
<>
|
||||
{/* v1.4: dashboard tiles are *always* a single row.
|
||||
* Marc-explicit (memory feedback_dashboard_one_row.md): a 2-row
|
||||
* maintainer-explicit (per feedback_dashboard_one_row.md): a 2-row
|
||||
* tile strip breaks the visual hierarchy and reads like an
|
||||
* Excel grid. Total width caps at the parent container —
|
||||
* exactly the chart-width below. When the active tile count
|
||||
@@ -1140,9 +1140,9 @@ export default function DashboardPage() {
|
||||
{/* v1.4.16 Fix A5: hide the strip entirely when the user
|
||||
turned off every tile. Until v1.4.15 the wrapper rendered
|
||||
an empty grid even with zero tiles — visually a thin gap
|
||||
Marc described as "awkward". Charts below still render so
|
||||
the maintainer described as "awkward". Charts below still render so
|
||||
the page is not empty; the tile-strip just goes away.
|
||||
The constraint Marc named — "immer die gesamte Spalte
|
||||
The constraint the maintainer named — "immer die gesamte Spalte
|
||||
breit und immer der gleichen Höhe" — is preserved by the
|
||||
CSS-grid `auto-fit + minmax + auto-rows-fr` track that
|
||||
continues to give every visible tile equal width / equal
|
||||
@@ -1156,7 +1156,7 @@ export default function DashboardPage() {
|
||||
// x-coordinates as the charts below because both inherit the
|
||||
// same parent container. When the row no longer fits a 9rem
|
||||
// floor, the grid wraps to a new row instead of horizontal-
|
||||
// scrolling — Marc tested both and prefers the v1.3-era
|
||||
// scrolling — the maintainer tested both and prefers the v1.3-era
|
||||
// wrap behaviour over the one-row scroll for the symmetry
|
||||
// it preserves.
|
||||
className="grid auto-rows-fr [grid-template-columns:repeat(auto-fit,minmax(9rem,1fr))] gap-3 pb-2"
|
||||
|
||||
@@ -117,7 +117,7 @@ const GLUCOSE_TYPES = new Set([
|
||||
* pulse-targets.ts + targets/route.ts inline maps); v1.4.19 phase
|
||||
* A7 wires this map so the German locale stops surfacing English
|
||||
* status pills like "Low / On Target / Stable / Moderate" — the
|
||||
* exact regression Marc reported.
|
||||
* exact regression the maintainer reported.
|
||||
*/
|
||||
const STATUS_CATEGORY_KEY: Record<string, string> = {
|
||||
// BMI
|
||||
@@ -735,7 +735,7 @@ export default function TargetsPage() {
|
||||
});
|
||||
|
||||
return (
|
||||
// v1.4.19 phase A7 — Marc reported "relativ viel Platz" wasted
|
||||
// v1.4.19 phase A7 — the maintainer reported "relativ viel Platz" wasted
|
||||
// between the overview header and the first values on `/targets`.
|
||||
// Tighten the rhythm from `space-y-8` (32 px) to `space-y-6`
|
||||
// (24 px) — that matches the admin / settings pages.
|
||||
|
||||
Reference in new issue
Block a user