Commit Graph
7266 Commits
Author SHA1 Message Date
Marc-André Bombeck bd2d43e402 Merge remote-tracking branch 'origin/fix/ai-timeout-everywhere' into fix/ai-timeout-everywhere 2026-10-03 00:03:31 +02:00
Marc-André Bombeck 0f6669847c Merge remote-tracking branch 'origin/main' into fix/ai-timeout-everywhere 2026-10-02 23:59:38 +02:00
Marc-André Bombeck 2473d52f19 Merge pull request #1089 from MBombeck/feat/manual-workout-entry
Log a workout by hand
2026-10-02 23:59:11 +02:00
Marc-André Bombeck e6e5bd0adc Merge pull request #1087 from MBombeck/fix/dashboard-tile-links
Every dashboard tile opens its chart; body fat gets its page
2026-10-02 23:50:43 +02:00
Marc-André Bombeck 3b1d503e87 Merge branch 'main' into fix/ai-timeout-everywhere 2026-10-02 23:20:26 +02:00
Marc-André Bombeck 57a99e6cc8 Merge branch 'main' into feat/manual-workout-entry 2026-10-02 23:20:24 +02:00
Marc-André Bombeck 774dff410c Merge branch 'main' into fix/dashboard-tile-links 2026-10-02 23:20:23 +02:00
Marc-André Bombeck 06f69e4408 Merge pull request #1091 from MBombeck/fix/e2e-lab-review-animations
Wait for the lab review sheet to stop sliding before measuring
2026-10-02 23:20:11 +02:00
Marc-André Bombeck ae0bdd0390 fix(settings): name the real response-timeout defaults
The placeholder said "Default (~120)" while most surfaces fall back to
60 s and the briefing to 180 s. The placeholder and the help line now
interpolate both numbers from the constants the server applies
(PROVIDER_DEFAULT_TIMEOUT_MS, AI_BUDGETS.comprehensive.timeoutMs), in
all seven locales, and a test fails if a locale writes a number of its
own.

Refs #1090
2026-10-02 23:17:37 +02:00
Marc-André Bombeck 6207101006 test(ai): guard that every model call runs under the response-timeout setting
Pins the four ways the setting could be skipped again: a wire client
reading params.timeoutMs itself instead of callTimeoutMs, an exported
resolver in provider.ts returning a provider it did not bind, a client
constructed outside provider.ts (the offline evaluation harness is the
named exception), and a surface ceiling not listed with its reason.
Each matcher asserts a non-zero match count.

Refs #1090
2026-10-02 23:03:45 +02:00
Marc-André Bombeck bf7fb9c401 fix(documents): wait as long as the server may on document reads and lab OCR
The browser gave up on its own: 120 s for the document routes, 90 s for
a lab scan, and the 15 s default on the lab text path, while a slow
self-hosted model with a raised response timeout was still allowed to
answer. A five-page report read by a local model failed on the client
side with the server still working.

Each request now sizes its abort from ai.provider.responseTimeoutMs on
the account payload, times the model calls the route can make, plus
30 s: one call for suggest and summary, three for Read with AI (the
transcription, then the lab staging read and its corrective retry), two
for a lab scan (the read and its retry). With the setting unset that is
90 s, 210 s and 150 s.

Refs #1090
2026-10-02 23:01:41 +02:00
Marc-André Bombeck 5ee1b3e28f fix(ai): run every model call under the response-timeout setting
The response-timeout setting reached the briefing, the status notes and
the Coach, which threaded it by hand. Document reads, document
extraction, lab OCR and lab staging called the provider without a
timeout, so every client fell back to its own 60 s literal and a slow
self-hosted model was cut off however high the setting stood.

The setting now rides on the provider instance. resolveProvider,
resolveProviderChain and resolveProviderForTest stamp the record's
aiResponseTimeoutSeconds on everything they return, and each wire
client reads its ceiling through callTimeoutMs: the setting, else the
surface's own timeoutMs, else 60 s. A call site no longer has to pass
it, so a new one cannot forget it. The connection test runs under the
same ceiling a read does.

The Coach nudge tick and the reaction line keep their short ceilings
(timeoutPolicy: "surface-ceiling"): the tick runs accounts one after
another under a shared budget, the reaction line's claim lease is
shorter than the largest setting, and both have deterministic copy
that stands in.

/api/auth/me publishes the effective value as
ai.provider.responseTimeoutMs, so a client can size its own request
timeout from it instead of guessing.

Refs #1090
2026-10-02 23:01:36 +02:00
Marc-André Bombeck c08dfc618f test(e2e): call a lab review field beside the value when it shares its row
The spec compared field tops within 8 px. A field label that wraps onto a
second line, which depends on the runner's font metrics, moves that
field's input down by one line while it stays in the same row, and the
560 px case failed on it. A field is now beside the value when it sits to
its right and starts above the value's bottom edge.
2026-10-02 22:56:27 +02:00
Marc-André Bombeck 4125d08fb4 test(e2e): wait for the lab review sheet to stop sliding before measuring
On a phone and a small tablet the review sheet slides up from the bottom;
its width settles before the slide ends, so waiting on width alone still
compared fields from different frames. The spec now waits for every
running animation to finish and for the surface to hold its position and
width across two frames.
2026-10-02 22:33:17 +02:00
Marc-André Bombeck b079e23a83 Merge remote-tracking branch 'origin/feat/manual-workout-entry' into feat/manual-workout-entry 2026-10-02 22:30:19 +02:00
Marc-André Bombeck 9e239dd6c5 build: re-measure the aggregate client budget for the manual workout entry
Main measured 3718 KB gz after v1.39.7 and v1.39.8, almost all of it new
copy in the seven lazy locale catalogs; the workout form, its sheet, the
delete action and their copy add about 7 KB (3725). The cap moves from
3724 to 3749, the same 24 KB headroom as before; the eager routes stay
inside their drift allowances.

Refs #1085
2026-10-02 22:30:09 +02:00
Marc-André Bombeck 11936ed93c Merge remote-tracking branch 'origin/main' into feat/manual-workout-entry 2026-10-02 22:28:44 +02:00
Marc-André Bombeck 1a403b78f7 Merge pull request #1086 from MBombeck/fix/audit-node-forge
Ignore the node-forge advisory until a fix is published
2026-10-02 22:16:59 +02:00
Marc-André Bombeck e6e1b51918 Merge branch 'main' into feat/manual-workout-entry 2026-10-02 21:49:45 +02:00
Marc-André Bombeck f0abe984b0 Merge branch 'main' into fix/dashboard-tile-links 2026-10-02 21:49:44 +02:00
Marc-André Bombeck 5dde6f785c Merge branch 'main' into fix/audit-node-forge 2026-10-02 21:49:42 +02:00
Marc-André Bombeck 1dd0609535 Merge pull request #1088 from MBombeck/fix/e2e-lab-review-settle
Measure the lab review rows once the dialog has settled
2026-10-02 21:49:31 +02:00
Marc-André Bombeck d9dfa7e5db test(dashboard): type the module cases of the add-menu parity check
Refs #1085
2026-10-02 21:44:37 +02:00
Marc-André Bombeck 69f19ec232 copy(workouts): mention manual entry in the empty workouts list
Refs #1085
2026-10-02 21:38:22 +02:00
Marc-André Bombeck cf678f6ec4 fix(dashboard): gate every add-menu entry on its module, as the capture picker does
The dashboard add menu asked only whether the record's section was
writable, so a switched-off mood or medications module still offered its
entry here while the bottom bar's picker hid it. The menu now renders from
the picker's own visibleCaptureKinds, so the two cannot disagree.

Refs #1085
2026-10-02 21:38:06 +02:00
Marc-André Bombeck 074cccd920 docs(api): regenerate the contract for the workout delete error code
Refs #1085
2026-10-02 21:36:24 +02:00
Marc-André Bombeck 2979b5c4ef test(e2e): measure the lab review rows once the dialog has stopped widening
The review stage widens the sheet and the row grid re-flows from the
container width; on a slow runner the 560 px case measured a half-laid-out
row and failed on the first attempt. The spec now waits until the surface
keeps its width across two frames before it measures.
2026-10-02 21:33:31 +02:00
Marc-André Bombeck 6eb79a1d47 fix(workouts): report manual saves through the outcome module and register the delete
A repeated submit that wrote nothing reads as a neutral notice rather
than a success. The delete control is entered in the destructive-control
registry, and its 409 code in the published error catalogue.

Refs #1085
2026-10-02 21:31:25 +02:00
Marc-André Bombeck cfbb57ab3e test(workouts): format the manual-entry integration suite
Refs #1085
2026-10-02 21:28:07 +02:00
Marc-André Bombeck 92ce699792 test(workouts): drive a hand-entered workout through the real routes
Builds the entry the form sends, posts it through the batch route, reads
it back from the list, re-posts it as a duplicate, and deletes it; a
synced workout is refused.

Refs #1085
2026-10-02 21:25:36 +02:00
Marc-André Bombeck 715268c62b feat(workouts): offer Log workout in the add menu and the capture picker
The dashboard add menu and the bottom bar's capture picker gain a
workout entry next to measurement, mood and medication. It belongs to
the workouts module (capture:workout) and is offered in one's own record
only, because the batch ingest resolves the caller and no grant reaches
it.

Refs #1085
2026-10-02 21:23:01 +02:00
Marc-André Bombeck e0fc879d72 feat(workouts): log a workout by hand from the workouts page
A small sheet with sport, start, duration and optionally distance and
active energy, nothing else. The start is read in the profile timezone,
distance in the reader's unit and stored in metres. It saves through
POST /api/workouts/batch as source MANUAL with an external id minted once
per opened form, so a second tap lands as a duplicate, not a second row.

The workouts page carries the action in its header and in the empty
state; the detail page offers delete for a hand-entered workout.

Refs #1085
2026-10-02 21:22:56 +02:00
Marc-André Bombeck 5e6fd327a5 feat(workouts): delete a workout entered by hand
DELETE /api/workouts/{id} removes a MANUAL workout outright, with its
child rows and the personal records keyed on it, then queues a silent
detection pass so the previous best comes back. Any other source answers
409: the next sync would write it back. Own record only, 404 for another
user's row.

Refs #1085
2026-10-02 21:22:56 +02:00
Marc-André Bombeck 885efaafd9 fix(dashboard): open the body fat page from the body fat tile
The body fat tile was the one strip tile that led nowhere. Its href map
said there was no dedicated sub-page, which was true: body fat percentage
was tiled and charted on the dashboard but never got the Insights page
every body-composition sibling has.

Add /insights/body-fat on the generic metric-page scaffold (body group,
tab-strip pill, seven locales, manual-entry empty state) and link the
tile to it.

Move the tile href map out of the page into tile-destinations.ts, keyed by
the tile-capable widget id and typed against the sub-page slug union, so
a missing or non-existent destination fails to compile. The link passes
the destination's insights-page surface gate, so it never points at a
page a switched-off module hides.

A guard derives the tile set from TILE_CAPABLE_WIDGET_IDS and from the
ids the dashboard actually pushes into its strip, and fails when a tile's
metric has a sub-page the tile does not open, when a destination has no
route, or when a tile links to a page owned by another module. Tiles that
deliberately lead nowhere need a written reason; there are none today.

The reverse-lookup test pinned BODY_FAT as having no page; it now
resolves to body-fat.

Refs #1084
2026-10-02 21:21:38 +02:00
Marc-André Bombeck 0cb193f812 chore(deps): carry the node-forge advisory in the Trivy ignore list too
Same advisory, same reasoning as the pnpm audit entry: the affected
signature verification sits in node-apn's certificate credential path,
which token-authenticated APNs never reaches, and no fix is published.
2026-10-02 21:06:37 +02:00
Marc-André Bombeck 2ea9dc3936 Merge pull request #1059 from BernhardBuckel/feat/ocr-review-wide-dialog
feat(labs): give the lab-scan review stage the width a large screen offers
2026-10-02 21:04:36 +02:00
Marc-André Bombeck 2031b5a722 chore(deps): ignore the node-forge advisory until a fix is published
GHSA-86w9-cpqp-85rv affects RSA PKCS#1 v1.5 signature verification in
node-forge up to 1.4.0, which arrives only through @parse/node-apn for
certificate-based APNs credentials. HealthLog uses token authentication,
so that path never runs, and no patched release exists yet.
2026-10-02 21:03:43 +02:00
BernhardBuckel a2a3414b29 feat(labs): give the lab-scan review stage the width a large screen offers
The review stage is a list of readings to compare and correct, but it sat in
the default 448 px dialog, so with several readings it only grew taller.

- ResponsiveSheet gains an opt-in 6xl width tier (72rem). Nothing else
  changes width; the Sheet branch on phones ignores the tier as before.
- The review stage uses it. The picking stage stays narrow.
- Each row lays out from the width of its container, not the window:
  stacked in a narrow dialog, and once the dialog is wide enough the reading
  sits on the left with its fields on the right.
- The field grid (value, unit, date) is a container of its own, so it takes
  three columns when the fields have room for them, whatever the window
  width. The result-text span follows the same query.
- The dialog-overflow e2e spec covers the review stage at 390, 560, 768,
  1280, 1920 and 3440 px. 560 is wider than a phone's field grid needs but
  below the window sm breakpoint, which is what tells a container query from
  a window one.

Refs #1056
2026-10-02 09:14:51 +02:00
Marc-André Bombeck 23b813f447 Merge pull request #1083 from MBombeck/ci/e2e-three-shards
Run e2e in three shards with a 30-minute cap
2026-10-02 01:23:25 +02:00
Marc-André Bombeck 1d65ffabad Merge pull request #1082 from MBombeck/release/v1.39.8
Release v1.39.8
v1.39.8
2026-10-02 00:44:24 +02:00
Marc-André Bombeck 95f8fbb1f2 ci: run e2e in three shards with a 30-minute cap
Two shards took 14 to 19 minutes against a 20-minute cap after the mobile
route sweep landed, and a slow runner cancelled one twice in a week.
2026-10-02 00:28:57 +02:00
Marc-André Bombeck fe9a94c853 chore(release): v1.39.8 — new ECGs from the iPhone get through, resting heart rate by hand, and ranges, decimals and dates as you read them 2026-10-02 00:06:09 +02:00
Marc-André Bombeck 1399cca4d0 Merge pull request #1081 from MBombeck/fix/v1398-polish
Glucose bands, decimals, calendar dates and chart axes as the reader expects
2026-10-01 22:51:34 +02:00
Marc-André Bombeck ba426706be Merge remote-tracking branch 'origin/main' into fix/v1398-polish 2026-10-01 22:23:09 +02:00
Marc-André Bombeck 90e8940a81 Merge pull request #1080 from MBombeck/fix/v1398-ecg-rate-resting
Let a whole ECG sweep through; log a resting heart rate by hand
2026-10-01 22:22:42 +02:00
Marc-André Bombeck debd44a75b fix(charts): keep axis unit labels on one line; 44 px date and time triggers
Recharts word-wraps a tick label that it measures wider than its axis,
and it measures in the page's body font rather than the tick's 11 px.
"62 bpm" on the pulse chart under a workout and "106 mg/dL" on the
glucose page therefore broke onto two lines at every width, and the
pulse chart's second line sat on the first x tick. Axis units are now
joined with a no-break space through `axisUnitSuffix`, so the label is
one word and stays on one line. A guard fails when a chart axis joins a
unit with a plain space.

The calendar and clock buttons in the date and time fields paint at
32 px; a `::before` halo now gives them a 44 px touch target without
changing the field.
2026-10-01 22:18:28 +02:00
Marc-André Bombeck 801295f55a fix(dates): read date-only lab and document dates as calendar dates
A date-only value is stored at 12:00 UTC. The lab list and history, the
document cards and pickers, the document date suggestion, extracted
fact dates, source-picker rows and the compliance and mood heatmaps
formatted that instant in the reader's zone, which is the next day from
UTC+12 to UTC+14.

`useCalendarDate` formats such a value through the UTC-pinned calendar
formatter the vaccination list already uses, with the same field order
and locale as instant dates. Lab readings hold both kinds, so
`useLabDate` reads a noon-UTC anchor as its calendar date and a reading
typed with its time of day in the reader's zone. A document without a
filing date shows its upload day, an instant, in the reader's zone.
2026-10-01 22:14:07 +02:00
Marc-André Bombeck fe13fa966b fix(labs): print range bars and lab values in the reader's number format
Range bars and the lab list, detail rows, chart tooltip and reference
ranges printed numbers with a plain `String()`, so a German reader saw
"1.8 mIU/L" and "61.3 kg" under a German interface. The same was true
of the mean, GMI, eA1C and the advanced indices on the glucose panel.

`RangeBar` now prints value, bounds and delta through the locale number
formatter and takes an optional `formatValue` for surfaces with their
own precision. Lab values keep their trim rule (whole numbers bare, at
most two decimals) in `formatLabValue`, which now hands the digits to a
caller-supplied locale formatter; `useLabNumber` wires it to the
reader's locale for every lab surface. Inputs are unchanged.
2026-10-01 22:09:30 +02:00
Marc-André Bombeck 75361d0666 fix(glucose): state band edges in the reader's glucose unit
The time-in-range labels in the doctor report, the target caption on
the glucose panel, the glucose page description and the fasting
explainer printed fixed mg/dL figures, so a reader on mmol/L saw
"Low (< 70 mg/dL)" beside values in mmol/L.

The cut-points now live in one place (`GLUCOSE_TIR_CUT_POINTS`,
`GLUCOSE_FASTING_CUT_POINTS`) with the SI figure each guideline prints,
the analytics engine counts its bands from the same constants, and
every sentence takes the band edges and unit as parameters through
`glucoseBandParams`, formatted with the reader's number format.

The unit-preference guard now also reads the locale bundles: a string
that names mg/dL or mmol/L fails unless it is allowlisted with a
reason.

Refs #1067
2026-10-01 22:07:07 +02:00
Marc-André Bombeck 4120927a94 fix(workouts): count a bridge's batches apart from the phone's
A workouts:write token and the iPhone app shared one per-account bucket of
60 batches a minute, so a bridge stuck in a retry loop could use up the
allowance the phone needs to sync the same account. Scoped tokens now count
in a bucket of their own, shared by all bridge tokens of the account so
that minting more tokens does not multiply the allowance.

Refs #1054
2026-10-01 22:00:12 +02:00