From 7a30d5958bec630bd65d8a58eaebc39704bc45d5 Mon Sep 17 00:00:00 2001 From: abiwab Date: Thu, 5 Nov 2026 23:48:30 +0100 Subject: [PATCH 1/3] feat(renderer): suggest serving times in words for any surface --- .changeset/renderer-prepare-views.md | 2 +- .../src/components/playground/GramOptions.vue | 2 +- .../components/playground/GramPlayground.vue | 60 +---------- .../explanation/planning-in-real-time.mdx | 2 +- .../explanation/planning-in-real-time.mdx | 2 +- packages/i18n/src/locales/en.ts | 10 ++ packages/i18n/src/locales/fr.ts | 9 ++ packages/renderer/src/index.ts | 4 + .../src/views/work-plan/serve-times.ts | 102 ++++++++++++++++++ packages/renderer/tests/serve-times.test.ts | 50 ++++++++- 10 files changed, 182 insertions(+), 61 deletions(-) diff --git a/.changeset/renderer-prepare-views.md b/.changeset/renderer-prepare-views.md index 914185b4..772b99b9 100644 --- a/.changeset/renderer-prepare-views.md +++ b/.changeset/renderer-prepare-views.md @@ -6,7 +6,7 @@ - the timeline for the chosen settings and its total and idle times, the same at any serving time - the work plan, on the calendar when a serving time is given, otherwise in days before the service -- the serving time search (the earliest serving time, and the times worth proposing in a range) from your kitchen's time zone and hours +- the serving time search (the earliest serving time, and the times worth proposing in a range) from your kitchen's time zone and hours; `suggestServeTimes()` puts it in words for a serving time field: the times that work over the next days, why the others do not, and the earliest - `views` lists the views of a recipe (the recipe, the work plan) with the formats each one offers, the settings it follows and what it needs worked out, and `render(view, input, format)` writes one of them from what `prepareViews()` gave; it returns `null` for a work plan when the recipe has no tasks. `toHTML`, `runSheetToHTML` and the other functions stay as they are - `inspectors` lists the looks at the pipeline (the composed AST as an S-expression, the analyzed recipe as JSON or as a tree that folds), and `outputs` lists the views and the inspectors together, for an interface that offers both. `renderJsonTree()` writes any data as that tree, with no script (native folding, keyboard included), and `JSON_TREE_CSS` styles it with colors you set through CSS variables; `renderSExpr()` writes an AST as an S-expression - `describeError()` picks the error to show when a recipe stops compiling (a blocking error first, then the first error) and gives its code, message, file and position, with a title in the recipe's language, so every interface reports the same error the same way diff --git a/packages/docs/src/components/playground/GramOptions.vue b/packages/docs/src/components/playground/GramOptions.vue index 11b8b10f..3a16f971 100644 --- a/packages/docs/src/components/playground/GramOptions.vue +++ b/packages/docs/src/components/playground/GramOptions.vue @@ -196,7 +196,7 @@ function clearServeAt() { // biome-ignore lint/correctness/noUnusedVariables: formatEarliestLabel is used in the