feat(docs): update homepage previews, scheduling review and renderer styles #130

Merged
abiwab merged 7 commits from docs/previews-and-styles into main 2026-11-11 21:43:26 +01:00
19 changed files with 631 additions and 477 deletions

View file

@ -130,6 +130,7 @@
"@astrojs/check": "^0.9.10", "@astrojs/check": "^0.9.10",
"@types/mdast": "^4.0.4", "@types/mdast": "^4.0.4",
"starlight-links-validator": "^0.26.0", "starlight-links-validator": "^0.26.0",
"vue-tsc": "^3.3.14",
}, },
}, },
"packages/format": { "packages/format": {
@ -1049,7 +1050,7 @@
"@volar/source-map": ["@volar/source-map@2.4.28", "", {}, "sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ=="], "@volar/source-map": ["@volar/source-map@2.4.28", "", {}, "sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ=="],
"@volar/typescript": ["@volar/typescript@2.4.28", "", { "dependencies": { "@volar/language-core": "2.4.28", "path-browserify": "^1.0.1", "vscode-uri": "^3.0.8" } }, "sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw=="], "@volar/typescript": ["@volar/typescript@2.4.30", "", { "dependencies": { "@volar/language-core": "2.4.30", "@volar/language-service": "2.4.30", "path-browserify": "^1.0.1", "vscode-uri": "^3.0.8" }, "peerDependencies": { "typescript": "<7" }, "optionalPeers": ["typescript"] }, "sha512-/DgA5tgYFPfrLFuSjIMXMGHk1LQv2+P8eny6+BhGNzFJELWIW7UZlc56ZLIRFhLsPpMfIFxM8/HvOPBggrjTZg=="],
"@vscode/emmet-helper": ["@vscode/emmet-helper@2.11.0", "", { "dependencies": { "emmet": "^2.4.3", "jsonc-parser": "^2.3.0", "vscode-languageserver-textdocument": "^1.0.1", "vscode-languageserver-types": "^3.15.1", "vscode-uri": "^3.0.8" } }, "sha512-QLxjQR3imPZPQltfbWRnHU6JecWTF1QSWhx3GAKQpslx7y3Dp6sIIXhKjiUJ/BR9FX8PVthjr9PD6pNwOJfAzw=="], "@vscode/emmet-helper": ["@vscode/emmet-helper@2.11.0", "", { "dependencies": { "emmet": "^2.4.3", "jsonc-parser": "^2.3.0", "vscode-languageserver-textdocument": "^1.0.1", "vscode-languageserver-types": "^3.15.1", "vscode-uri": "^3.0.8" } }, "sha512-QLxjQR3imPZPQltfbWRnHU6JecWTF1QSWhx3GAKQpslx7y3Dp6sIIXhKjiUJ/BR9FX8PVthjr9PD6pNwOJfAzw=="],
@ -1097,6 +1098,8 @@
"@vue/devtools-shared": ["@vue/devtools-shared@8.2.1", "", {}, "sha512-Fkac7lUdGReh6pVOi3AYPRGe82LQqRmAfThW7RRligOAP0ZA/Z1z9XLHDM9dv34pV2HRc79DK8uKPeG2fLnA/g=="], "@vue/devtools-shared": ["@vue/devtools-shared@8.2.1", "", {}, "sha512-Fkac7lUdGReh6pVOi3AYPRGe82LQqRmAfThW7RRligOAP0ZA/Z1z9XLHDM9dv34pV2HRc79DK8uKPeG2fLnA/g=="],
"@vue/language-core": ["@vue/language-core@3.3.14", "", { "dependencies": { "@volar/language-core": "2.4.30", "@vue/compiler-dom": "^3.5.0", "@vue/shared": "^3.5.0", "alien-signals": "^3.2.1", "muggle-string": "^0.4.1", "path-browserify": "^1.0.1", "picomatch": "^4.0.4" } }, "sha512-kRB+3hHg0c+BdD1XLAvwjVMQd5pC05zijSlPDRI3ERvC/s04JlRs5upy2KjeMg/9m9oD5zuMVh9yVvkKfZqoJg=="],
"@vue/reactivity": ["@vue/reactivity@3.5.39", "", { "dependencies": { "@vue/shared": "3.5.39" } }, "sha512-TpsuBJ9gGlZa5d23XcM2y8EXanz9dZeVDQBXRwzy46ItgvM+rWpzs+UVM0wcRLxGvcav0HE5jz2gNL53xlRAog=="], "@vue/reactivity": ["@vue/reactivity@3.5.39", "", { "dependencies": { "@vue/shared": "3.5.39" } }, "sha512-TpsuBJ9gGlZa5d23XcM2y8EXanz9dZeVDQBXRwzy46ItgvM+rWpzs+UVM0wcRLxGvcav0HE5jz2gNL53xlRAog=="],
"@vue/runtime-core": ["@vue/runtime-core@3.5.39", "", { "dependencies": { "@vue/reactivity": "3.5.39", "@vue/shared": "3.5.39" } }, "sha512-9GLtNyRvPAUMbX+7ono0RC2j0guo2LXVi8LvcmAooImACUKm0oFf0jjwbX8/H0AE/t1nxhAkn8RSl9PMCzzxZw=="], "@vue/runtime-core": ["@vue/runtime-core@3.5.39", "", { "dependencies": { "@vue/reactivity": "3.5.39", "@vue/shared": "3.5.39" } }, "sha512-9GLtNyRvPAUMbX+7ono0RC2j0guo2LXVi8LvcmAooImACUKm0oFf0jjwbX8/H0AE/t1nxhAkn8RSl9PMCzzxZw=="],
@ -2301,6 +2304,8 @@
"vue": ["vue@3.5.39", "", { "dependencies": { "@vue/compiler-dom": "3.5.39", "@vue/compiler-sfc": "3.5.39", "@vue/runtime-dom": "3.5.39", "@vue/server-renderer": "3.5.39", "@vue/shared": "3.5.39" }, "peerDependencies": { "typescript": "*" }, "optionalPeers": ["typescript"] }, "sha512-xmZCYabFGcirU8r0fTuvl/LICc1OU620rnqepaJDL/a141ZigkG7AyaxQLdqJ02ZRYzWe6YPaDHeQx7MfknQfA=="], "vue": ["vue@3.5.39", "", { "dependencies": { "@vue/compiler-dom": "3.5.39", "@vue/compiler-sfc": "3.5.39", "@vue/runtime-dom": "3.5.39", "@vue/server-renderer": "3.5.39", "@vue/shared": "3.5.39" }, "peerDependencies": { "typescript": "*" }, "optionalPeers": ["typescript"] }, "sha512-xmZCYabFGcirU8r0fTuvl/LICc1OU620rnqepaJDL/a141ZigkG7AyaxQLdqJ02ZRYzWe6YPaDHeQx7MfknQfA=="],
"vue-tsc": ["vue-tsc@3.3.14", "", { "dependencies": { "@volar/typescript": "2.4.30", "@vue/language-core": "3.3.14" }, "peerDependencies": { "typescript": ">=5.0.0" }, "bin": { "vue-tsc": "./bin/vue-tsc.js" } }, "sha512-URAu2H9AuMZMg9GCgnqbaHHHd8pBZRAwNV2e2yYS8VDsoTVXHiOSo663OS6DkEvauQ2yixn5TPFJ9WV9QIspkA=="],
"w3c-keyname": ["w3c-keyname@2.2.8", "", {}, "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ=="], "w3c-keyname": ["w3c-keyname@2.2.8", "", {}, "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ=="],
"web-namespaces": ["web-namespaces@2.0.1", "", {}, "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ=="], "web-namespaces": ["web-namespaces@2.0.1", "", {}, "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ=="],
@ -2357,8 +2362,16 @@
"@img/sharp-wasm32/@emnapi/runtime": ["@emnapi/runtime@1.11.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA=="], "@img/sharp-wasm32/@emnapi/runtime": ["@emnapi/runtime@1.11.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA=="],
"@volar/kit/@volar/typescript": ["@volar/typescript@2.4.28", "", { "dependencies": { "@volar/language-core": "2.4.28", "path-browserify": "^1.0.1", "vscode-uri": "^3.0.8" } }, "sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw=="],
"@volar/language-server/@volar/typescript": ["@volar/typescript@2.4.28", "", { "dependencies": { "@volar/language-core": "2.4.28", "path-browserify": "^1.0.1", "vscode-uri": "^3.0.8" } }, "sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw=="],
"@volar/language-server/vscode-languageserver": ["vscode-languageserver@9.0.1", "", { "dependencies": { "vscode-languageserver-protocol": "3.17.5" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" } }, "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g=="], "@volar/language-server/vscode-languageserver": ["vscode-languageserver@9.0.1", "", { "dependencies": { "vscode-languageserver-protocol": "3.17.5" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" } }, "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g=="],
"@volar/typescript/@volar/language-core": ["@volar/language-core@2.4.30", "", { "dependencies": { "@volar/source-map": "2.4.30" } }, "sha512-73fjwEV8wat6aOZ6U/y/hqtE30ocrIWECg67b0txGczOMNw+MffLmvJ5fnFfN9drVUEYZzLdaNo6VAy6G6avMw=="],
"@volar/typescript/@volar/language-service": ["@volar/language-service@2.4.30", "", { "dependencies": { "@volar/language-core": "2.4.30", "vscode-languageserver-protocol": "^3.17.5", "vscode-languageserver-textdocument": "^1.0.11", "vscode-uri": "^3.0.8" }, "peerDependencies": { "typescript": "<7" }, "optionalPeers": ["typescript"] }, "sha512-w/xDsASiqC71ggCOm7sTDXDNk/l72XEptodeRC68tgZ0e5QM4hM3zAqBGC7mBctvhrpYwKfMG+t9xcUo2hEFtA=="],
"@vscode/emmet-helper/jsonc-parser": ["jsonc-parser@2.3.1", "", {}, "sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg=="], "@vscode/emmet-helper/jsonc-parser": ["jsonc-parser@2.3.1", "", {}, "sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg=="],
"@vscode/vsce/marked": ["marked@18.0.14", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-mBHK6FBHuBAlhgRe88w9F0O1AbwwXJUcQibUbC/QcdTbVGAD7aWza+xt3N6oT/jCZx3/OMeS+8rnuiHZcQ9s7A=="], "@vscode/vsce/marked": ["marked@18.0.14", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-mBHK6FBHuBAlhgRe88w9F0O1AbwwXJUcQibUbC/QcdTbVGAD7aWza+xt3N6oT/jCZx3/OMeS+8rnuiHZcQ9s7A=="],
@ -2371,6 +2384,8 @@
"@vue/compiler-sfc/magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="], "@vue/compiler-sfc/magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="],
"@vue/language-core/@volar/language-core": ["@volar/language-core@2.4.30", "", { "dependencies": { "@volar/source-map": "2.4.30" } }, "sha512-73fjwEV8wat6aOZ6U/y/hqtE30ocrIWECg67b0txGczOMNw+MffLmvJ5fnFfN9drVUEYZzLdaNo6VAy6G6avMw=="],
"anymatch/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], "anymatch/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="],
"cliui/string-width": ["string-width@7.2.0", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="], "cliui/string-width": ["string-width@7.2.0", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="],
@ -2447,6 +2462,10 @@
"@volar/language-server/vscode-languageserver/vscode-languageserver-protocol": ["vscode-languageserver-protocol@3.17.5", "", { "dependencies": { "vscode-jsonrpc": "8.2.0", "vscode-languageserver-types": "3.17.5" } }, "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg=="], "@volar/language-server/vscode-languageserver/vscode-languageserver-protocol": ["vscode-languageserver-protocol@3.17.5", "", { "dependencies": { "vscode-jsonrpc": "8.2.0", "vscode-languageserver-types": "3.17.5" } }, "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg=="],
"@volar/typescript/@volar/language-core/@volar/source-map": ["@volar/source-map@2.4.30", "", {}, "sha512-zym1ob/KwDDyN+0jGVtxwbxJSRRnUvv5HspCtz3yEfVVdCG4/dzxJktMGPAgemqRuVs81O0o/y0q3qOUErR8kg=="],
"@vue/language-core/@volar/language-core/@volar/source-map": ["@volar/source-map@2.4.30", "", {}, "sha512-zym1ob/KwDDyN+0jGVtxwbxJSRRnUvv5HspCtz3yEfVVdCG4/dzxJktMGPAgemqRuVs81O0o/y0q3qOUErR8kg=="],
"csso/css-tree/mdn-data": ["mdn-data@2.0.28", "", {}, "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g=="], "csso/css-tree/mdn-data": ["mdn-data@2.0.28", "", {}, "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g=="],
"cytoscape-fcose/cose-base/layout-base": ["layout-base@2.0.1", "", {}, "sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg=="], "cytoscape-fcose/cose-base/layout-base": ["layout-base@2.0.1", "", {}, "sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg=="],

View file

@ -12,7 +12,7 @@
"build": "astro build && node scripts/check-bundle-size.mjs", "build": "astro build && node scripts/check-bundle-size.mjs",
"preview": "astro preview", "preview": "astro preview",
"astro": "astro", "astro": "astro",
"typecheck": "astro check" "typecheck": "astro check && vue-tsc --noEmit"
}, },
"dependencies": { "dependencies": {
"@astrojs/markdown-remark": "^7.3.0", "@astrojs/markdown-remark": "^7.3.0",
@ -43,6 +43,7 @@
"devDependencies": { "devDependencies": {
"@astrojs/check": "^0.9.10", "@astrojs/check": "^0.9.10",
"@types/mdast": "^4.0.4", "@types/mdast": "^4.0.4",
"starlight-links-validator": "^0.26.0" "starlight-links-validator": "^0.26.0",
"vue-tsc": "^3.3.14"
} }
} }

View file

@ -25,14 +25,20 @@ const {
gramLang, gramLang,
codeThemes, codeThemes,
} = Astro.props; } = Astro.props;
// The last word and the link stay together (a link alone on a line reads as
// orphaned): the link is an inline-block, before which a browser may break
// even after a no-break space, so both go in one nowrap span.
const lastSpace = desc.lastIndexOf(" ");
const descHead = lastSpace === -1 ? "" : desc.slice(0, lastSpace + 1);
const descTail = lastSpace === -1 ? desc : desc.slice(lastSpace + 1);
--- ---
<div class="feature-panel" id={id}> <div class="feature-panel" id={id}>
<p class="feature-desc"> <p class="feature-desc">
{desc} {descHead}<span class="desc-tail">{descTail}&nbsp;<a href={link} class="learn-more-link">
<a href={link} class="learn-more-link" style="margin-left: 0.5rem;">
{learnMoreText}{title && <span class="sr-only">: {title}</span>}<span aria-hidden="true"> &rarr;</span> {learnMoreText}{title && <span class="sr-only">: {title}</span>}<span aria-hidden="true"> &rarr;</span>
</a> </a></span>
</p> </p>
<div class="feature-columns"> <div class="feature-columns">
<div class="col-input"> <div class="col-input">
@ -189,6 +195,10 @@ const {
height: 100%; height: 100%;
} }
.desc-tail {
white-space: nowrap;
}
.learn-more-link { .learn-more-link {
display: inline-block; display: inline-block;
font-weight: 600; font-weight: 600;

View file

@ -6,7 +6,7 @@ import gramGrammar from "@gram-lang/parser/textmate";
import FeaturePanel from "./FeaturePanel.astro"; import FeaturePanel from "./FeaturePanel.astro";
import { GRAM_VERSION } from "../lib/gram-version"; import { GRAM_VERSION } from "../lib/gram-version";
import { NUTRIENTS, type NutrientKey } from "@gram-lang/analyzer"; import { NUTRIENTS, type NutrientKey } from "@gram-lang/analyzer";
import { nutritionGroups } from "@gram-lang/renderer"; import { nutritionRows } from "@gram-lang/renderer";
import { getDictionary } from "@gram-lang/i18n"; import { getDictionary } from "@gram-lang/i18n";
const { lang, t } = Astro.props; const { lang, t } = Astro.props;
@ -21,28 +21,42 @@ const codeThemes: Record<string, any> = {
// grouping from `nutritionGroups()` keeps the two from drifting apart. // grouping from `nutritionGroups()` keeps the two from drifting apart.
const nutritionDict = getDictionary(lang); const nutritionDict = getDictionary(lang);
// Per-portion figures for the Chantilly mockup: one quarter of a 269 g batch // Per-portion figures for the Chantilly mockup: one quarter of a 259 g batch
// (240 g cream + 25 g powdered sugar + 4 g vanilla), the recipe shown in // (240 g cream + 15 g powdered sugar + 4 g vanilla), the recipe shown in
// `nutritionInput`. Values match the renderer's own output. // `nutritionInput`. Values match the renderer's own output.
const MOCK_PORTION_GRAMS = 259 / 4;
const MOCK_NUTRITION_VALUES: Partial<Record<NutrientKey, number>> = { const MOCK_NUTRITION_VALUES: Partial<Record<NutrientKey, number>> = {
calories: 231, calories: 220,
fat: 22, fat: 21.6,
carbs: 6.5, carbs: 5.5,
sugar: 6.3, sugar: 5.5,
fiber: 0, fiber: 0,
protein: 1.5, protein: 1.4,
sodium: 11, sodium: 11,
}; };
const per100Values = Object.fromEntries(
Object.entries(MOCK_NUTRITION_VALUES).map(([k, v]) => [
k,
(v as number) * (100 / MOCK_PORTION_GRAMS),
]),
);
const mockNutrientGroups = nutritionGroups(MOCK_NUTRITION_VALUES as any, lang); // The rows come from the renderer, so the labels and their order follow the
// real table; the mockup is only its simplified picture (two columns, no %RI).
// The recipe declares `portions: 4`, so the real panel offers all three bases const round1 = (n: number) => Math.round(n * 10) / 10;
// and opens on per-portion. const portionRows = nutritionRows(MOCK_NUTRITION_VALUES as any, lang);
const mockBases = [ const per100Rows = nutritionRows(per100Values as any, lang);
{ label: nutritionDict.renderer.nutritionPerPortion, active: true }, const kcalPortion = Math.round(MOCK_NUTRITION_VALUES.calories ?? 0);
{ label: nutritionDict.renderer.nutritionPer100g, active: false }, const kcal100 = Math.round(per100Values.calories ?? 0);
{ label: nutritionDict.renderer.nutritionWholeRecipe, active: false }, const kj = (kcal: number) => Math.round(kcal * 4.184);
]; const mockNutrientRows = portionRows
.filter((r) => r.key !== "calories")
.map((r) => ({
label: r.label,
nested: r.nested,
portion: `${round1(r.value)} ${r.unit}`,
per100: `${round1(per100Rows.find((x) => x.key === r.key)?.value ?? 0)} ${r.unit}`,
}));
--- ---
<Layout title="Gram" description={t.metaDescription} currentLang={lang}> <Layout title="Gram" description={t.metaDescription} currentLang={lang}>
@ -156,90 +170,51 @@ const mockBases = [
gramLang={gramLang} gramLang={gramLang}
codeThemes={codeThemes} codeThemes={codeThemes}
> >
<div class="modern-mockup-card nut-card-mock" role="region" aria-label={nutritionDict.renderer.nutrition}> <div class="modern-mockup-card nut-card-mock" role="region" aria-label={nutritionDict.renderer.nutritionTableTitle}>
<div class="mockup-steps"> <ul class="kit-mock">
<ol class="gram-steps" aria-label={lang === "fr" ? "Étapes de la recette Chantilly" : "Chantilly recipe steps"}> <li>
<li> <span class="kit-mock-name">{lang === "fr" ? "crème liquide" : "heavy cream"}</span>
<span class="action" <span class="kit-mock-qty"><span class="kit-mock-orig">{lang === "fr" ? "1 tasse" : "1 cup"}</span><strong>240 g</strong></span>
>{lang === "fr" ? "Fouetter" : "Whisk"}</span </li>
> <li>
{lang === "fr" ? "La " : ""}<strong <span class="kit-mock-name">{lang === "fr" ? "sucre glace" : "powdered sugar"}</span>
>{ <span class="kit-mock-qty"><span class="kit-mock-orig">{lang === "fr" ? "2 c.à.s" : "2 tbsp"}</span><strong>15 g</strong></span>
lang === "fr" ? "crème liquide" : "Heavy cream" </li>
}</strong <li>
> (240g) <span class="kit-mock-name">{lang === "fr" ? "extrait de vanille" : "vanilla extract"}</span>
{lang === "fr" ? " et le " : " and "} <span class="kit-mock-qty"><span class="kit-mock-orig">{lang === "fr" ? "1 c.à.c" : "1 tsp"}</span><strong>4 g</strong></span>
<strong </li>
>{ </ul>
lang === "fr" ? "sucre glace" : "powdered sugar" <div class="nut-panel-mock">
}</strong
> (25g)
{
lang === "fr"
? " jusqu'à obtenir des pics souples."
: " until soft peaks form."
}
</li>
<li>
<span class="action"
>{lang === "fr" ? "Incorporer" : "Fold"}</span
>
{
lang === "fr"
? "Ajouter délicatement l'"
: "Gently incorporate "
}<strong
>{
lang === "fr"
? "extrait de vanille"
: "vanilla extract"
}</strong
> (4g).
</li>
</ol>
</div>
<div class="nut-panel-mock" role="group" aria-label={nutritionDict.renderer.nutrition}>
<div class="nut-header-mock"> <div class="nut-header-mock">
{nutritionDict.renderer.nutrition} <strong>{nutritionDict.renderer.nutritionTableTitle}</strong>
<span>{nutritionDict.renderer.estimateTooltip}</span> <span>{nutritionDict.renderer.estimateTooltip}</span>
</div> </div>
<div class="nut-basis-switch-mock" role="group" aria-label={lang === "fr" ? "Base de calcul nutritionnel" : "Nutrition calculation basis"}> <table class="nut-table-mock">
{ <thead>
mockBases.map((basis) => ( <tr>
<span <th scope="col"><span class="sr-only">{nutritionDict.renderer.nutritionNutrient}</span></th>
class:list={["pill", { active: basis.active }]} <th scope="col">{nutritionDict.renderer.nutritionPerPortion}</th>
aria-current={basis.active ? "true" : undefined} <th scope="col">{nutritionDict.renderer.nutritionPer100g}</th>
> </tr>
{basis.label} </thead>
</span> <tbody>
)) <tr class="nut-energy-mock">
} <th scope="row">{nutritionDict.renderer.nutrients.calories}</th>
</div> <td><span class="kcal">{kcalPortion} kcal</span><span class="kj">{kj(kcalPortion)} kJ</span></td>
<div class="nut-grid-mock"> <td><span class="kcal">{kcal100} kcal</span><span class="kj">{kj(kcal100)} kJ</span></td>
{ </tr>
mockNutrientGroups.map((group) => ( {
<div class="nut-item-mock"> mockNutrientRows.map((row) => (
<span class="label">{group.label}</span> <tr class:list={{ nested: row.nested }}>
<strong> <th scope="row">{row.label}</th>
{group.value}{" "} <td>{row.portion}</td>
<span class="unit">{group.unit}</span> <td>{row.per100}</td>
</strong> </tr>
{group.children.length > 0 && ( ))
<ul class="nut-item-children" aria-label={group.label}> }
{group.children.map((child) => ( </tbody>
<li> </table>
<span class="label">{child.label}</span>
<span class="value">
{child.value} {child.unit}
</span>
</li>
))}
</ul>
)}
</div>
))
}
</div>
</div> </div>
</div> </div>
</FeaturePanel> </FeaturePanel>
@ -264,45 +239,46 @@ const mockBases = [
<div <div
class="modern-mockup-card timeline-mockup-card" class="modern-mockup-card timeline-mockup-card"
role="region" role="region"
aria-label={lang === "fr" ? "Aperçu de la planification et du rétro-planning" : "Schedule and timeline preview"} aria-label={nutritionDict.renderer.outputs.runSheet}
> >
<div class="sr-only"> <div class="sr-only">
{lang === "fr" {lang === "fr"
? "Plan de marche pour le samedi 17 octobre à 20 h : un passage en cuisine de 19 h 40 à 20 h. À sortir : pâtes, tomates cerises, ail, huile d'olive, basilic. Au programme : cuire 10 minutes, sauter 5 minutes, mélanger." ? "Plan de marche de la tarte au citron servie le samedi 21 novembre à 20 h. Vendredi : un passage en cuisine à 19 h 50 pour la pâte, qui repose au frais. Samedi : un passage à 19 h 40 pour la tarte, puis service à 20 h."
: "Run sheet for Saturday, October 17 at 8 p.m.: one visit to the kitchen from 7:40 to 8 p.m. To take out: pasta, cherry tomatoes, garlic, olive oil, basil. To do: boil 10 minutes, sauté 5 minutes, toss."} : "Run sheet for the lemon tart served Saturday, November 21 at 8 p.m. Friday: a visit to the kitchen at 7:50 p.m. for the dough, which rests in the fridge. Saturday: a visit at 7:40 p.m. for the tart, then serving at 8 p.m."}
</div> </div>
<div class="plan-mock" aria-hidden="true"> <div class="plan-mock" aria-hidden="true">
<div class="plan-mock-header"> <h4 class="plan-mock-title">{lang === "fr" ? "Tarte au citron" : "Lemon Tart"}</h4>
<strong>{lang === "fr" ? "Plan de marche" : "Run sheet"}</strong> <p class="plan-mock-subtitle">{lang === "fr" ? "Pour le samedi 21 novembre à 20:00" : "For Saturday, November 21 at 20:00"}</p>
<span>{lang === "fr" ? "Pour le samedi 17 octobre à 20:00" : "For Saturday, October 17 at 20:00"}</span> <p class="plan-mock-summary">{lang === "fr" ? "2 jours · 2 passages en cuisine · 35min de travail en tout" : "2 days · 2 visits to the kitchen · 35min of work in all"}</p>
</div> <div class="plan-mock-schedule">
<div class="plan-mock-row"> <div class="plan-mock-group">
<span class="plan-mock-day">{lang === "fr" ? "SAM. 17" : "SAT 17"}</span> <div class="plan-mock-day">{lang === "fr" ? "VEN." : "FRI"}<small>20</small></div>
<span class="plan-mock-time">19:40 – 20:00</span> <div class="plan-mock-rows">
<span>Tomato Basil Pasta</span> <div class="plan-mock-row plan-mock-visit">
</div> <span class="plan-mock-time">■ 19:50 – 20:00</span>
<div class="plan-mock-row plan-mock-serve"> <span>{lang === "fr" ? "Pâte" : "Dough"}</span>
<span class="plan-mock-day"></span> </div>
<span class="plan-mock-time">★ 20:00</span> <div class="plan-mock-row plan-mock-thread">
<span>{lang === "fr" ? "Servir" : "Serve"}</span> <span class="plan-mock-time"><i></i></span>
</div> <span>{lang === "fr" ? "Pâte : Reposer 8h à 1j" : "Dough : Chill 8h to 1d"}</span>
<div class="plan-mock-lists"> </div>
<div> </div>
<div class="plan-mock-label">{lang === "fr" ? "À sortir" : "To take out"}</div>
<ul>
<li>pasta 200 g</li>
<li>cherry tomatoes 200 g</li>
<li>garlic 2 cloves</li>
<li>olive oil</li>
<li>fresh basil 1 handful</li>
</ul>
</div> </div>
<div> <div class="plan-mock-group">
<div class="plan-mock-label">{lang === "fr" ? "Au programme" : "To do"}</div> <div class="plan-mock-day">{lang === "fr" ? "SAM." : "SAT"}<small>21</small></div>
<p>Tomato Basil Pasta <small>({lang === "fr" ? "étapes 1 à 3" : "steps 1 to 3"})</small></p> <div class="plan-mock-rows">
<p class="plan-mock-steps">Boil 10 min › Sauté 5 min › Toss</p> <div class="plan-mock-row plan-mock-visit">
<span class="plan-mock-time">■ 19:40 – 20:00</span>
<span>{lang === "fr" ? "Tarte" : "Tart"}</span>
</div>
<div class="plan-mock-row plan-mock-serve">
<span class="plan-mock-time">★ 20:00</span>
<span>{lang === "fr" ? "Servir" : "Serve"}</span>
</div>
</div>
</div> </div>
</div> </div>
<p class="plan-mock-legend"><span>■ {nutritionDict.renderer.runSheetLegendCook}</span><span>┆ {nutritionDict.renderer.runSheetLegendThread}</span></p>
</div> </div>
</div> </div>
</FeaturePanel> </FeaturePanel>
@ -1000,189 +976,227 @@ const mockBases = [
border: 1px solid var(--sl-color-border); border: 1px solid var(--sl-color-border);
} }
/* Nutrition Panel Mockup */ /* Nutrition mockup: a simplified picture of the recipe view's ingredient
.nut-panel-mock { lines and nutrition table (renderer/src/views/recipe/screen.css). */
background-color: var(--sl-color-bg-nav); .nut-card-mock {
padding: 0.75rem; padding: 0.5rem 1rem 1rem;
border: 1px solid var(--sl-color-border);
margin: 0rem 1rem 1rem 1rem;
} }
.nut-header-mock { .kit-mock {
font-size: 1.1rem; list-style: none;
font-weight: 600; margin: 0 0 1rem;
margin-bottom: 0.5rem; padding: 0.6rem 0.9rem;
border: 1px solid var(--sl-color-border);
}
.kit-mock li {
display: flex; display: flex;
align-items: center; align-items: baseline;
gap: 6px; gap: 0.5rem;
margin: 0;
padding: 0.2rem 0;
color: var(--sl-color-white); color: var(--sl-color-white);
} }
.kit-mock li::after {
content: "";
order: 1;
flex: 1;
border-bottom: 2px dotted var(--sl-color-border);
}
.kit-mock-name {
order: 0;
}
.kit-mock-qty {
order: 2;
display: flex;
gap: 0.5rem;
align-items: baseline;
font-family: var(--sl-font-mono);
font-variant-ligatures: none;
font-size: 1rem;
white-space: nowrap;
}
.kit-mock-orig {
font-size: 0.9rem;
color: var(--sl-color-gray-3);
}
.kit-mock-qty strong {
color: var(--sl-color-white);
}
.nut-panel-mock {
max-width: 30rem;
padding: 0.6rem 0.9rem;
border: 1px solid var(--sl-color-white);
color: var(--sl-color-white);
}
.nut-header-mock {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
margin-bottom: 0.4rem;
}
.nut-header-mock strong {
font-size: 1.15rem;
font-weight: 800;
}
.nut-header-mock span { .nut-header-mock span {
font-size: 0.6em; font-size: 0.6rem;
text-transform: uppercase; text-transform: uppercase;
background-color: var(--sl-color-gray-3); background-color: var(--sl-color-gray-3);
padding: 2px 6px; padding: 2px 6px;
font-weight: 700; font-weight: 700;
color: var(--sl-color-bg); color: var(--sl-color-bg);
} }
/* Mirrors the real panel's basis switch (renderer/src/views/recipe/screen.css), which is a set .nut-table-mock {
of radio inputs there and a static picture here. */ width: 100%;
.nut-basis-switch-mock { border-collapse: collapse;
display: inline-flex; border-block: 6px solid var(--sl-color-white);
gap: 2px; font-size: 0.95rem;
margin-bottom: 0.6rem; font-variant-numeric: tabular-nums;
padding: 2px;
background-color: var(--sl-color-gray-6);
} }
.nut-basis-switch-mock .pill { .nut-table-mock th,
font-size: 0.7em; .nut-table-mock td {
font-weight: 600; padding: 4px 0 4px 0.75rem;
padding: 4px 10px; text-align: right;
white-space: nowrap; white-space: nowrap;
color: var(--sl-color-gray-2); vertical-align: top;
}
.nut-basis-switch-mock .pill.active {
background-color: var(--sl-color-bg);
color: var(--sl-color-white);
}
.nut-grid-mock {
display: grid;
gap: 6px;
grid-template-columns: repeat(2, 1fr);
grid-auto-rows: min-content;
}
@media (min-width: 480px) {
.nut-grid-mock {
grid-template-columns: repeat(3, 1fr);
}
}
.nut-item-mock {
display: flex;
flex-direction: column;
gap: 2px;
background-color: var(--sl-color-bg);
padding: 8px 10px;
border: 1px solid var(--sl-color-hairline);
}
.nut-item-mock .label {
font-size: 0.65em;
text-transform: uppercase;
color: var(--sl-color-gray-3);
font-weight: 600;
}
.nut-item-mock strong {
font-size: 1.05em;
font-family: var(--sl-font-mono);
font-variant-ligatures: none;
color: var(--sl-color-white);
}
.nut-item-mock strong .unit {
font-size: 0.85em;
font-weight: 400;
color: var(--sl-color-gray-3);
}
.nut-item-children {
list-style: none;
margin: 0;
padding: 0px 0 0 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.nut-item-children li {
display: flex;
justify-content: space-between;
align-items: baseline;
gap: 4px;
font-size: 0.7em;
color: var(--sl-color-gray-3);
}
.nut-item-children .label {
font-size: 0.95em;
text-transform: none;
color: var(--sl-color-gray-3);
font-weight: 400;
}
.nut-item-children .value {
font-family: var(--sl-font-mono);
font-variant-ligatures: none;
font-weight: 600;
color: var(--sl-color-gray-2);
white-space: nowrap;
}
/* Run sheet mockup */
.timeline-mockup-card {
padding: 1rem 0;
}
.plan-mock {
padding: 0 1.5rem;
font-size: 0.9rem;
color: var(--sl-color-gray-2);
}
.plan-mock-header {
display: flex;
flex-wrap: wrap;
gap: 0.25rem 1rem;
padding-bottom: 0.75rem;
margin-bottom: 0.75rem;
border-bottom: 1px solid var(--sl-color-border); border-bottom: 1px solid var(--sl-color-border);
}
.nut-table-mock th:first-child {
padding-left: 0;
text-align: left;
white-space: normal;
}
.nut-table-mock thead th {
font-size: 0.85rem;
border-bottom: 2px solid var(--sl-color-white);
}
.nut-table-mock tbody th {
font-weight: 700;
}
.nut-table-mock tbody tr:last-child > * {
border-bottom: none;
}
.nut-table-mock tr.nested th {
padding-left: 1rem;
font-weight: 400;
}
.nut-table-mock .nut-energy-mock > * {
border-bottom: 4px solid var(--sl-color-white);
}
.nut-table-mock .kcal {
display: block;
font-size: 1.4rem;
font-weight: 800;
line-height: 1.1;
}
.nut-table-mock .kj {
display: block;
font-size: 0.85rem; font-size: 0.85rem;
color: var(--sl-color-gray-3); color: var(--sl-color-gray-3);
} }
.plan-mock-header strong {
/* Run sheet mockup: a simplified picture of the run sheet view
(renderer/src/views/run-sheet/screen.css). */
.timeline-mockup-card {
padding: 1rem 1.25rem;
}
.plan-mock {
font-size: 0.9rem;
color: var(--sl-color-gray-2);
}
.plan-mock-title {
margin: 0 0 0.25rem;
font-size: 1.3rem;
font-weight: 800;
}
.plan-mock-summary {
margin: 0 0 0.9rem;
padding: 0.35rem 0.6rem;
border: 1px solid var(--sl-color-border);
background-color: var(--sl-color-bg-nav);
font-family: var(--sl-font-mono);
font-variant-ligatures: none;
font-size: 0.78rem;
font-weight: 700;
text-transform: uppercase;
color: var(--sl-color-white); color: var(--sl-color-white);
} }
.plan-mock-schedule {
border: 1px solid var(--sl-color-border);
}
.plan-mock-group {
display: grid;
grid-template-columns: 4.5rem minmax(0, 1fr);
}
.plan-mock-group + .plan-mock-group {
border-top: 1px solid var(--sl-color-border);
}
.plan-mock-day {
padding: 0.6rem 0.75rem;
border-right: 1px solid var(--sl-color-border);
background-color: var(--sl-color-bg-nav);
font-family: var(--sl-font-mono);
font-variant-ligatures: none;
font-weight: 800;
color: var(--sl-color-white);
}
.plan-mock-day small {
display: block;
font-size: 0.75rem;
font-weight: 400;
color: var(--sl-color-gray-3);
}
.plan-mock-rows {
padding: 0.3rem 0.75rem;
}
.plan-mock-row { .plan-mock-row {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 0.15rem 1rem; gap: 0.1rem 0.75rem;
margin: 0.35rem 0; padding: 0.3rem 0;
} }
.plan-mock-day { .plan-mock-row + .plan-mock-row {
min-width: 4.5rem; border-top: 1px dotted var(--sl-color-border);
font-weight: 600;
color: var(--sl-color-white);
} }
.plan-mock-time { .plan-mock-time {
min-width: 7rem; min-width: 8rem;
font-family: var(--sl-font-mono); font-family: var(--sl-font-mono);
font-variant-ligatures: none; font-variant-ligatures: none;
font-size: 0.82rem;
color: var(--sl-color-gray-3); color: var(--sl-color-gray-3);
} }
.plan-mock-serve { .plan-mock-visit {
font-weight: 600; font-weight: 600;
color: var(--sl-color-white); color: var(--sl-color-white);
} }
.plan-mock-lists { .plan-mock-thread {
display: grid; font-style: italic;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); color: var(--sl-color-gray-3);
gap: 1rem 2rem;
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px solid var(--sl-color-border);
} }
.plan-mock-label { .plan-mock-thread i {
font-size: 0.7rem; display: inline-block;
letter-spacing: 0.1em; min-height: 1.2em;
margin-left: 0.3em;
border-left: 2px dotted var(--sl-color-gray-3);
vertical-align: middle;
}
.plan-mock-serve {
font-weight: 800;
text-transform: uppercase; text-transform: uppercase;
color: var(--sl-color-gray-3); color: var(--sl-color-white);
margin-bottom: 0.4rem;
} }
.plan-mock-lists ul { .plan-mock-subtitle {
list-style: none; margin: 0 0 0.6rem;
margin: 0; font-size: 0.9rem;
padding: 0;
}
.plan-mock-lists li::before {
content: "☐ ";
color: var(--sl-color-gray-3); color: var(--sl-color-gray-3);
} }
.plan-mock-lists p { .plan-mock-legend {
margin: 0; display: flex;
} flex-wrap: wrap;
.plan-mock-steps { gap: 0.2rem 1.25rem;
color: var(--sl-color-accent-high); margin: 0.6rem 0 0;
margin-top: 0.25rem !important; font-size: 0.8rem;
color: var(--sl-color-gray-3);
} }
/* Tabular Mockup */ /* Tabular Mockup */

View file

@ -98,7 +98,7 @@ const bakersReference = computed({
block block
v-model="bakersReference" v-model="bakersReference"
:disabled="!bakersMath" :disabled="!bakersMath"
:options="[{ value: '', label: t.playground.options.autoDetect }, ...props.shoppingList.map((item) => ({ value: item.id, label: item.name }))]" :options="[{ value: '', label: t.playground.options.autoDetect }, ...(props.shoppingList ?? []).map((item) => ({ value: item.id, label: item.name }))]"
/> />
</div> </div>
</OptionsSection> </OptionsSection>

View file

@ -549,6 +549,7 @@ async function updateGram() {
editorRef.value?.setErrorMarker(null, ""); editorRef.value?.setErrorMarker(null, "");
// Which pipeline stage is running, so a thrown error can be attributed to it. // Which pipeline stage is running, so a thrown error can be attributed to it.
let stage: "compose" | "compile" | "analyze" | "render" = "compose"; let stage: "compose" | "compile" | "analyze" | "render" = "compose";
const collectedScaleDiagnostics: PlaygroundDiagnostic[] = [];
try { try {
const host = createPlaygroundHost(new Map(files.value)); const host = createPlaygroundHost(new Map(files.value));
const graph = await loadModuleGraph(previewEntry, host); const graph = await loadModuleGraph(previewEntry, host);
@ -614,7 +615,6 @@ async function updateGram() {
// `fullDatabase` spread last: real DB entries always win on id // `fullDatabase` spread last: real DB entries always win on id
// collision (MODULE_BINDING_SHADOWS_INGREDIENT), same as pipeline.ts. // collision (MODULE_BINDING_SHADOWS_INGREDIENT), same as pipeline.ts.
const database = { ...composed.syntheticIngredients, ...fullDatabase }; const database = { ...composed.syntheticIngredients, ...fullDatabase };
const collectedScaleDiagnostics: PlaygroundDiagnostic[] = [];
const scaled = scaleRecipe( const scaled = scaleRecipe(
result, result,

View file

@ -81,7 +81,8 @@ const counts = computed(() => {
// [] against the old filter instead of falling back to "all", so the console // [] against the old filter instead of falling back to "all", so the console
// looks empty even though a real diagnostic (in another category) exists. // looks empty even though a real diagnostic (in another category) exists.
watch(counts, (newCounts) => { watch(counts, (newCounts) => {
if (activeFilter.value !== "all" && newCounts[activeFilter.value] === 0) { const filter = activeFilter.value;
if (filter !== "all" && newCounts[filter] === 0) {
activeFilter.value = "all"; activeFilter.value = "all";
} }
}); });

View file

@ -265,7 +265,7 @@ function resetSection() {
<GramSelect <GramSelect
block block
v-model="targetId" v-model="targetId"
:options="[{ value: '', label: t.playground.options.selectIngredient }, ...props.shoppingList.map((item) => ({ value: item.id, label: item.name }))]" :options="[{ value: '', label: t.playground.options.selectIngredient }, ...(props.shoppingList ?? []).map((item) => ({ value: item.id, label: item.name }))]"
/> />
<div class="scale-inputs" v-if="targetId"> <div class="scale-inputs" v-if="targetId">
<input <input

View file

@ -188,7 +188,34 @@ To structure a recipe into working days, the scheduling engine relies exclusivel
- **`~{-Nd}` (days) = a distinct working day.** This conveys explicit human intent (*"prepare the day before (D-1)"*, *"two days prior (D-2)"*). Gram then groups the mise en place of those sections into a dedicated working day. - **`~{-Nd}` (days) = a distinct working day.** This conveys explicit human intent (*"prepare the day before (D-1)"*, *"two days prior (D-2)"*). Gram then groups the mise en place of those sections into a dedicated working day.
- **`~{-Nh}` (hours) = a relative deadline within a day.** An anchor such as `~{-2h}` or `~{-36h}` indicates that a step must complete 2 hours (or 36 hours) before serving, but **never** initiates a new working day on its own. Because a `.gram` recipe has no knowledge of actual meal timing, converting hours into calendar days would introduce meal-dependent ambiguity (`~{-12h}` lands in the morning for an 8 p.m. dinner, but at midnight the day before for a noon lunch). - **`~{-Nh}` (hours) = a relative deadline within a day.** An anchor such as `~{-2h}` or `~{-36h}` indicates that a step must complete 2 hours (or 36 hours) before serving, but **never** initiates a new working day on its own. Because a `.gram` recipe has no knowledge of actual meal timing, converting hours into calendar days would introduce meal-dependent ambiguity (`~{-12h}` lands in the morning for an 8 p.m. dinner, but at midnight the day before for a noon lunch).
An unanchored section inherits the day of the **furthest day anchor among downstream sections**, or serving day (Day D) by default. In the example, the crust has no anchor of its own: it is assigned to D-1 alongside the tart, and ALAP scheduling places it as late as possible, immediately prior to assembly. An unanchored section attaches to the day anchor **that follows it** (the furthest one among the sections after it), or to Day D when there is none. This is the opposite of the reading direction, on purpose: the engine reasons backward from serving, and an anchor means "this section, and everything before it that has no anchor, is done by that day at the latest".
:::caution[An anchor does not apply to the sections after it]
In the example, the **crust** has no anchor and is written right after the cream `~{-3d}`, but it is **not** made on D-3. It attaches to the tart `~{-1d}`, which comes after it: it is made on D-1, right before the tart, because scheduling places every step as late as possible.
:::
Here is the run sheet Gram produces for this recipe (`gram plan tart.gram`):
```text
D-3 ▮ ~ 5min Cream
┆ Cream : Chill 1d
D-1 ▮ ~ 40min Crust, Tart
Day D ▮ ~ 5min Serve
★ Serve
```
To make the crust on a day of its own, between the cream and the tart, anchor it explicitly: `## Crust ~{-2d} ->&crust` gives a visit on D-2.
```text
D-3 ▮ ~ 5min Cream
┆ Cream : Chill 1d
D-2 ▮ ~ 5min Crust
D-1 ▮ ~ 35min Tart
Day D ▮ ~ 5min Serve
★ Serve
```
Anchoring the crust at `~{-3d}`, like the cream, makes no sense here: it uses the cream, which rests for 24 hours. Gram accepts it but reports a timeline conflict ("the working day starts before its 24 h window opens").
:::caution[Common pitfalls] :::caution[Common pitfalls]
Two frequent patterns do **not** initiate a new working day: Two frequent patterns do **not** initiate a new working day:
@ -199,7 +226,7 @@ Two frequent patterns do **not** initiate a new working day:
In the example above: In the example above:
- **Cream** is prepared on **D-3**; - **Cream** is prepared on **D-3**;
- **Crust** and **tart** are executed on **D-1**; - **Crust** and **tart** are executed on **D-1** (the crust attaches to the tart, which follows it);
- **Serving** occurs on **Day D**. - **Serving** occurs on **Day D**.
Each working day is designed to fit within the 24 hours preceding the next. If an extensive passive duration forces active work outside this window, Gram emits a `DAY_OVERFLOW` diagnostic and recommends anchoring the section further back. Each working day is designed to fit within the 24 hours preceding the next. If an extensive passive duration forces active work outside this window, Gram emits a `DAY_OVERFLOW` diagnostic and recommends anchoring the section further back.

View file

@ -68,16 +68,23 @@ A wait assigned to a named track (`~_oven{40min}`) is only stretched if that tra
Served on Sunday at 13:00, with `08:00-22:00` daily availability, an 8-hour rise would place the kneading at 04:10. Gram automatically stretches the rise to 14 h 30 so that the kneading finishes at 22:00 on Saturday evening: Served on Sunday at 13:00, with `08:00-22:00` daily availability, an 8-hour rise would place the kneading at 04:10. Gram automatically stretches the rise to 14 h 30 so that the kneading finishes at 22:00 on Saturday evening:
```text ```text
To fix
! The work of Day D falls on Saturday, October 10 instead of Sunday, October 11.
SAT 10 ▮ 21:40 – 22:00 Dough SAT 10 ▮ 21:40 – 22:00 Dough
┆ Dough : Rise 14h 30m (8h to 16h) ┆ Dough : Rise 14h 30min (8h to 16h)
SUN 11 ▮ 12:30 – 13:00 Bake SUN 11 ▮ 12:30 – 13:00 Bake
★ 13:00 Serve ★ 13:00 Serve
SATURDAY, OCTOBER 10 21:40 → 22:00 SATURDAY, OCTOBER 10 21:40 → 22:00
! Dough : Rise extended to 14h 30m (planned 8h to 16h) so the work falls within your availability. ! Dough : Rise extended to 14h 30min (planned 8h to 16h) so the work falls within your availability.
Possible from 20:10. Possible from 20:10.
``` ```
The "To fix" message at the top is expected here. The recipe has no day anchor: all its work is assumed to fall on Day D, the Sunday. But the kneading had to move to Saturday evening, and Gram says so (`DAY_MISMATCH`). The plan is still valid; it is information.
Do not silence it by anchoring the section (`## Dough ~{-1d}`): a day anchor fixes the section's day, and Gram then no longer stretches the rise to fit your availability. If the rise should adapt to your hours, leave the recipe without an anchor.
If the rise were exact (`~_{8h}`), or if the range was too narrow to absorb the offset (`~_{8-10h}`), no adjustment could be made: the scheduler leaves the kneading at 04:10 and logs the diagnostic. If the rise were exact (`~_{8h}`), or if the range was too narrow to absorb the offset (`~_{8-10h}`), no adjustment could be made: the scheduler leaves the kneading at 04:10 and logs the diagnostic.
## Diagnostics and unresolved constraints ## Diagnostics and unresolved constraints
@ -138,7 +145,7 @@ See [Plan a meal](/docs/how-to/plan-a-meal/) for an end-to-end practical guide.
href="/docs/how-to/plan-a-meal/" href="/docs/how-to/plan-a-meal/"
/> />
<LinkCard <LinkCard
title="Mise en place and planning" title="Ingredients, mise en place and planning"
description="How the compiler infers task dependencies, durations, and preparation costs." description="How the compiler infers task dependencies, durations, and preparation costs."
href="/docs/explanation/mise-en-place-and-planning/" href="/docs/explanation/mise-en-place-and-planning/"
/> />

View file

@ -262,8 +262,9 @@ While the parser initially produces a raw Abstract Syntax Tree (AST), `@gram-lan
- `day.entries[]`: ordered sequence of all blocks for the day (active and passive), useful for drawing a detailed custom timeline or day view. - `day.entries[]`: ordered sequence of all blocks for the day (active and passive), useful for drawing a detailed custom timeline or day view.
- `sheet.adjustments[]` and `sheet.diagnostics[]`: lists of passive rests that were adjusted to fit your availability, and unresolved scheduling constraints that triggered warnings. - `sheet.adjustments[]` and `sheet.diagnostics[]`: lists of passive rests that were adjusted to fit your availability, and unresolved scheduling constraints that triggered warnings.
> [!TIP] :::tip
> **Reuse label formatters:** To format ingredient and equipment checklists or step references without rewriting culinary logic, import the modular helper functions from `@gram-lang/renderer`, such as `visitKit()` (ingredients and cookware to take out) and `sectionProgram()` (the section and the range of steps a visit covers). See [the scheduling engine](/docs/explanation/engine/scheduler/#from-the-schedule-to-the-run-sheet) for terminology details. **Reuse label formatters:** To format ingredient and equipment checklists or step references without rewriting culinary logic, import the modular helper functions from `@gram-lang/renderer`, such as `visitKit()` (ingredients and cookware to take out) and `sectionProgram()` (the section and the range of steps a visit covers). See [the scheduling engine](/docs/explanation/engine/scheduler/#from-the-schedule-to-the-run-sheet) for terminology details.
:::
</Steps> </Steps>

View file

@ -42,10 +42,51 @@ The recipe says **how** to do things. The <Term id="runSheet" link={false} /> sa
[Thaw] Thaw in the fridge for ~_{6h}. [Thaw] Thaw in the fridge for ~_{6h}.
``` ```
<details>
<summary>The three bases this recipe imports</summary>
```gram title="bases/pistachio-sponge.gram"
---
title: Pistachio sponge
---
## Sponge ->&sponge
[Mix] Mix @pistachios{80g}, @eggs{3} and @sugar{60g} ~{10min}.
[Bake] Bake at ^{180C} ~{12min}.
```
```gram title="bases/raspberry-insert.gram"
---
title: Raspberry insert
---
## Insert ->&insert
[Cook] Cook @raspberries{200g} and @sugar{40g} ~{5min}.
[Freeze] Let it set in the freezer ~_{12-72h}.
```
```gram title="bases/white-chocolate-glaze.gram"
---
title: White chocolate glaze
---
## Glaze ->&glaze
[Heat] Heat @white chocolate{150g} and @cream{100g} ~{5min}.
```
The durations and times shown below are the ones Gram computes with these three bases.
</details>
See [Exact times and ranges](/docs/reference/syntax/times/#exact-times-and-ranges) and [Days and hours](/docs/reference/syntax/times/#days-and-hours). See [Exact times and ranges](/docs/reference/syntax/times/#exact-times-and-ranges) and [Days and hours](/docs/reference/syntax/times/#days-and-hours).
> [!TIP] :::tip
> **Name your steps with `[Action]`**: The run sheet names steps and background threads after their actions (e.g. `Mousse : Assemble 12h to 48h` in the timeline and in the waits you leave running). Prefixing each step that carries a timer or wait with an `[Action]` ensures clear, descriptive labels there rather than raw durations or generic fallbacks like `Rest`. **Name your steps with `[Action]`**: The run sheet names steps and background threads after their actions (e.g. `Mousse : Assemble 12h to 2d` in the timeline and in the waits you leave running). Prefixing each step that carries a timer or wait with an `[Action]` ensures clear, descriptive labels there rather than raw durations or generic fallbacks like `Rest`.
:::
2. ### Choose when to serve 2. ### Choose when to serve
@ -57,19 +98,20 @@ The recipe says **how** to do things. The <Term id="runSheet" link={false} /> sa
``` ```
```text ```text
Thursday, October 15 20:00 — start Tue 13:45 · 3 visits to the kitchen · no wait adjusted Thursday, October 15 20:00 — start Tue 13:29 · 3 visits to the kitchen · no wait adjusted
Friday, October 16 20:00 — start Wed 13:45 · 3 visits to the kitchen · no wait adjusted Friday, October 16 20:00 — start Wed 13:29 · 3 visits to the kitchen · no wait adjusted
Saturday, October 17 20:00 — start Thu 13:45 · 3 visits to the kitchen · no wait adjusted Saturday, October 17 20:00 — start Thu 13:29 · 3 visits to the kitchen · no wait adjusted
... ...
Thursday, October 15 12:30 — not possible. Mise en place — Sponge, around Tue 06:15, falls when you are not available, ... (+2) Thursday, October 15 12:30 — not possible. Mise en place — Sponge, around Tue 06:00, falls when you are not available, and no wait can be moved to fix it. (+2)
``` ```
Compatible options are listed first (prioritizing fewer adjusted waits, then fewer visits, then the earliest dates). For each incompatible slot, Gram explains the blocking constraint. Compatible options are listed first (prioritizing fewer adjusted waits, then fewer visits, then the earliest dates). For each incompatible slot, Gram explains the blocking constraint.
The `--meal-times` flag replaces the default (`12:30,20:00`). To configure your preferred meal slots permanently, set the `mealTimes` list in `.gram/config.yaml`. The `--meal-times` flag replaces the default (`12:30,20:00`). To configure your preferred meal slots permanently, set the `mealTimes` list in `.gram/config.yaml`.
> [!TIP] :::tip
> If you do not provide any serving time, `gram plan entremets.gram` simply calculates the earliest possible serving time starting right now. If you do not provide any serving time, `gram plan entremets.gram` simply calculates the earliest possible serving time starting right now.
:::
3. ### Generate the run sheet 3. ### Generate the run sheet
@ -83,23 +125,24 @@ The recipe says **how** to do things. The <Term id="runSheet" link={false} /> sa
- `--serve`: the target date and time of the meal. - `--serve`: the target date and time of the meal.
- `--available`: when you can cook (repeatable, e.g. `sat=09:00-23:00`, `2026-10-09=none`). Your usual hours can be saved once for the project via `gram config set availability 08:00-22:00`; the flag then only overrides them. - `--available`: when you can cook (repeatable, e.g. `sat=09:00-23:00`, `2026-10-09=none`). Your usual hours can be saved once for the project via `gram config set availability 08:00-22:00`; the flag then only overrides them.
- `--tz`: your IANA time zone (can be saved permanently via `gram config set timezone Europe/Paris`). - `--tz`: your IANA time zone (can be saved permanently via `gram config set timezone Europe/Paris`).
- `--stock`: indicates that a preparation (here the glaze) is already made in your freezer. Gram does not schedule it and flags it as "in stock". - `--stock`: indicates that a preparation (here the glaze) is already made in your freezer. Gram does not schedule it and flags it as "in stock". The value is the `@use` path exactly as written in the recipe, **relative to the folder you run the command from** (not to the recipe's folder): run `gram plan` from the folder that holds `entremets.gram`.
```text ```text
Run sheet — Pistachio raspberry entremets Run sheet — Pistachio raspberry entremets
For Saturday, October 17 at 20:00 · 6 portions For Saturday, October 17 at 20:00 · 6 portions
3 days · 3 visits to the kitchen · 45m of work in all 3 days · 3 visits to the kitchen · 1h 5min of work in all
THU 15 ▮ 13:45 – 14:00 Sponge, Insert THU 15 ▮ 13:30 – 14:00 Sponge, Insert
┆ Sponge : Bake 12m ┆ Insert : Freeze 12h to 3d
┆ Insert : Freeze 12h to 72h
FRI 16 ▮ 13:35 – 14:00 Mousse FRI 16 ▮ 13:35 – 14:00 Mousse
┆ Mousse : Assemble 12h to 48h ┆ Mousse : Assemble 12h to 2d
SAT 17 ▮ 13:55 – 14:00 Finish SAT 17 ▮ 13:55 – 14:00 Finish
┆ Finish : Thaw 6h ┆ Finish : Thaw 6h
★ 20:00 Serve ★ 20:00 Serve
``` ```
The glaze, in stock, appears in no visit. Times are rounded to five minutes.
4. ### Read the plan 4. ### Read the plan
The output consists of two complementary parts: The output consists of two complementary parts:
@ -119,24 +162,26 @@ The recipe says **how** to do things. The <Term id="runSheet" link={false} /> sa
```text ```text
FRIDAY, OCTOBER 16 13:35 → 14:00 FRIDAY, OCTOBER 16 13:35 → 14:00
Possible from 08:00. Possible from 08:00.
MISE EN PLACE MOUSSE (Start: 13:40)
[ ] cream 250 g Mise en place
[ ] sugar 30 g [ ] cream 250 g
[ ] milk 100 g [ ] sugar 30 g
[ ] Sponge, made Thursday [ ] milk 100 g
[ ] Insert, made Thursday [ ] Sponge, made Thursday
[ ] stand mixer [ ] Insert, made Thursday
[ ] 20 cm ring [ ] stand mixer
EXECUTION [ ] 20 cm ring
MOUSSE (Start: 13:40) Execution
1. [Whip] Whip the cream with the sugar and the milk. 1. [Whip] Whip cream with sugar and milk using the stand mixer 10 min.
2. [Assemble] Fold in the sponge and the insert, in the 20 cm ring. 2. [Assemble] Layer sponge, insert and the mousse in the 20 cm ring 10 min, then freeze 12-48 h.
BEFORE LEAVING BEFORE LEAVING
Mousse : Assemble 12h to 48h, until 02:00 Mousse : Assemble 12h to 2d, until 02:00
Next visit: Saturday 13:55 Next visit: Saturday 13:55
``` ```
This example illustrates the per-working-day mode; in per-section mode, each section forms a distinct block with its mise en place above its steps. This example is in per-section mode (the default): the section is a station, with its mise en place above its steps. In per-working-day mode, one block at the top of the visit gathers the ingredients of every section of the day.
In "Before leaving", `until 02:00` is the time the wait can end **at the earliest** (2 p.m. + 12 h), not the time it stops: the mousse must come out of the freezer before the finish, on Saturday. In between it stays in the freezer about 24 h, within its 12 to 48 h range.
Any constraints the engine could not resolve (a start time already in the past, work outside your available hours, or an incompatible rest) are listed under **"To fix"** at the top. See [Diagnostics and unresolved constraints](/docs/explanation/planning-in-real-time/#diagnostics-and-unresolved-constraints). Any constraints the engine could not resolve (a start time already in the past, work outside your available hours, or an incompatible rest) are listed under **"To fix"** at the top. See [Diagnostics and unresolved constraints](/docs/explanation/planning-in-real-time/#diagnostics-and-unresolved-constraints).

View file

@ -188,7 +188,34 @@ Pour structurer une recette en journées de travail, le moteur d'ordonnancement
- **`~{-Nd}` (jours) = une journée de travail.** Cela exprime une intention explicite (*« préparation réalisée la veille (J-1) »*, *« deux jours avant (J-2) »*). Gram regroupe alors la mise en place de ces sections dans une journée de travail dédiée. - **`~{-Nd}` (jours) = une journée de travail.** Cela exprime une intention explicite (*« préparation réalisée la veille (J-1) »*, *« deux jours avant (J-2) »*). Gram regroupe alors la mise en place de ces sections dans une journée de travail dédiée.
- **`~{-Nh}` (heures) = une échéance relative au sein de la journée.** Une ancre telle que `~{-2h}` ou `~{-36h}` indique que l'étape doit s'achever 2 heures (ou 36 heures) avant le service, mais n'ouvre **jamais** de nouvelle journée à elle seule. Une recette `.gram` ne connaissant pas l'heure réelle de votre repas, convertir des heures en jours introduirait des ambiguïtés dépendantes de l'heure du repas (`~{-12h}` tombe le matin pour un dîner à 20 h, mais la veille à minuit pour un déjeuner à 12 h). - **`~{-Nh}` (heures) = une échéance relative au sein de la journée.** Une ancre telle que `~{-2h}` ou `~{-36h}` indique que l'étape doit s'achever 2 heures (ou 36 heures) avant le service, mais n'ouvre **jamais** de nouvelle journée à elle seule. Une recette `.gram` ne connaissant pas l'heure réelle de votre repas, convertir des heures en jours introduirait des ambiguïtés dépendantes de l'heure du repas (`~{-12h}` tombe le matin pour un dîner à 20 h, mais la veille à minuit pour un déjeuner à 12 h).
Une section sans ancre hérite du jour de **l'ancre en jours la plus lointaine parmi les sections qui lui succèdent**, ou du jour J par défaut. Dans l'exemple, le fond ne possède pas d'ancre propre : il est affecté à J-1 avec la tarte, et l'ordonnancement ALAP le planifie au plus tard, immédiatement avant elle. Une section sans ancre se rattache à l'ancre en jours **qui la suit** (la plus lointaine parmi les sections situées après elle), ou au jour J s'il n'y en a pas. C'est l'inverse du sens de lecture, et c'est voulu : le moteur raisonne depuis le service en remontant le temps, et une ancre dit « cette section, et tout ce qui la précède sans ancre, est faite au plus tard ce jour-là ».
:::caution[Une ancre ne s'applique pas aux sections qui la suivent]
Dans l'exemple, le **fond** n'a pas d'ancre et il est écrit juste après la crème `~{-3d}`, mais il n'est **pas** fait à J-3. Il se rattache à la tarte `~{-1d}`, qui vient après lui : il est donc fait à J-1, juste avant elle, puisque l'ordonnancement place chaque étape au plus tard.
:::
Voici le plan de marche que Gram produit pour cette recette (`gram plan tarte.gram`) :
```text
J-3 ▮ ~ 5min Crème
┆ Crème : Refroidir 1j
J-1 ▮ ~ 40min Fond, Tarte
Jour J ▮ ~ 5min Service
★ Servir
```
Pour faire le fond un jour à part, entre la crème et la tarte, ancrez-le explicitement : `## Fond ~{-2d} ->&fond` donne un passage à J-2.
```text
J-3 ▮ ~ 5min Crème
┆ Crème : Refroidir 1j
J-2 ▮ ~ 5min Fond
J-1 ▮ ~ 35min Tarte
Jour J ▮ ~ 5min Service
★ Servir
```
Ancrer le fond à `~{-3d}`, comme la crème, n'a pas de sens ici : il consomme la crème, qui repose 24 heures. Gram l'accepte mais signale un conflit de chronologie (« la journée de travail commence avant l'ouverture de sa fenêtre de 24 h »).
:::caution[Points d'attention] :::caution[Points d'attention]
Deux situations courantes n'ouvrent **pas** de nouvelle journée de travail : Deux situations courantes n'ouvrent **pas** de nouvelle journée de travail :
@ -199,7 +226,7 @@ Deux situations courantes n'ouvrent **pas** de nouvelle journée de travail :
Dans l'exemple ci-dessus : Dans l'exemple ci-dessus :
- La **crème** est préparée à **J-3** ; - La **crème** est préparée à **J-3** ;
- Le **fond** et la **tarte** sont réalisés à **J-1** ; - Le **fond** et la **tarte** sont réalisés à **J-1** (le fond se rattache à la tarte, qui le suit) ;
- Le **service** s'effectue le **jour J**. - Le **service** s'effectue le **jour J**.
Chaque journée est conçue pour s'inscrire dans les 24 heures précédant la suivante. Si un long temps passif repousse le travail d'une journée hors de cette fenêtre, Gram émet le diagnostic `DAY_OVERFLOW` et suggère d'ancrer la section plus en amont. Chaque journée est conçue pour s'inscrire dans les 24 heures précédant la suivante. Si un long temps passif repousse le travail d'une journée hors de cette fenêtre, Gram émet le diagnostic `DAY_OVERFLOW` et suggère d'ancrer la section plus en amont.

View file

@ -68,16 +68,23 @@ Une attente affectée à une piste nommée (`~_four{40min}`) n'est allongée que
Pour un service fixé le dimanche à 13 h, avec une disponibilité quotidienne de `08:00-22:00`, une pousse minimale de 8 heures placerait le pétrissage en pleine nuit à 4 h 10. Gram allonge automatiquement la pousse à 14 h 30 pour positionner le pétrissage le samedi soir, s'achevant à 22 h : Pour un service fixé le dimanche à 13 h, avec une disponibilité quotidienne de `08:00-22:00`, une pousse minimale de 8 heures placerait le pétrissage en pleine nuit à 4 h 10. Gram allonge automatiquement la pousse à 14 h 30 pour positionner le pétrissage le samedi soir, s'achevant à 22 h :
```text ```text
À régler
! Le travail de Jour J tombe le samedi 10 octobre au lieu du dimanche 11 octobre.
SAM. 10 ▮ 21:40 – 22:00 Pâte SAM. 10 ▮ 21:40 – 22:00 Pâte
┆ Pâte : Pointer 14h 30m (8h à 16h) ┆ Pâte : Pointer 14h 30min (8h à 16h)
DIM. 11 ▮ 12:30 – 13:00 Cuisson DIM. 11 ▮ 12:30 – 13:00 Cuisson
★ 13:00 Servir ★ 13:00 Servir
SAMEDI 10 OCTOBRE 21:40 → 22:00 SAMEDI 10 OCTOBRE 21:40 → 22:00
! Pâte : Pointer prolongé à 14h 30m (prévu 8h à 16h) pour que le travail tombe dans vos disponibilités. ! Pâte : Pointer prolongé à 14h 30min (prévu 8h à 16h) pour que le travail tombe dans vos disponibilités.
Possible dès 20:10. Possible dès 20:10.
``` ```
Le message « À régler » en tête est normal ici. La recette n'a aucune ancre en jours : tout son travail est censé tomber le jour J, le dimanche. Or le pétrissage a dû passer au samedi soir, et Gram le dit (`DAY_MISMATCH`). Le plan reste valide, c'est une information.
Ne l'éteignez pas en ancrant la section (`## Pâte ~{-1d}`) : une ancre en jours fixe la journée de la section, et Gram ne prolonge alors plus la pousse pour s'adapter à vos disponibilités. Si la pousse doit s'adapter à vos horaires, laissez la recette sans ancre.
Si la pousse avait été fixée de manière stricte (`~_{8h}`), ou si la plage était trop resserrée pour absorber le décalage (`~_{8-10h}`), aucun ajustement n'aurait été possible : le planificateur maintient le pétrissage à 4 h 10 et consigne l'anomalie. Si la pousse avait été fixée de manière stricte (`~_{8h}`), ou si la plage était trop resserrée pour absorber le décalage (`~_{8-10h}`), aucun ajustement n'aurait été possible : le planificateur maintient le pétrissage à 4 h 10 et consigne l'anomalie.
## Diagnostics et contraintes non résolues ## Diagnostics et contraintes non résolues
@ -106,7 +113,7 @@ La projection calendaire produit un modèle de données complet : horodatages pr
Le **plan de marche** constitue la vue opérationnelle de ce modèle. Pour chaque journée, il récapitule les heures de présence requises en cuisine, le matériel et les ingrédients à sortir, les actions clés à réaliser au regard des étapes de la recette, ainsi que les processus qui continuent sans surveillance. Afin de refléter la réalité de la pratique culinaire, les horaires affichés sont arrondis aux cinq minutes les plus proches (alors que les calculs internes demeurent exacts à la minute près). Les ajustements de repos sont mentionnés en tête de la journée concernée, et les alertes d'ordonnancement regroupées en tête de document. Ces règles d'affichage (regroupement des passages au-delà d'une heure de repos passif, affichage des marges à partir de 15 minutes) relèvent de la couche de rendu et non de contraintes rigides du moteur. Le **plan de marche** constitue la vue opérationnelle de ce modèle. Pour chaque journée, il récapitule les heures de présence requises en cuisine, le matériel et les ingrédients à sortir, les actions clés à réaliser au regard des étapes de la recette, ainsi que les processus qui continuent sans surveillance. Afin de refléter la réalité de la pratique culinaire, les horaires affichés sont arrondis aux cinq minutes les plus proches (alors que les calculs internes demeurent exacts à la minute près). Les ajustements de repos sont mentionnés en tête de la journée concernée, et les alertes d'ordonnancement regroupées en tête de document. Ces règles d'affichage (regroupement des passages au-delà d'une heure de repos passif, affichage des marges à partir de 15 minutes) relèvent de la couche de rendu et non de contraintes rigides du moteur.
Le planning peut être généré en texte brut, en Markdown, en HTML autonome, en document imprimable dédié (une journée par page avec cases à cocher) ou exporté vers un fichier iCalendar (`.ics`). Avec l'option `--view run-sheet`, `gram print` et `gram export` génèrent le planning à la place de la recette. Tandis que la recette décrit **comment** cuisiner, le planning précise **quand** intervenir. Le plan de marche peut être généré en texte brut, en Markdown, en HTML autonome, en document imprimable dédié (une journée par page avec cases à cocher) ou exporté vers un fichier iCalendar (`.ics`). Avec l'option `--view run-sheet`, `gram print` et `gram export` génèrent le plan de marche à la place de la recette. Tandis que la recette décrit **comment** cuisiner, le plan de marche précise **quand** intervenir.
En l'absence d'heure de service cible, ces mêmes données sont présentées sous forme de décompte relatif (`J-2`, `J-1`, `Jour J`) avec des durées estimées par journée (ex. : « environ 55 min ») et l'indication de l'heure de dégustation la plus précoce. Les marges d'anticipation et les ajustements de repos ne sont calculés que lorsque vous définissez vos disponibilités calendaires réelles. En l'absence d'heure de service cible, ces mêmes données sont présentées sous forme de décompte relatif (`J-2`, `J-1`, `Jour J`) avec des durées estimées par journée (ex. : « environ 55 min ») et l'indication de l'heure de dégustation la plus précoce. Les marges d'anticipation et les ajustements de repos ne sont calculés que lorsque vous définissez vos disponibilités calendaires réelles.
@ -117,7 +124,7 @@ Consultez [Planifier un repas](/fr/docs/how-to/plan-a-meal/) pour le guide prati
| Outil | Commande ou méthode | | Outil | Commande ou méthode |
|---|---| |---|---|
| CLI | `gram plan recette.gram --serve "2026-10-11 13:00" --available 08:00-22:00` (option `--tz` facultative si configurée dans le projet) ; `--find` pour chercher une heure de service | | CLI | `gram plan recette.gram --serve "2026-10-11 13:00" --available 08:00-22:00` (option `--tz` facultative si configurée dans le projet) ; `--find` pour chercher une heure de service |
| Playground | La vue « Planning » et le volet « Planifier », avec « Quand servir ? » | | Playground | La vue « Plan de marche » et le volet « Planifier », avec « Quand servir ? » |
| VS Code | `Gram: Run Sheet`, en jours avant le service, ou sur le calendrier avec le champ **Service le** et ses suggestions « Quand servir ? » | | VS Code | `Gram: Run Sheet`, en jours avant le service, ou sur le calendrier avec le champ **Service le** et ses suggestions « Quand servir ? » |
| `@gram-lang/scheduler` | `project()`, `runSheet()`, `findServeTimes()` et `earliestServe()` (voir la [référence de l'API scheduler](/fr/docs/reference/api/scheduler/)) | | `@gram-lang/scheduler` | `project()`, `runSheet()`, `findServeTimes()` et `earliestServe()` (voir la [référence de l'API scheduler](/fr/docs/reference/api/scheduler/)) |
| `@gram-lang/renderer` | `runSheetToText`, `runSheetToMarkdown`, `runSheetToHTML`, `runSheetToPrintHTML`, et les utilitaires modulaires associés (`visitKit`, `sectionProgram`, `sectionSteps`) | | `@gram-lang/renderer` | `runSheetToText`, `runSheetToMarkdown`, `runSheetToHTML`, `runSheetToPrintHTML`, et les utilitaires modulaires associés (`visitKit`, `sectionProgram`, `sectionSteps`) |
@ -125,7 +132,7 @@ Consultez [Planifier un repas](/fr/docs/how-to/plan-a-meal/) pour le guide prati
## Limites actuelles ## Limites actuelles
- **Ordonnancement mono-recette** : la planification coordonnée d'un menu complet (entrée, plat et dessert synchronisés sur un même service, avec partage d'un cuisinier et d'un four unique) fera l'objet d'une évolution ultérieure ; l'API accepte néanmoins déjà une collection de recettes, et signale `MULTI_RECIPE_UNSUPPORTED` au-delà d'une. - **Ordonnancement mono-recette** : la planification coordonnée d'un menu complet (entrée, plat et dessert synchronisés sur un même service, avec partage d'un cuisinier et d'un four unique) fera l'objet d'une évolution ultérieure ; l'API accepte néanmoins déjà une collection de recettes, et signale `MULTI_RECIPE_UNSUPPORTED` au-delà d'une.
- **Absence de suivi d'état en direct** : le planning est une projection purement déterministe et ne conserve aucun état persistant en cours d'exécution. Si un passage prend du retard, relancez simplement la commande `gram plan` pour recalculer les créneaux viables à partir du nouvel horaire. - **Absence de suivi d'état en direct** : le plan de marche est une projection purement déterministe et ne conserve aucun état persistant en cours d'exécution. Si un passage prend du retard, relancez simplement la commande `gram plan` pour recalculer les créneaux viables à partir du nouvel horaire.
- **Ressources partagées** : les équipements (temps de préchauffage du four, capacité du réfrigérateur) ne constituent pas encore des ressources partagées globales, en dehors des pistes nommées explicites. - **Ressources partagées** : les équipements (temps de préchauffage du four, capacité du réfrigérateur) ne constituent pas encore des ressources partagées globales, en dehors des pistes nommées explicites.
- **Approche heuristique** : l'algorithme est glouton et déterministe (conçu pour être explicable et prévisible plutôt qu'optimal au sens de la programmation mathématique) : il résout les conflits en partant de l'événement le plus tardif et remonte dans le temps. - **Approche heuristique** : l'algorithme est glouton et déterministe (conçu pour être explicable et prévisible plutôt qu'optimal au sens de la programmation mathématique) : il résout les conflits en partant de l'événement le plus tardif et remonte dans le temps.
@ -138,7 +145,7 @@ Consultez [Planifier un repas](/fr/docs/how-to/plan-a-meal/) pour le guide prati
href="/fr/docs/how-to/plan-a-meal/" href="/fr/docs/how-to/plan-a-meal/"
/> />
<LinkCard <LinkCard
title="Mise en place et planification" title="Ingrédients, mise en place et planning"
description="Comment le compilateur déduit les dépendances, durées et coûts de préparation des tâches." description="Comment le compilateur déduit les dépendances, durées et coûts de préparation des tâches."
href="/fr/docs/explanation/mise-en-place-and-planning/" href="/fr/docs/explanation/mise-en-place-and-planning/"
/> />

View file

@ -262,8 +262,9 @@ Bien que le parseur produise initialement un Arbre Syntaxique Abstrait (AST) bru
- `day.entries[]` : séquence chronologique ordonnée de tous les blocs de la journée (actifs et passifs), utile pour tracer un graphique ou une frise journalière détaillée. - `day.entries[]` : séquence chronologique ordonnée de tous les blocs de la journée (actifs et passifs), utile pour tracer un graphique ou une frise journalière détaillée.
- `sheet.adjustments[]` et `sheet.diagnostics[]` : récapitulent respectivement les durées de repos passif adaptées pour respecter vos disponibilités, et les contraintes insolubles ayant généré des alertes. - `sheet.adjustments[]` et `sheet.diagnostics[]` : récapitulent respectivement les durées de repos passif adaptées pour respecter vos disponibilités, et les contraintes insolubles ayant généré des alertes.
> [!TIP] :::tip
> **Réutiliser les générateurs d'intitulés :** Pour formater les listes de courses, le matériel à sortir ou les renvois aux étapes sans réécrire la logique métier, vous pouvez directement importer les utilitaires modulaires du package `@gram-lang/renderer`, notamment `visitKit()` (ingrédients et matériel à sortir) et `sectionProgram()` (la section et la plage d'étapes d'un passage). Pour en savoir plus, consultez [le moteur d'ordonnancement](/fr/docs/explanation/engine/scheduler/#de-la-chronologie-au-plan-de-marche). **Réutiliser les générateurs d'intitulés :** Pour formater les listes de courses, le matériel à sortir ou les renvois aux étapes sans réécrire la logique métier, vous pouvez directement importer les utilitaires modulaires du package `@gram-lang/renderer`, notamment `visitKit()` (ingrédients et matériel à sortir) et `sectionProgram()` (la section et la plage d'étapes d'un passage). Pour en savoir plus, consultez [le moteur d'ordonnancement](/fr/docs/explanation/engine/scheduler/#de-la-chronologie-au-plan-de-marche).
:::
</Steps> </Steps>

View file

@ -42,10 +42,51 @@ La recette décrit **comment** réaliser chaque étape. Le plan de marche, lui,
[Décongeler] Laisser décongeler au réfrigérateur ~_{6h}. [Décongeler] Laisser décongeler au réfrigérateur ~_{6h}.
``` ```
<details>
<summary>Les trois bases importées par cette recette</summary>
```gram title="bases/biscuit-pistache.gram"
---
title: Biscuit pistache
---
## Biscuit ->&biscuit
[Mélanger] @pistaches{80g}, @œufs{3} et @sucre{60g} ~{10min}.
[Cuire] Cuire à ^{180C} ~{12min}.
```
```gram title="bases/insert-framboise.gram"
---
title: Insert framboise
---
## Insert ->&insert
[Cuire] Cuire @framboises{200g} et @sucre{40g} ~{5min}.
[Congeler] Laisser prendre au congélateur ~_{12-72h}.
```
```gram title="bases/glacage-blanc.gram"
---
title: Glaçage blanc
---
## Glaçage ->&glaçage
[Chauffer] Chauffer @chocolat blanc{150g} et @crème{100g} ~{5min}.
```
Les durées et les horaires affichés plus bas sont ceux que Gram calcule avec ces trois bases.
</details>
Pour approfondir la syntaxe des durées et des ancres, consultez [Durées exactes et fourchettes](/fr/docs/reference/syntax/times/#durées-exactes-et-fourchettes) ainsi que [Jours et heures](/fr/docs/reference/syntax/times/#jours-et-heures). Pour approfondir la syntaxe des durées et des ancres, consultez [Durées exactes et fourchettes](/fr/docs/reference/syntax/times/#durées-exactes-et-fourchettes) ainsi que [Jours et heures](/fr/docs/reference/syntax/times/#jours-et-heures).
> [!TIP] :::tip
> **Nommez vos étapes avec une `[Action]`** : Le plan de marche nomme les étapes et les fils d'attente d'après leur verbe d'action (ex. : `Mousse : Monter l'entremets 12h à 48h` dans la vue chronologique et pour les temps d'attente qui se poursuivent sans vous). Préfixer chaque étape minutée d'une `[Action]` garantit des intitulés explicites et parlants à ces endroits, plutôt que des durées isolées ou des libellés génériques comme `Repos`. **Nommez vos étapes avec une `[Action]`** : Le plan de marche nomme les étapes et les fils d'attente d'après leur verbe d'action (ex. : `Mousse : Monter l'entremets 12h à 2j` dans la vue chronologique et pour les temps d'attente qui se poursuivent sans vous). Préfixer chaque étape minutée d'une `[Action]` garantit des intitulés explicites et parlants à ces endroits, plutôt que des durées isolées ou des libellés génériques comme `Repos`.
:::
2. ### Déterminer l'heure du service 2. ### Déterminer l'heure du service
@ -57,19 +98,20 @@ La recette décrit **comment** réaliser chaque étape. Le plan de marche, lui,
``` ```
```text ```text
jeudi 15 octobre 20:00 — début mar. 13:45 · 3 passages en cuisine · aucune attente ajustée jeudi 15 octobre 20:00 — début mar. 13:29 · 3 passages en cuisine · aucune attente ajustée
vendredi 16 octobre 20:00 — début mer. 13:45 · 3 passages en cuisine · aucune attente ajustée vendredi 16 octobre 20:00 — début mer. 13:29 · 3 passages en cuisine · aucune attente ajustée
samedi 17 octobre 20:00 — début jeu. 13:45 · 3 passages en cuisine · aucune attente ajustée samedi 17 octobre 20:00 — début jeu. 13:29 · 3 passages en cuisine · aucune attente ajustée
... ...
jeudi 15 octobre 12:30 — impossible. Mise en place — Biscuit, vers mar. 06:15, tombe quand vous n'êtes pas disponible, ... (+2) jeudi 15 octobre 12:30 — impossible. Mise en place — Biscuit, vers mar. 06:00, tombe quand vous n'êtes pas disponible, et aucune attente ne peut bouger pour arranger ça. (+2)
``` ```
Les créneaux compatibles sont présentés en priorité (ceux qui demandent le moins d'ajustements de repos, puis le moins de passages en cuisine, puis les plus proches). Pour chaque créneau non retenu, Gram détaille la contrainte bloquante. Les créneaux compatibles sont présentés en priorité (ceux qui demandent le moins d'ajustements de repos, puis le moins de passages en cuisine, puis les plus proches). Pour chaque créneau non retenu, Gram détaille la contrainte bloquante.
L'option `--meal-times` remplace les horaires par défaut (`12:30,20:00`). Pour enregistrer vos créneaux favoris une fois pour toutes, vous pouvez définir la propriété `mealTimes` dans votre fichier `.gram/config.yaml`. L'option `--meal-times` remplace les horaires par défaut (`12:30,20:00`). Pour enregistrer vos créneaux favoris une fois pour toutes, vous pouvez définir la propriété `mealTimes` dans votre fichier `.gram/config.yaml`.
> [!TIP] :::tip
> Si vous ne fournissez aucune heure de service, `gram plan entremets.gram` calcule simplement l'heure de dégustation la plus précoce possible si vous commencez immédiatement. Si vous ne fournissez aucune heure de service, `gram plan entremets.gram` calcule simplement l'heure de dégustation la plus précoce possible si vous commencez immédiatement.
:::
3. ### Générer le plan de marche 3. ### Générer le plan de marche
@ -83,23 +125,24 @@ La recette décrit **comment** réaliser chaque étape. Le plan de marche, lui,
- `--serve` : la date et l'heure cibles du repas. - `--serve` : la date et l'heure cibles du repas.
- `--available` : vos plages de présence en cuisine (répétable, par exemple `sat=09:00-23:00` ou `2026-10-09=none`). Vos horaires habituels peuvent être enregistrés une fois pour toutes dans le projet via `gram config set availability 08:00-22:00` : l'option ne sert alors qu'à les remplacer ponctuellement. - `--available` : vos plages de présence en cuisine (répétable, par exemple `sat=09:00-23:00` ou `2026-10-09=none`). Vos horaires habituels peuvent être enregistrés une fois pour toutes dans le projet via `gram config set availability 08:00-22:00` : l'option ne sert alors qu'à les remplacer ponctuellement.
- `--tz` : votre fuseau horaire IANA (définissable de façon permanente via `gram config set timezone Europe/Paris`). - `--tz` : votre fuseau horaire IANA (définissable de façon permanente via `gram config set timezone Europe/Paris`).
- `--stock` : indique qu'une préparation (ici le glaçage) est déjà disponible au congélateur. Gram ne la replanifie pas et l'annote simplement comme étant « en stock ». - `--stock` : indique qu'une préparation (ici le glaçage) est déjà disponible au congélateur. Gram ne la replanifie pas et l'annote simplement comme étant « en stock ». La valeur est le chemin du `@use` tel qu'il est écrit dans la recette, **relatif au dossier depuis lequel vous lancez la commande** (et non à celui de la recette) : lancez donc `gram plan` depuis le dossier de `entremets.gram`.
```text ```text
Plan de marche — Entremets pistache framboise Plan de marche — Entremets pistache framboise
Pour le samedi 17 octobre à 20:00 · 6 portions Pour le samedi 17 octobre à 20:00 · 6 portions
3 jours · 3 passages en cuisine · 45m de travail en tout 3 jours · 3 passages en cuisine · 1h 5min de travail en tout
JEU. 15 ▮ 13:45 – 14:00 Biscuit, Insert JEU. 15 ▮ 13:30 – 14:00 Biscuit, Insert
┆ Biscuit : Cuire 12m ┆ Insert : Congeler 12h à 3j
┆ Insert : Congeler 12h à 72h
VEN. 16 ▮ 13:35 – 14:00 Mousse VEN. 16 ▮ 13:35 – 14:00 Mousse
┆ Mousse : Monter l'entremets 12h à 48h ┆ Mousse : Monter l'entremets 12h à 2j
SAM. 17 ▮ 13:55 – 14:00 Finition SAM. 17 ▮ 13:55 – 14:00 Finition
┆ Finition : Décongeler 6h ┆ Finition : Décongeler 6h
★ 20:00 Servir ★ 20:00 Servir
``` ```
Le glaçage, en stock, n'apparaît dans aucun passage. Les horaires sont arrondis aux cinq minutes.
4. ### Décrypter le plan de marche 4. ### Décrypter le plan de marche
La sortie se compose de deux parties complémentaires : La sortie se compose de deux parties complémentaires :
@ -119,24 +162,26 @@ La recette décrit **comment** réaliser chaque étape. Le plan de marche, lui,
```text ```text
VENDREDI 16 OCTOBRE 13:35 → 14:00 VENDREDI 16 OCTOBRE 13:35 → 14:00
Possible dès 08:00. Possible dès 08:00.
MISE EN PLACE MOUSSE (Début : 13:40)
[ ] crème 250 g Mise en place
[ ] sucre 30 g [ ] crème 250 g
[ ] lait 100 g [ ] sucre 30 g
[ ] Biscuit, fait jeudi [ ] lait 100 g
[ ] Insert, fait jeudi [ ] Biscuit, fait jeudi
[ ] batteur [ ] Insert, fait jeudi
[ ] cercle de 20 cm [ ] batteur
EXÉCUTION [ ] cercle de 20 cm
MOUSSE (Début : 13:40) Exécution
1. [Monter] Monter la crème avec le sucre et le lait. 1. [Monter] Monter crème avec sucre et lait au batteur 10 min.
2. [Assembler] Incorporer le biscuit et l'insert, dans le cercle de 20 cm. 2. [Monter l'entremets] Superposer biscuit, insert et la mousse dans le cercle de 20 cm 10 min, puis congeler 12-48 h.
EN PARTANT EN PARTANT
Mousse : Monter l'entremets 12h à 48h, jusqu'à 02:00 Mousse : Monter l'entremets 12h à 2j, jusqu'à 02:00
Prochain passage : samedi 13:55 Prochain passage : samedi 13:55
``` ```
Cet exemple illustre le mode par journée de travail ; en mode par section, chaque section forme un bloc distinct avec sa mise en place au-dessus de ses étapes. Cet exemple est en mode par section (par défaut) : la section forme un poste, avec sa mise en place au-dessus de ses étapes. En mode par journée de travail, un seul bloc en tête de passage rassemble les ingrédients de toutes les sections du jour.
Dans « En partant », `jusqu'à 02:00` est l'heure à laquelle l'attente peut se terminer **au plus tôt** (14 h + 12 h), pas celle où elle s'arrête : la mousse doit être sortie du congélateur avant la finition, le samedi. Entre les deux, elle reste au congélateur environ 24 h, dans sa fourchette de 12 à 48 h.
Si certaines contraintes s'avèrent impossibles à résoudre (démarrage dans le passé, travail hors de vos plages autorisées ou repos incompatible), Gram les regroupe dans une section **« À régler »** en en-tête. Pour en savoir plus, consultez [Diagnostics et contraintes non résolues](/fr/docs/explanation/planning-in-real-time/#diagnostics-et-contraintes-non-résolues). Si certaines contraintes s'avèrent impossibles à résoudre (démarrage dans le passé, travail hors de vos plages autorisées ou repos incompatible), Gram les regroupe dans une section **« À régler »** en en-tête. Pour en savoir plus, consultez [Diagnostics et contraintes non résolues](/fr/docs/explanation/planning-in-real-time/#diagnostics-et-contraintes-non-résolues).
@ -209,7 +254,7 @@ Le texte ci-dessus n'est qu'un mode de présentation parmi d'autres : l'ordonnan
href="/fr/docs/explanation/engine/scheduler/" href="/fr/docs/explanation/engine/scheduler/"
/> />
<LinkCard <LinkCard
title="Planifier en temps réel" title="Planifier en heures réelles"
description="Comment l'heure de service, vos plages de disponibilité et les fourchettes de repos se transforment en un calendrier concret." description="Comment l'heure de service, vos plages de disponibilité et les fourchettes de repos se transforment en un calendrier concret."
href="/fr/docs/explanation/planning-in-real-time/" href="/fr/docs/explanation/planning-in-real-time/"
/> />

View file

@ -192,77 +192,43 @@ export const homepageCopy: Record<"en" | "fr", HomepageCopy> = {
2, 2,
), ),
scheduleInput: `## Tomato Basil Pasta\n\n[Boil] The @pasta{200g} in salted water for ~_boiling{10min}. ->&cooked pasta{}\n\n[Sauté] @cherry tomatoes{200g} and @garlic{2 cloves} in @olive oil{} for ~{5min}. ->&sauce\n\n[Toss] The &cooked pasta{} into the hot &sauce with @fresh basil{1 handful}.`, scheduleInput: `---\ntitle: Lemon Tart\n---\n\n## Dough ->&dough ~{-1d}\n\n[Mix] Rub @flour{250g} with @butter{125g} ~{10min}.\n\n[Chill] Let the dough rest ~_{8-24h}.\n\n## Tart\n\n[Bake] Line the #tart ring{} with the &dough and blind bake ~{20min}.`,
scheduleOutput: JSON.stringify( scheduleOutput: JSON.stringify(
{ {
metrics: { title: "Lemon Tart",
preparationTime: 7, serveAt: "2026-11-21T20:00",
activeTime: 7, timeZone: "Europe/Paris",
}, days: [
miseEnPlace: [
{ {
section: 0, date: "2026-11-20",
duration: 7, visits: [
items: [
{ {
kind: "gather", startLocal: "2026-11-20T19:48",
target: "ingredient", endLocal: "2026-11-20T20:00",
count: 7, sections: [0],
duration: 7, },
],
threads: [
{
visit: 0,
fromLocal: "2026-11-20T20:00",
toLocal: "2026-11-21T04:00",
range: { min: 480, max: 1440 },
}, },
], ],
}, },
{
date: "2026-11-21",
visits: [
{
startLocal: "2026-11-21T19:38",
endLocal: "2026-11-21T20:00",
sections: [1],
},
],
threads: [],
},
], ],
schedule: {
miseEnPlace: "perSection",
rests: "shortest",
activeTime: 7,
preparationTime: 7,
totalTime: 19,
idleTime: 5,
blocks: [
{
kind: "prep",
task: "s0.prep",
section: 0,
start: 0,
end: 7,
},
{
kind: "step",
task: "s0.0",
section: 0,
step: 0,
start: 7,
end: 7,
},
{
kind: "passive",
task: "s0.0.t0",
section: 0,
step: 0,
start: 7,
end: 17,
track: "boiling",
},
{
kind: "step",
task: "s0.1",
section: 0,
step: 1,
start: 12,
end: 17,
},
{
kind: "step",
task: "s0.2",
section: 0,
step: 2,
start: 17,
end: 19,
},
],
},
}, },
null, null,
2, 2,
@ -515,77 +481,43 @@ export const homepageCopy: Record<"en" | "fr", HomepageCopy> = {
2, 2,
), ),
scheduleInput: `## Pâtes Tomate Basilic\n\n[Bouillir] Les @pâtes{200g} dans de l'eau salée pendant ~_ebullition{10min}. ->&pâtes cuites{}\n\n[Sauter] Les @tomates cerises{200g} et l'@ail{2 gousses} dans de l'@huile d'olive{} pendant ~{5min}. ->&sauce\n\n[Mélanger] Les &pâtes cuites{} dans la &sauce chaude avec du @basilic frais{1 poignée}.`, scheduleInput: `---\ntitle: Tarte au citron\n---\n\n## Pâte ->&pâte ~{-1d}\n\n[Sabler] Sabler la @farine{250g} avec le @beurre{125g} ~{10min}.\n\n[Reposer] Laisser reposer la pâte ~_{8-24h}.\n\n## Tarte\n\n[Cuire] Foncer le #cercle à tarte{} avec la &pâte et cuire à blanc ~{20min}.`,
scheduleOutput: JSON.stringify( scheduleOutput: JSON.stringify(
{ {
metrics: { title: "Tarte au citron",
preparationTime: 7, serveAt: "2026-11-21T20:00",
activeTime: 7, timeZone: "Europe/Paris",
}, days: [
miseEnPlace: [
{ {
section: 0, date: "2026-11-20",
duration: 7, visits: [
items: [
{ {
kind: "gather", startLocal: "2026-11-20T19:48",
target: "ingredient", endLocal: "2026-11-20T20:00",
count: 7, sections: [0],
duration: 7, },
],
threads: [
{
visit: 0,
fromLocal: "2026-11-20T20:00",
toLocal: "2026-11-21T04:00",
range: { min: 480, max: 1440 },
}, },
], ],
}, },
{
date: "2026-11-21",
visits: [
{
startLocal: "2026-11-21T19:38",
endLocal: "2026-11-21T20:00",
sections: [1],
},
],
threads: [],
},
], ],
schedule: {
miseEnPlace: "perSection",
rests: "shortest",
activeTime: 7,
preparationTime: 7,
totalTime: 19,
idleTime: 5,
blocks: [
{
kind: "prep",
task: "s0.prep",
section: 0,
start: 0,
end: 7,
},
{
kind: "step",
task: "s0.0",
section: 0,
step: 0,
start: 7,
end: 7,
},
{
kind: "passive",
task: "s0.0.t0",
section: 0,
step: 0,
start: 7,
end: 17,
track: "ebullition",
},
{
kind: "step",
task: "s0.1",
section: 0,
step: 1,
start: 12,
end: 17,
},
{
kind: "step",
task: "s0.2",
section: 0,
step: 2,
start: 17,
end: 19,
},
],
},
}, },
null, null,
2, 2,

View file

@ -8,6 +8,8 @@ import {
type WarningSeverity, type WarningSeverity,
} from "@gram-lang/kitchen"; } from "@gram-lang/kitchen";
export type { WarningSeverity };
// Module-only diagnostic vocabulary (module-imports RFC, // Module-only diagnostic vocabulary (module-imports RFC,
// .notes/plan-ajout-imports-recettes.md Phase E, and the stock/retro-planning // .notes/plan-ajout-imports-recettes.md Phase E, and the stock/retro-planning
// redesign). `MODULE_NOT_FOUND` stays on kitchen's own `WarningCode` — it's // redesign). `MODULE_NOT_FOUND` stays on kitchen's own `WarningCode` — it's

View file

@ -1229,7 +1229,6 @@
/* An intermediate that can be followed back to the step that makes it. */ /* An intermediate that can be followed back to the step that makes it. */
.reference[data-ref-id] { .reference[data-ref-id] {
cursor: pointer; cursor: pointer;
border-bottom: 1px dotted var(--color-text-muted);
border-radius: 2px; border-radius: 2px;
padding: 0 2px; padding: 0 2px;
transition: transition:
@ -1257,7 +1256,6 @@
*/ */
.kit-list .reference[data-ref-id] { .kit-list .reference[data-ref-id] {
cursor: inherit; cursor: inherit;
border-bottom: none;
padding: 0; padding: 0;
font-size: inherit; font-size: inherit;
font-weight: 500; font-weight: 500;
@ -1425,9 +1423,21 @@
font-family: var(--gram-font-mono); font-family: var(--gram-font-mono);
} }
/*
* The badges of a section header are in ink, like a step: the color of
* the `.gram` source comes back on hover only.
*/
.section-meta-retroplanning { .section-meta-retroplanning {
color: var(--color-text);
border: 1px solid var(--color-border-strong);
transition:
color 0.15s ease,
border-color 0.15s ease;
}
.section-meta-retroplanning:hover {
color: var(--item-timer-text); color: var(--item-timer-text);
border: 1px solid var(--item-timer-text); border-color: var(--item-timer-text);
} }
.section-meta-mass { .section-meta-mass {
@ -1488,15 +1498,20 @@
cursor: pointer; cursor: pointer;
} }
.section-declaration-badge:hover,
.section-declaration-badge.gram-highlight-active { .section-declaration-badge.gram-highlight-active {
color: var(--item-decl-text);
border-color: var(--item-decl-text); border-color: var(--item-decl-text);
} }
.section-declaration-badge { .section-declaration-badge {
font-size: 0.65em; font-size: 0.65em;
font-weight: 700; font-weight: 700;
color: var(--item-decl-text); color: var(--color-text-strong);
border: 1px solid var(--item-decl-text); border: 1px solid var(--color-border-strong);
transition:
color 0.15s ease,
border-color 0.15s ease;
padding: 1px 8px; padding: 1px 8px;
border-radius: 3px; border-radius: 3px;
margin-left: auto; margin-left: auto;
@ -1529,7 +1544,7 @@
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 4px; gap: 4px;
color: var(--item-decl-text); color: inherit;
} }
/* ─── Nutrition table ──────────────────────────────────────────────────── */ /* ─── Nutrition table ──────────────────────────────────────────────────── */
@ -1781,7 +1796,7 @@
.gross-mass .gross-mass
):not(.section-meta-badge):not(.section-declaration-badge):not( ):not(.section-meta-badge):not(.section-declaration-badge):not(
.est-badge .est-badge
):not(.timing-pill):not(.reference):not(.scale-factor-badge) { ):not(.timing-pill):not(.scale-factor-badge) {
text-decoration: underline dotted; text-decoration: underline dotted;
text-underline-offset: 3px; text-underline-offset: 3px;
text-decoration-thickness: 1px; text-decoration-thickness: 1px;