fix(i18n): name every measurement source instead of showing its enum - #889
Merged
Conversation
Settings, Sources listed GOOGLE_HEALTH, OURA, POLAR and STRAVA by their internal name: the catalogue was written for seven sources and every provider added since fell through to the raw value. The measurement list carried the same fall-through in its source filter and its table column, and the medication intake history read "via APPLE_HEALTH" for a dose synced from Apple Health. The three catalogues move into one module keyed by the enum, so an omission is a type error rather than a raw value on screen, and the sleep discrepancy tooltip drops the private brand-name map it had grown to work around the gap.
The four raw values in the sources ladder shipped because nothing checks the catalogues against the enum they render. The new guard reads MeasurementSource and IntakeSource out of prisma/schema.prisma, not out of a copy, and fails naming every member no catalogue labels; it also asserts the key each entry names resolves in all seven bundles, since a key that resolves nowhere renders no better than the enum value. Run red against the tree before the labels landed, it reported seven unlabelled measurement sources per catalogue and one unlabelled intake source. The schema reader now carries each enum's declared members so the guard can read them.
This was referenced Sep 2, 2026
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.
Settings, Sources listed four of the ranked sources by their internal name: a reader saw
GOOGLE_HEALTH,OURA,POLARandSTRAVAwhere the others said Withings, Fitbit, Apple Health. Noticed while capturing screenshots for the documentation.The cause is a label catalogue that was written when there were seven sources and never grew. There are fourteen. Seven had no label at all; the screenshot only showed four of them because Nightscout, Telegram and the connector do not appear in the default ladders. The same gap sat in a second catalogue used by the measurement list and its source filter, and a third enum had one hole, so a dose synced from Apple Health read "via APPLE_HEALTH" in the intake history.
The class is closed, not the four strings. All three catalogues move into one module keyed by the enum type, so an omission is now a type error rather than a string that falls through to the raw value at runtime. A test derives the member list from the schema enum and fails naming any member without a label; it reported seven, seven and one against the current tree, and both of its arms were mutation-checked. A private workaround map that had grown in the sleep discrepancy tooltip is gone, since it now reads the shared catalogue.
Labels added to all seven locales, with the brand spellings, which are the same in every language.
Gate: typecheck, lint, format, full unit suite.