feat(i18n): recompose from the largest measured fraction, show diffs as bought, and make subtraction by kind clear #162

Merged
abiwab merged 1 commit from feat/compound-display-polish into dev/1.5 2026-11-15 18:21:29 +01:00
Owner

Follow-up of the compound quantities end-to-end check (step 3).

  • Recomposition (formatTerms, computed mode): the largest unit first takes the largest fraction it measures, not whole units: 25.5 tbsp → 1 1/2 cup + 1 1/2 tbsp (was 1 cup + 9 1/2 tbsp), 21 tbsp → 1 1/4 cup + 1 tbsp, 22 oz → 1 1/4 lb + 2 oz. Docs examples unchanged.
  • gram diff: fromText / toText are written as the shopping list writes them: 1 cup + 1 tbsp → 1 cup + 3 tbsp (was 17 tbsp → 19 tbsp).
  • Subtraction by kind made clear: minusAcrossFamilies and nonPositiveTotal messages give the example that works and the one that does not; the hover of a sum of several kinds shows what each comes to (= 14 tbsp (volume) + 30 g (weight), counted apart: each kind adds up and takes away on its own); docs (EN + FR) explain it in ingredients.mdx and warnings.mdx. language-server.mdx said volume + mass where the hover says weight: fixed.
  • Goldens: only the two messages change (warn-021). Changeset compound-quantities.md: the gram diff line updated.

Checks: typecheck, lint, 3175 tests + new i18n test, conformance 120/120 + 24/24, check-changesets, docs build (links valid, 1012.2 KB / 1040 KB).

Follow-up of the compound quantities end-to-end check (step 3). - **Recomposition** (`formatTerms`, computed mode): the largest unit first takes the largest fraction it measures, not whole units: `25.5 tbsp` → `1 1/2 cup + 1 1/2 tbsp` (was `1 cup + 9 1/2 tbsp`), `21 tbsp` → `1 1/4 cup + 1 tbsp`, `22 oz` → `1 1/4 lb + 2 oz`. Docs examples unchanged. - **`gram diff`**: `fromText` / `toText` are written as the shopping list writes them: `1 cup + 1 tbsp → 1 cup + 3 tbsp` (was `17 tbsp → 19 tbsp`). - **Subtraction by kind made clear**: `minusAcrossFamilies` and `nonPositiveTotal` messages give the example that works and the one that does not; the hover of a sum of several kinds shows what each comes to (`= 14 tbsp (volume) + 30 g (weight), counted apart: each kind adds up and takes away on its own`); docs (EN + FR) explain it in `ingredients.mdx` and `warnings.mdx`. `language-server.mdx` said `volume + mass` where the hover says `weight`: fixed. - Goldens: only the two messages change (warn-021). Changeset `compound-quantities.md`: the `gram diff` line updated. Checks: typecheck, lint, 3175 tests + new i18n test, conformance 120/120 + 24/24, check-changesets, docs build (links valid, 1012.2 KB / 1040 KB).
abiwab merged commit 14b8afe6a9 into dev/1.5 2026-11-15 18:21:29 +01:00
abiwab deleted branch feat/compound-display-polish 2026-11-15 18:21:30 +01:00
Sign in to join this conversation.
No description provided.