v1.37.11 — one save for the lifestyle context - #771
Merged
Conversation
The lifestyle-context tile carried a Save button per fact kind. Collapse them into one footer Save that writes only the dirty kinds, firing the existing bitemporal call per kind (POST a first value, PATCH a revision) and settling them together so a single conflict cannot take the healthy writes down with it. A kind that 409s keeps its draft on screen and names itself, instead of vanishing behind one green toast. The per-kind Remove stays.
The mood chart hand-rolled a CardTitle where every other insights tile header goes through TileHeader. Swap it for the shared primitive, which renders the same CardTitle at text-base, and drop the now-unused CardTitle import. Like-for-like; the surrounding control rows are untouched.
The `/api/mood/insights` mock still returned the pre-heatmap shape, so `summary.totalEntries` was undefined, the empty-state guard never short-circuited, and the page threw reading `heatmap.cells`. Correct the mock to the current MoodInsightsResponse and add `/insights/mood` to the a11y route matrix so the page is scanned henceforth.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Assembled off
origin/main. Additive polish bundle: no migration, no API/contract change.One save for the lifestyle-context tile
The Lebensstil-Kontext card in Anamnese had three fact kinds (smoking, alcohol, shift work), each with its own save button. Now one footer Save writes every dirty kind together through its existing endpoint, with one confirmation and one refresh. Partial failure is honest: a kind that cannot be saved keeps its draft and says which one failed, while the others go through, rather than a single green toast hiding the failure. Per-kind remove is unchanged. No new column, no new route. Watched-red proven: two dirty kinds write to both real endpoints; a forced conflict on one keeps its draft while the other persists and the error names the failed kind.
Mood chart header through TileHeader
The mood chart still hand-rolled its title where the other chart cards already use the shared
TileHeaderprimitive. Swapped it. Like-for-like: same element, size, colour and position, control rows untouched, so nothing moves. No other chart cards were touched.Mood insights page: fix a stale test mock and scan the page
The
/insights/moodsub-page threw an error boundary under the accessibility fixture. The cause was a stale test mock, not the product: the mock returned acountfield where the response contract hastotalEntries, so a guard did not short-circuit and the code read aheatmapthe mock never populated. Corrected the mock to the real response shape and added/insights/moodto the accessibility scan matrix so the page is covered from now on. No defensive shim was added to the component, since the contract guarantees the fields.Verification
openapi:check(in sync, the diff is only the version line), test (21117 passed), build: all green, andformat:check(a Prettier gate that a previous release only caught in CI) passes locally.test:integrationneed (additive, no server or schema change)./insights/moodis scanned by the accessibility job for the first time. If it surfaces unrelated accessibility violations that are more than a trivial fix, the route-add hunk can be reverted on its own while keeping the mock correction, and the violations filed as a follow-up.