feat: notes on temperatures, ^{160°C}(fan) #169

Merged
abiwab merged 9 commits from feat/temperature-note into dev/1.5 2026-11-16 23:22:16 +01:00
Owner

Summary

A temperature can carry a note in parentheses glued to its closing brace: ^{160°C}(fan), ^oven{180°C}(grill), ^{63°C}(internal), ^{high heat}(covered). Plan: .notes/v1.5/plan-temperature-note-1.5.md (revised 2026-11-16).

Changes

  • Parser: Temperature becomes the lexical rule temperature, so only a parenthesis touching } is a note; ^{180°C} (prose) keeps its parenthesis in the sentence. New gluedNote rule, on one line (an unclosed ( is prose, never a note running to the next ) further down), meant to be shared with the sensory checkpoints. TemperatureAST.note, left out when absent or empty. ^ {180°C} and ^four {180°C} read as before. TextMate colors the note like a preparation.
  • Kitchen: ProcessedTemperature.note, left out when absent: no existing compiled output changes.
  • Analyzer: TemperatureDelta bounds carry note (new TemperatureValue type); gram diff reports an added, removed or changed note.
  • Renderer: formatTemperature (exported, the value only, mirror of formatTimerDuration) shared by element.ts and gram cook. The note is always in the sentence (HTML, Markdown, text, print). In HTML it sits outside the pill in a temp-group span (new classes.temperatureGroup), so the line may break before it despite .gram-nobr; the note reuses classes.prepText (.prep), already styled in the recipe view. A temperature without a note keeps its exact DOM.
  • CLI: gram cook shows temperatures like the views (180 °C, temperatures in words too) with their note; gram diff prints the note; the gram import prompt keeps the oven mode as a note.
  • Language server: the closing brace is found with indexOf after {, not lastIndexOf, so a } inside a note is not taken for it.
  • Conformance / audit: new case 047-temperature-note (glued, named, in words, spaced, empty, unclosed); legacy-1.3.0 ignores note on temperatures; the audit knows Temperature:hasNote.
  • Docs (en + fr): temperatures page (section with <Since v="1.5.0" /> and a caution on the glued rule), cheatsheet, AI generation notes, llms-full.txt.

Checks

  • bun run build, bun run typecheck, bun run lint, bun run deprecations:check.
  • bun test: 3221 pass, no snapshot regenerated.
  • bun run conformance: 121 cases, no existing golden changed; legacy-1.3.0 digests unchanged.
  • Audit: same number of flags as before, none on Temperature:hasNote.
  • Docs build OK (playground chunk 1014.7 KB / 1040 KB).
  • Not yet checked by eye in the playground (recipe view on screen and in print, run sheet, highlighting).
  • Changeset: temperature-note.md (parser, kitchen, analyzer, renderer, cli, minor).
## Summary A temperature can carry a note in parentheses glued to its closing brace: `^{160°C}(fan)`, `^oven{180°C}(grill)`, `^{63°C}(internal)`, `^{high heat}(covered)`. Plan: `.notes/v1.5/plan-temperature-note-1.5.md` (revised 2026-11-16). ## Changes - **Parser**: `Temperature` becomes the lexical rule `temperature`, so only a parenthesis touching `}` is a note; `^{180°C} (prose)` keeps its parenthesis in the sentence. New `gluedNote` rule, on one line (an unclosed `(` is prose, never a note running to the next `)` further down), meant to be shared with the sensory checkpoints. `TemperatureAST.note`, left out when absent or empty. `^ {180°C}` and `^four {180°C}` read as before. TextMate colors the note like a preparation. - **Kitchen**: `ProcessedTemperature.note`, left out when absent: no existing compiled output changes. - **Analyzer**: `TemperatureDelta` bounds carry `note` (new `TemperatureValue` type); `gram diff` reports an added, removed or changed note. - **Renderer**: `formatTemperature` (exported, the value only, mirror of `formatTimerDuration`) shared by `element.ts` and `gram cook`. The note is always in the sentence (HTML, Markdown, text, print). In HTML it sits outside the pill in a `temp-group` span (new `classes.temperatureGroup`), so the line may break before it despite `.gram-nobr`; the note reuses `classes.prepText` (`.prep`), already styled in the recipe view. A temperature without a note keeps its exact DOM. - **CLI**: `gram cook` shows temperatures like the views (`180 °C`, temperatures in words too) with their note; `gram diff` prints the note; the `gram import` prompt keeps the oven mode as a note. - **Language server**: the closing brace is found with `indexOf` after `{`, not `lastIndexOf`, so a `}` inside a note is not taken for it. - **Conformance / audit**: new case `047-temperature-note` (glued, named, in words, spaced, empty, unclosed); `legacy-1.3.0` ignores `note` on temperatures; the audit knows `Temperature:hasNote`. - **Docs** (en + fr): temperatures page (section with `<Since v="1.5.0" />` and a caution on the glued rule), cheatsheet, AI generation notes, `llms-full.txt`. ## Checks - `bun run build`, `bun run typecheck`, `bun run lint`, `bun run deprecations:check`. - `bun test`: 3221 pass, no snapshot regenerated. - `bun run conformance`: 121 cases, no existing golden changed; `legacy-1.3.0` digests unchanged. - Audit: same number of flags as before, none on `Temperature:hasNote`. - Docs build OK (playground chunk 1014.7 KB / 1040 KB). - Not yet checked by eye in the playground (recipe view on screen and in print, run sheet, highlighting). - Changeset: `temperature-note.md` (parser, kitchen, analyzer, renderer, cli, minor).
abiwab merged commit 7c5e64d5d7 into dev/1.5 2026-11-16 23:22:16 +01:00
abiwab deleted branch feat/temperature-note 2026-11-16 23:22:17 +01:00
Sign in to join this conversation.
No description provided.