Repository navigation
feat(medications): calm detail page with four tabs and server-worded effect - #1628
Merged
Merged
Conversation
…effect The detail page gets a one-line header with a menu (edit, pause, end) and four tabs instead of six. The overview opens with three cards built the same way (today, intake, effect), each ending in two equal buttons, then the plan as one table that now also holds the leaflet. The history is one row per day with a column per dose time and one menu per day. The effect tab leads with its result and keeps the method behind a fold. Settings replaces the schedule, supply and advanced tabs with four groups of one-line rows; everything longer opens in a sheet. The efficacy read carries targets[].result, the comparison's direction and one sentence in the reader's language, behind the feature key medication.efficacy-result. Old ?tab= slugs resolve to the tab that holds their controls, and an old supply link opens the supply sheet.
MBombeck
marked this pull request as ready for review
November 27, 2026 14:31
…edication-detail # Conflicts: # CHANGELOG.md
The overview cards move into one module each (anatomy, today, intake, effect, plan), the effect result helpers into their own module, and the short cadence line beside the header that uses it. The settings tab, the history table and the danger zone extract their sheet, groups, table and confirmation, so no function grows past the size ratchet. The intake card reads its rate through shownAdherence; the Polish and Russian miss sentences use the missed word; baselines record the lower counts.
…rt the old tabs used
…lan's supply line
…edication-detail # Conflicts: # CHANGELOG.md # docs/api/openapi.yaml # src/__tests__/baselines/source-file-lines.json # src/__tests__/baselines/source-function-lines.json # src/__tests__/baselines/version-stamp-comments.json # src/components/__tests__/delegated-write-affordances.test.tsx # src/lib/server-features.ts
…e source each The recurrence engine closed a dose's on-time window after the schedule's own value, else its legacy window span, else 60 minutes; the compliance cycle walk fell back to 60 without the span, and the page's plan row and reminder setting to 30. effectiveGraceMinutes is now the one rule and every reader calls it. The header menu and the settings switch each seeded a copy of the paused state at mount, so pausing from one left the other saying the opposite. The hook derives it from the stored active flag and overrides it only while its own write is in flight. A test pins both.
The Today card's sentence read back the time and the state its rows show; it now speaks only when there is no row. The Intake card named its window in the chip and again in the sentence, the Effect card the change in the sentence and again as a figure, and the plan repeated the cadence the header line carries. One filled button per screen: History, Details and the paused card's History are outlined.
… week The history was a table with a day per row, a column per dose time and a menu per day. It is now the shared ListGroup and ListItem: a card per week, the two newest first and older weeks on request, a row per dose with its state at the end and a second line only when what happened differs from the plan. A dose taken on time is a check. A tap opens the dose's sheet with take, skip, pin, release, edit, the toggle, open the day and delete; a write delegate gets take and skip. The summary keeps the rate and the counts that are not zero; its bar is gone, the overview has the picture.
…edication-detail # Conflicts: # CHANGELOG.md
…uttons already say
…ord out of the history
The retarget sheet passes its two buttons to the footer, the on-time check comes from the dose-state look, the single-source test reads through the source helpers, and the ratchets drop the entries the old dose table held.
…paused overview As needed, the Today card no longer repeats the header's "as needed", the Intake card leaves Log past dose to Today and its one-tone legend to the sentence. A dose that cannot be taken now leaves the Today card without a pair, since Intake below carries Log past dose and History.
…d the one on-time window
…edication-detail # Conflicts: # CHANGELOG.md # docs/api/openapi.yaml # src/__tests__/baselines/source-function-lines.json # src/__tests__/baselines/version-stamp-comments.json # src/components/medications/detail/medication-detail-tabs.tsx
…edication-detail # Conflicts: # src/__tests__/baselines/source-file-lines.json # src/__tests__/baselines/source-function-lines.json # src/__tests__/baselines/version-stamp-comments.json
This was referenced Nov 28, 2026
MBombeck
pushed a commit
that referenced
this pull request
Nov 28, 2026
eat/150-medication-detail (#1628) landed on `release/v1.50.0` after the bundle was synced, so 52 English keys have no Chinese counterpart. `release` is red on the plural guard because of it: i18n-count-plural-guard > zh-CN has a plural block migrations.detail.settingsTab.intakeCount: count These are those 52, inside `medications.detail.*`, `medications.efficacy.*`, `medications.leaflet.*` and `serverText.efficacyResult.*` — the new medication detail screen, its intake log, its plan section and the efficacy sentence the server writes. Chinese has one plural form, so each block carries `other` only, which is what the guard asks for. The measure-word rule from the typography change holds here too: `{days}天`, `{count}次`, `{minutes}分钟`, never a space. The bundle is now key for key with English again: 0 missing. 32 keys remain in zh-CN that English no longer has — they are strays from the release renames, not references from code, and they are left alone here so this change stays a catch-up rather than a clean-up. Verified: the plural guard and the rest of the i18n family (drift, reverse coverage, English leak, typography and glyphs, title case, dose vocabulary, glossary) are green, 327 cases.
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.
The medication detail page, rebuilt to the approved "calm tabs" layout.
What changes
ActionPairwith the secondary left): Today (today's doses from the today list, Skip / Take; no sentence when the rows already say the time and state), Intake (server adherence, 14-day dose grid with legend, Log past dose / History), Effect (server result sentence, before → after, small SVG chart, Change measurement / Details). One filled button per screen (Take); History and Details are outlined. Below: the plan as one table (period, reminder, supply, note, leaflet; the cadence is the header's line only) and the links as the sharedRecordLinksRowtile ("Verknüpfungen": chips and one "Link" menu, no tile when there is nothing to show or add).ListGroup/ListItem: one card per week (the two newest first, older weeks on request), one row per dose. A dose taken at its planned time is a check; a second line appears only when something differs from the plan (taken at another time, another dose, pinned). A tap opens the dose's sheet: take, skip, pin/release, edit, the skipped/taken toggle, open the day, delete; a write delegate gets take and skip. Above the weeks: the rate with the non-zero counts (no bar; the overview has the picture), Log past dose, and the range switch.?tab=schedule, supply, advanced and the German slugs resolve to Settings;?tab=supply(the low-stock push) opens the supply sheet. Guarded bymedication-tab-slugs.test.ts.Contract (additive)
GET /api/medications/{id}/efficacycarriestargets[].result: { direction: "lower" | "higher" | "unchanged" | null, text }, worded on the server in the reader's language (serverText.efficacyResult.*, ten locales). A change under 2 % of the before-mean readsunchanged. Feature keymedication.efficacy-resultinGET /api/version. OpenAPI regenerated. No other route, field or migration.Measured (demo seed, 1440 px, active panel)
Every action, before and after
?edit=1?edit=1RecordLinksRow)Nothing was removed except the adherence help popover and the ad-hoc "was due at" line in the history (the pin action in the dose sheet still names the slot), the extra-dose hint under Take (the button says "Take extra" and the toast confirms it) and the history's second adherence bar.
One source each
effectiveGraceMinutes(src/lib/medications/scheduling/grace.ts) is the one rule now;pause-and-grace-single-source.test.tsrefuses a second numeric fallback.!activeat mount and drifted after a pause from the other. The hook derives it from the stored flag and overrides it only while its write is in flight; the same test pins it.Checks
pnpm typecheck,pnpm lint,pnpm testgreen; medication integration tests green.medication-tab-slugs.test.ts(old slugs),efficacy-result.test.ts(direction, wording, all locales),overview-cards.test.tsx,e2e/medication-detail.spec.ts(tabs, button pairs of equal width, one row per dose and a card per week, the dose sheet, settings groups, old links, axe on every tab in both themes, no sideways scroll at 390 px). New:pause-and-grace-single-source.test.ts. Updated: leaflet, delegated affordances, dose vocabulary, summary, notification dispatch e2e.