diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d4156079..55aa1b220 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +## [1.47.6] — 2026-11-15 + ### Added - **A note on a medication.** Directions such as "30 to 60 minutes before @@ -42,11 +44,35 @@ links the help page. Brave keeps push messaging off by default, so in Brave the message names the setting to turn on: "Use Google services for push messaging" under brave://settings/privacy. (Discussion #1378) -- **Illness episode onset dates keep the intended calendar day.** - Creating a new illness episode in the morning was refused because its noon - default was rejected as in the future, and onset dates could display as the - wrong calendar day in non-UTC time zones. Saving now anchors to the current - time when before local noon and preserves stored timestamps on edit. +- **Illness episodes can be added in the morning.** The form sent the + start date as noon, which before noon is still in the future, so the + save was refused. Start and end dates now also stay on the day you + picked when your time zone is far from UTC, and editing an episode + keeps the times you saved. (#1376) +- **No nightly "job still failing" alert over an AI provider that cannot + answer.** An account that still had a provider saved whose key the + provider refused (removing the key from a Local or OpenAI-compatible + provider keeps its address, so it is still called), or whose providers + HealthLog had paused after repeated errors, counted as a failed + briefing every night. On an instance with one account that read as a + broken job. A refused key of the account's own is now noted but no + longer fails the run; a refused shared server key still does. An + account whose providers are all paused is skipped, since nothing was + sent. The Background jobs card on the admin status page now lists the + same runs the alert counts, and both say in words what failed and + which provider. (#1384) +- **Switching records with HealthLog open in a second tab.** Switching + into or out of a shared record could leave both tabs on the loading + spinner, and a reload within the next half minute did not help. An + account check the switching tab had started just before the switch + could answer for the record being left and undo the switch the other + tabs were waiting for. Such an answer is now thrown away and asked + again. +- **Charts no longer jump while they load.** The placeholder of every + chart that links its days was 20 px taller than the chart it turned + into (40 px on a phone), and the mood chart's placeholder was about + 30 px shorter, so the dashboard and the metric pages shifted under you + when the charts arrived. ### Security diff --git a/docs/api/openapi.yaml b/docs/api/openapi.yaml index fbb976f6c..aede67992 100644 --- a/docs/api/openapi.yaml +++ b/docs/api/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.1.0 info: title: HealthLog API - version: 1.47.5 + version: 1.47.6 description: >- Self-hosted personal-health-tracking PWA — public API surface for the iOS native client and external ingest. diff --git a/e2e/tablet-shell.spec.ts b/e2e/tablet-shell.spec.ts index ddd77e8a7..6f67b9cbb 100644 --- a/e2e/tablet-shell.spec.ts +++ b/e2e/tablet-shell.spec.ts @@ -54,6 +54,42 @@ async function openDashboard(page: Page) { ).toBeVisible(); // The module-gated destinations join the rail once `/api/auth/me` lands. await expect(page.locator('aside nav a[href="/medications"]')).toHaveCount(1); + await expectChartRowSettled(page); +} + +/** + * The dashboard's chart row has swapped every loading shell for its chart. + * + * The charts are one lazily loaded chunk, and each cell holds a skeleton until + * it lands and the row reveals. The swap changes the row's height, so a page + * measured before it is not the page the reader ends up with: on a loaded + * runner the chunk arrived a second after the dashboard painted, after + * `scrollMainToEnd` had already seen two equal heights, and `
` was no + * longer at its end when it was measured. Waited for on the cells' own state + * rather than on time. + */ +async function expectChartRowSettled(page: Page) { + await expect + .poll( + () => + page.evaluate(() => { + const main = document.getElementById("main-content")!; + const cells = main.querySelectorAll( + '[data-slot="dashboard-chart-cell"]', + ); + const held = main.querySelectorAll( + '[data-slot="dashboard-chart-cell"]:not([data-revealed="true"])', + ); + const shells = main.querySelectorAll('[data-slot="chart-skeleton"]'); + return { + cells: cells.length > 0, + held: held.length, + shells: shells.length, + }; + }), + { timeout: 15_000 }, + ) + .toEqual({ cells: true, held: 0, shells: 0 }); } /** The shell fills the window exactly and the document has nothing to scroll. */ diff --git a/messages/de.json b/messages/de.json index 66fa04236..06ca76108 100644 --- a/messages/de.json +++ b/messages/de.json @@ -8768,7 +8768,7 @@ }, "failingJobs": { "title": "Hintergrundjobs", - "description": "Queues, deren Jobs nach allen Wiederholungen aufgegeben haben.", + "description": "Queues, deren Jobs nach allen Wiederholungen aufgaben oder deren Lauf bei jedem versuchten Konto scheiterte.", "none": "In den letzten {hours} Stunden ist kein Job fehlgeschlagen.", "unavailable": "Keine Job-Queue lesbar. Dieses Deployment läuft ohne Hintergrund-Worker.", "countOne": "{count} Fehlschlag", diff --git a/messages/en.json b/messages/en.json index 765ba808b..de6c5d6a6 100644 --- a/messages/en.json +++ b/messages/en.json @@ -8768,7 +8768,7 @@ }, "failingJobs": { "title": "Background jobs", - "description": "Queues whose jobs gave up after exhausting their retries.", + "description": "Queues whose jobs gave up after their retries, or whose run ended with every account it tried failing.", "none": "No job has failed in the last {hours} hours.", "unavailable": "No job queue to read. This deployment runs without the background worker.", "countOne": "{count} failure", diff --git a/messages/es.json b/messages/es.json index e5f751113..41be21086 100644 --- a/messages/es.json +++ b/messages/es.json @@ -8768,7 +8768,7 @@ }, "failingJobs": { "title": "Trabajos en segundo plano", - "description": "Colas cuyos trabajos se rindieron tras agotar sus reintentos.", + "description": "Colas cuyos trabajos se rindieron tras sus reintentos o cuya ejecución falló en cada cuenta intentada.", "none": "Ningún trabajo ha fallado en las últimas {hours} horas.", "unavailable": "No hay ninguna cola que consultar: este despliegue funciona sin el worker en segundo plano.", "countOne": "{count} fallo", diff --git a/messages/fr.json b/messages/fr.json index b5e9d4ccf..84226f8ee 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -8768,7 +8768,7 @@ }, "failingJobs": { "title": "Tâches en arrière-plan", - "description": "Files dont les tâches ont abandonné après avoir épuisé leurs tentatives.", + "description": "Files dont les tâches ont abandonné après leurs tentatives, ou dont l’exécution a échoué pour chaque compte.", "none": "Aucune tâche n’a échoué au cours des {hours} dernières heures.", "unavailable": "Aucune file à consulter : ce déploiement fonctionne sans le worker en arrière-plan.", "countOne": "{count} échec", diff --git a/messages/it.json b/messages/it.json index 8e5512ee2..506eb23f8 100644 --- a/messages/it.json +++ b/messages/it.json @@ -8768,7 +8768,7 @@ }, "failingJobs": { "title": "Processi in background", - "description": "Code i cui processi hanno rinunciato dopo aver esaurito i tentativi.", + "description": "Code i cui processi hanno rinunciato dopo i tentativi o la cui esecuzione è fallita per ogni account.", "none": "Nessun processo è fallito nelle ultime {hours} ore.", "unavailable": "Nessuna coda da leggere: questo deployment funziona senza il worker in background.", "countOne": "{count} errore", diff --git a/messages/ko.json b/messages/ko.json index 6ce331f81..89fe1732c 100644 --- a/messages/ko.json +++ b/messages/ko.json @@ -8743,7 +8743,7 @@ }, "failingJobs": { "title": "백그라운드 작업", - "description": "재시도를 다 쓰고 포기한 작업이 있는 큐예요.", + "description": "재시도를 다 쓰고 포기했거나, 실행에서 시도한 모든 계정이 실패한 큐예요.", "none": "최근 {hours}시간 동안 실패한 작업이 없어요.", "unavailable": "읽을 작업 큐가 없어요. 이 배포본은 백그라운드 워커 없이 돌고 있어요.", "countOne": "실패 {count}건", diff --git a/messages/nl.json b/messages/nl.json index 657a2e61e..ddf85f494 100644 --- a/messages/nl.json +++ b/messages/nl.json @@ -8768,7 +8768,7 @@ }, "failingJobs": { "title": "Achtergrondtaken", - "description": "Wachtrijen waarvan taken het hebben opgegeven nadat alle nieuwe pogingen waren verbruikt.", + "description": "Wachtrijen waarvan taken na alle pogingen opgaven, of waarvan een run voor elk geprobeerd account mislukte.", "none": "Er is de afgelopen {hours} uur geen taak mislukt.", "unavailable": "Geen takenwachtrij om te lezen. Deze installatie draait zonder de achtergrondworker.", "countOne": "{count} fout", diff --git a/messages/pl.json b/messages/pl.json index 5ced39f79..aa2b039d2 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -8768,7 +8768,7 @@ }, "failingJobs": { "title": "Zadania w tle", - "description": "Kolejki, których zadania poddały się po wyczerpaniu ponowień.", + "description": "Kolejki, których zadania poddały się po ponowieniach albo których przebieg zawiódł dla każdego konta.", "none": "W ciągu ostatnich {hours} godzin żadne zadanie nie zawiodło.", "unavailable": "Brak kolejki zadań do odczytu: to wdrożenie działa bez workera w tle.", "countOne": "{count} niepowodzenie", diff --git a/messages/pt-BR.json b/messages/pt-BR.json index 01ab83ec1..351ec8538 100644 --- a/messages/pt-BR.json +++ b/messages/pt-BR.json @@ -8768,7 +8768,7 @@ }, "failingJobs": { "title": "Tarefas em segundo plano", - "description": "Filas cujas tarefas desistiram depois de esgotar as tentativas.", + "description": "Filas cujas tarefas desistiram após as tentativas, ou cuja execução falhou em todas as contas tentadas.", "none": "Nenhuma tarefa falhou nas últimas {hours} horas.", "unavailable": "Nenhuma fila de tarefas para ler. Esta implantação roda sem o worker em segundo plano.", "countOne": "{count} falha", diff --git a/messages/ru.json b/messages/ru.json index c8ba334ab..acd103c36 100644 --- a/messages/ru.json +++ b/messages/ru.json @@ -8768,7 +8768,7 @@ }, "failingJobs": { "title": "Фоновые задания", - "description": "Очереди, задания которых сдались после исчерпания повторных попыток.", + "description": "Очереди, задания которых сдались после всех попыток или чей запуск не удался ни для одного аккаунта.", "none": "За последние {hours} часов ни одно задание не завершилось неудачей.", "unavailable": "Нет очереди заданий для чтения. Это развёртывание работает без фонового воркера.", "countOne": "{count} неудача", diff --git a/package.json b/package.json index 87525da8e..d7bfeb12c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "healthlog", - "version": "1.47.5", + "version": "1.47.6", "description": "Self-hosted personal-health-tracking PWA with Withings integration, AI insights, and doctor-report PDF export.", "license": "PolyForm-Noncommercial-1.0.0", "homepage": "https://healthlog.dev", diff --git a/public/sw.js b/public/sw.js index fbb56e5c2..5ca6eb509 100644 --- a/public/sw.js +++ b/public/sw.js @@ -16,7 +16,7 @@ try { } const CACHE_VERSION = (typeof self !== "undefined" && self.__APP_VERSION__) || - /* @sw-version-fallback */ "v1.47.5"; + /* @sw-version-fallback */ "v1.47.6"; const STATIC_CACHE = `healthlog-static-${CACHE_VERSION}`; const PAGE_CACHE = `healthlog-pages-${CACHE_VERSION}`; // Every HealthLog cache, current and legacy, and nothing another app on the diff --git a/src/__tests__/baselines/source-file-lines.json b/src/__tests__/baselines/source-file-lines.json index 8511c398b..f736accfa 100644 --- a/src/__tests__/baselines/source-file-lines.json +++ b/src/__tests__/baselines/source-file-lines.json @@ -1,7 +1,7 @@ { "$comment": "Production files over 800 lines and their length. Maintained by src/__tests__/source-size-ratchet.test.ts.", "count": 84, - "total": 93816, + "total": 93819, "entries": { "app/medications/page-client.tsx": 842, "components/charts/mood-chart.tsx": 1166, @@ -64,7 +64,7 @@ "lib/insights/mood-aggregates.ts": 1053, "lib/integrations/status.ts": 1448, "lib/jobs/coach-nudge.ts": 1084, - "lib/jobs/insight-pregenerate.ts": 1189, + "lib/jobs/insight-pregenerate.ts": 1192, "lib/jobs/medication-intake-import.ts": 819, "lib/jobs/offhost-backup.ts": 1094, "lib/jobs/reaction-line.ts": 803, diff --git a/src/__tests__/baselines/test-as-never.json b/src/__tests__/baselines/test-as-never.json index 25d657b68..cddd240c4 100644 --- a/src/__tests__/baselines/test-as-never.json +++ b/src/__tests__/baselines/test-as-never.json @@ -435,7 +435,7 @@ "lib/jobs/__tests__/document-summary-reaper.test.ts": 1, "lib/jobs/__tests__/document-summary.test.ts": 19, "lib/jobs/__tests__/geo-backfill.test.ts": 1, - "lib/jobs/__tests__/insight-pregenerate.test.ts": 45, + "lib/jobs/__tests__/insight-pregenerate.test.ts": 43, "lib/jobs/__tests__/insight-status-generate.test.ts": 2, "lib/jobs/__tests__/measurement-maintenance-schedule.test.ts": 2, "lib/jobs/__tests__/measurement-reminder-byhour.test.ts": 2, diff --git a/src/__tests__/baselines/version-stamp-comments.json b/src/__tests__/baselines/version-stamp-comments.json index 6bbcd8aee..bbc180535 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": 2863, - "total": 9122, + "total": 9118, "entries": { "__tests__/account-payload-consumer-guard.test.ts": 2, "__tests__/acting-account-boundary-guard.test.ts": 7, @@ -2134,7 +2134,7 @@ "lib/insights/chart-tokens.ts": 24, "lib/insights/coach-launch-context.tsx": 10, "lib/insights/comprehensive-aggregator.ts": 27, - "lib/insights/comprehensive-generate.ts": 45, + "lib/insights/comprehensive-generate.ts": 44, "lib/insights/correlation-channel-series.ts": 16, "lib/insights/correlation-discovery.ts": 30, "lib/insights/correlation-series-builders.ts": 1, @@ -2299,7 +2299,7 @@ "lib/jobs/google-health-oauth-state-cleanup.ts": 1, "lib/jobs/google-health-sleep-repair.ts": 1, "lib/jobs/insight-pregenerate-shared.ts": 1, - "lib/jobs/insight-pregenerate.ts": 36, + "lib/jobs/insight-pregenerate.ts": 33, "lib/jobs/insight-status-generate-shared.ts": 3, "lib/jobs/insight-status-generate.ts": 3, "lib/jobs/intake-auto-skip.ts": 8, diff --git a/src/__tests__/error-level-discipline-guard.test.ts b/src/__tests__/error-level-discipline-guard.test.ts index c3432c8be..5376df965 100644 --- a/src/__tests__/error-level-discipline-guard.test.ts +++ b/src/__tests__/error-level-discipline-guard.test.ts @@ -168,6 +168,11 @@ const ALLOWED: Readonly> = { reason: "No pgboss schema on a web-only deployment; null means no queue to ask, and the evaluation then judges nothing.", }, + "lib/jobs/job-failures.ts::explainAllFailedRun": { + count: 1, + reason: + "A pg-boss output that does not parse as a run's outcome is not an all-failed run; presentError then shows the raw text as it always did.", + }, "lib/jobs/job-failures.ts::readActiveJobsStartedBefore": { count: 1, reason: diff --git a/src/app/insights/mood/page-client.tsx b/src/app/insights/mood/page-client.tsx index 00c75e12d..fa0f048cc 100644 --- a/src/app/insights/mood/page-client.tsx +++ b/src/app/insights/mood/page-client.tsx @@ -12,7 +12,10 @@ import { queryKeys } from "@/lib/query-keys"; import { useTranslations } from "@/lib/i18n/context"; import { useInsightsLayoutPrefs } from "@/hooks/use-insights-layout-prefs"; import { Button } from "@/components/ui/button"; -import { ChartSkeleton } from "@/components/charts/chart-skeleton"; +import { + ChartSkeleton, + MoodChartSkeleton, +} from "@/components/charts/chart-skeleton"; import { MetricEmptyState } from "@/components/insights/metric-empty-state"; import { MetricTargetSummary } from "@/components/insights/metric-target-summary"; import { @@ -54,7 +57,7 @@ const MoodChart = dynamic( import("@/components/charts/chart-runtime").then((mod) => ({ default: mod.MoodChart, })), - { ssr: false, loading: () => }, + { ssr: false, loading: () => }, ); /** diff --git a/src/components/charts/chart-skeleton.tsx b/src/components/charts/chart-skeleton.tsx index f160a07b3..828c24630 100644 --- a/src/components/charts/chart-skeleton.tsx +++ b/src/components/charts/chart-skeleton.tsx @@ -2,6 +2,7 @@ import { useEffect, useState } from "react"; +import { Card, CardContent, CardHeader } from "@/components/ui/card"; import { Skeleton } from "@/components/ui/skeleton"; import { cn } from "@/lib/utils"; import { useTranslations } from "@/lib/i18n/context"; @@ -50,12 +51,16 @@ const SLOW_HINT_DELAY_MS = 3_000; /** * The footer a loaded `` paints under its plot: the row of day - * dots and its caption on a day-linked chart, and the collapsed "show as - * table" disclosure. A loading shell without it was ~100 px shorter than the - * card it turned into (CLS on every metric page, the BMI page most visibly), - * so the shells reserve the same boxes: `h-3` rug, `mt-1` caption (two lines - * on a phone, one from `sm`), and the disclosure's `mt-3 border-t pt-3` frame - * around its `min-h-11` button. + * dots on a day-linked chart, and the collapsed "show as table" disclosure. A + * loading shell without it was ~100 px shorter than the card it turned into + * (CLS on every metric page, the BMI page most visibly), so the shells reserve + * the same boxes: the `h-3` rug, and the disclosure's `mt-3 border-t pt-3` + * frame around its `min-h-11` button. + * + * The rug is all a day-linked chart paints under its plot. It used to carry a + * one-line caption as well, and the reserve kept that line after the caption + * went: every day-linked shell stood 20 px taller than its chart (40 px on a + * phone) and the page shrank under the reader when the chart arrived. */ export function ChartFooterReserve({ dayLinks = false, @@ -67,12 +72,7 @@ export function ChartFooterReserve({ if (!dayLinks && !dataTable) return null; return (