Skip to content

[cook-plan] Highlight the current stage, pair trays, autocomplete foods - #177

Merged
remy merged 14 commits into
mainfrom
cook-plan-stage-and-pairing
Nov 23, 2026
Merged

remy merged 14 commits into
mainfrom
cook-plan-stage-and-pairing

Conversation

@remy

@remy remy commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Five changes to the cook planner, all aimed at following a roast from the middle of the timeline rather than the top of the page.

Which stage you're up to

"In progress" was never the right signal — a turkey is in progress for two hours and so is everything that went in after it, so half the timeline lit up at once. The stop the cook is up to is the last instruction whose time has come: that one gets a solid band running the full width of the page, the one after it gets a quieter outline, and the clock scrolls to the band whenever the stage changes (so opening the schedule mid-cook lands you on the right line).

Two columns on a wide screen

Plans of six stops or more flow into two columns at 1024px and up, filling the left column before the right so the times still read top-to-bottom then across. Shorter plans keep the single column — splitting five stops leaves one looking abandoned.

Food autocomplete

New foods.js catalogues ~55 roast dishes with their usual timings. The name field is backed by a <datalist>; naming a dish it knows fills in the cook type, slots and times. Editing an existing dish offers them on a button instead of overwriting what's already there.

Editable oven and shelf

The timeline's ✏️ Edit panel now carries oven, shelf and hob alongside the cook start, and the item dialog gained a shelf picker. Hand-picked placements are allocated before the automatic ones, so the rest of the plan routes around them rather than the other way about — pinning the potatoes to shelf 1 pushes the turkey to shelf 2 rather than producing a clash. Pinned shelves are marked 📌 in the appliance summary.

Tray-aware pairing

A shelf holds two half-shelf dishes, so which two matters: potatoes and parsnips want the same heat and the same fat and go in one big tray; a crumble next to them does not. Each dish in the catalogue carries a family, a rough heat and whether it sits loose on a tray or in its own dish, and pairScore turns that into a number. Shelves are scored by their worst current occupant, an empty shelf scores a neutral 0 — so a good pairing beats an empty shelf and a bad one loses to it — and a dish that only fits beside a bad neighbour goes to the combi instead. The timeline then says "🍲 Shares a tray with Parsnips".

Two bugs found on the way

Both needed fixing for the manual placements to be safe:

  • Every conflict check filtered on i._s.cookTime, which is never set (_s holds the computed clock times; cookTime is a property of the item). All three checks therefore matched nothing and conflict detection had been silently dead.
  • Nothing checked a single shelf's capacity, only the oven's total, so three dishes could pile onto one shelf of a half-empty oven — reachable now that shelves can be hand-picked.

Testing

Checked in the browser against an eight-dish Christmas dinner: single NOW/NEXT marker and auto-scroll, two-column flow at 1280px, tray pairing sending the crumble to the combi so the parsnips could join the potatoes, pinning a shelf and seeing the plan re-route around it, the per-shelf conflict firing when three dishes were forced onto one shelf, autocomplete in both add and edit modes, light and dark, and no horizontal overflow at 325px.

🤖 Generated with Claude Code

Five changes to the cook planner, all aimed at following a roast from the
middle of the timeline rather than the top of the page.

**Which stage you're up to.** "In progress" was never the right signal — a
turkey is in progress for two hours and so is everything that went in after
it, so half the timeline lit up at once. The stop the cook is *up to* is the
last instruction whose time has come: that one gets a solid band running the
full width of the page, the one after it gets a quieter outline, and the clock
scrolls to the band whenever the stage changes.

**Two columns on a wide screen.** Longer plans flow into two columns at
1024px and up, filling the left column before the right so the times still
read top-to-bottom then across.

**Food autocomplete.** A catalogue of ~55 roast dishes (foods.js) backs a
datalist on the name field. Naming a dish it knows fills in the cook type and
timings; editing one offers them on a button instead of overwriting what is
already there.

**Editable oven and shelf.** The timeline's Edit panel now carries oven, shelf
and hob alongside the cook start, and the item dialog gained a shelf picker.
Hand-picked placements are allocated first so the automatic ones route around
them.

**Tray-aware pairing.** A shelf holds two half-shelf dishes, so which two
matters: potatoes and parsnips want the same heat and the same fat and can
share one big tray, a crumble next to them cannot. Shelves are now scored by
what is already on them, a dish that only fits beside a bad neighbour goes to
the combi instead, and the timeline says which dishes share a tray.

Two bugs found on the way, both needed for the manual placements to be safe:
conflict detection filtered on `_s.cookTime`, which is never set, so all three
checks silently found nothing; and nothing checked a single shelf's capacity,
only the oven's total, so three dishes could pile onto one shelf of a
half-empty oven.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@netlify

netlify Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for remy-tools ready!

Name Link
🔨 Latest commit 2ceec19
🔍 Latest deploy log https://app.netlify.com/projects/remy-tools/deploys/6b0413f2f0f310440fad78d5
😎 Deploy Preview https://deploy-preview-177--remy-tools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

remy and others added 13 commits November 22, 2026 16:11
The end of a cook is not one event, it is a dozen landing on the same minute:
every dish ready, several out of the oven, and serve. Each got its own bell,
and because each bell builds its own AudioContext — which starts counting from
whenever it was constructed — fifteen two-second tones went off a few
milliseconds apart. That came out as a ragged run of bongs rather than a
chime. Measured on an eight-dish plan: 15 chimes between .164 and .204 of the
same second.

Events due on a tick are now collected, all marked as fired as before, and
sounded once. The leader is chosen by significance (serve, then out of the
oven, then in, prep, rest, ready), so serve still gets its two-note fanfare
and is never drowned by the things that merely finished alongside it.

The notification stack had the same split: fifteen cards for one instant,
enough to push everything earlier in the cook past the twenty-card cap. A
moment now posts one notification, led by the same event, with the others
folded into its sub-line (three named, then a count).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The combi is an oven or a microwave on demand, and the planner knew that —
what it didn't do was take the microwave into account when handing out oven
space. Dishes were placed in clock order, so a tray of parsnips could park
itself in the combi at quarter past and the red cabbage would find the only
microwave in the kitchen busy being an oven. Tray pairing made this more
likely: a dish that scored well beside something already in the combi would
choose it over an empty shelf in the main oven.

Microwave dishes are now placed first, because they have exactly one home
while an oven dish has two, and an oven dish will route around a booking that
is already there. The preference is soft: a tray with nowhere else at all to
go still takes the combi, and drops the booking it displaces rather than
leaving it holding a slot it can no longer use — which would push the next
tray out of the combi too.

The clash itself now reads as one message per microwave dish rather than one
per pair, and says what is tying the combi up and until when, instead of
describing the device as though being dual-mode were the problem.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A cook plan is only interesting at the times it describes, which makes it
awkward to check: the stage band, the chimes, the countdown and the next-up
panel all do their work at half past three and nowhere else. The stopwatch
button on the schedule, between Edit and the cog, opens a fake clock —
scrub to any point in the cook, step between stages, or let it run at 10x or
60x and watch the timeline work.

Everything that asks the time now asks sim-clock.js rather than Date, so one
setting moves the whole app at once instead of just the readout. Simulated
time is derived from real time (an anchor pair and a rate) rather than counted
up, so a missed tick or a backgrounded tab can't make it drift. An amber pill
sits above the page the whole time it is on, because a clock that lies should
never be mistaken for one that doesn't; nothing is persisted, so a reload is
always back to the real time.

Two things only the fake clock could reach:

- The "this plan must be tomorrow's" offset was decided when the schedule was
  built and never revisited, so scrubbing back into the cook left every
  comparison a day out and nothing responded. It now follows the clock.
- Setting a time and pausing it is one gesture but two changes, and each
  sounded the moment it landed on. One landing, one chime.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…eside itself

The two columns asked for were the timeline and the chimes, not the timeline
split down the middle. Splitting it was the wrong read: it bought nothing — a
sequence of times reads perfectly well in one column — while the chime log sat
at the top of the page, which is exactly where you are not looking once the
cook is under way and the view has scrolled to the stage you are on.

So the timeline goes back to a single column, and on a wide screen the log
takes a column of its own on the right, sticky, so what has just gone off
stays in view however far down the timeline you are. The schedule view widens
to make room; the editor is a column of form rows and doesn't.

Stacked, the log keeps its place above the timeline — below it would be past
the end of a two-hour cook — and when nothing has chimed yet it isn't there at
all, since there is no column for it to fill. On a wide screen the column
stays, labelled and with a line saying what will appear in it, because a
layout that reflows the moment the first bell goes is worse than one that
starts out with a little room set aside. Neither the log nor the simulate pill
prints.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Three things that all showed up in the same screenshot.

Stops butted together. Each one's highlight band is the full height of its
row, so with no gap between rows a lit stop and the one after it met edge to
edge and read as a single block — exactly the confusion the band was added to
clear up. The timeline now has a gap between stops.

The gutter between the timeline and the chime log was narrower than it
looked: the band bleeds a gutter's width past the timeline's content, so most
of the 2rem gap was being spent before the columns were separated at all.
Widened so there is a real gap left over.

And the accent bars were border-lefts on rounded boxes, which curves the
bar's inner edge along with its outer one and pinches it at top and bottom.
The chime cards now draw theirs as a pseudo-element clipped by overflow:
hidden, with the bar width and colour as custom properties; the timeline band
can't hold a pseudo-element of its own — it is one — so it paints the bar into
its background instead, which the radius clips the same way. Outer edge
follows the corner, inner edge stays straight.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A step says how long it takes, which is the one thing you already know. What
you want standing at the oven is how long it has been in — the chicken went in
at 14:05 and the useful figure at twenty to three is 35m, not 1h 30m.

Every step with a duration now carries a live count under its details, in
hours and minutes with the hours left off until there are some. The markup
carries only the window the step runs for; the clock fills in the figure and
decides whether to show it, so it is one more thing the per-second tick does
alongside the stage band — which means it follows the simulated clock for
free, and scrubbing or running at 60x moves it as you would expect.

It appears between the step's start and its end and nowhere else. Before,
there is nothing to count. After, the row is past and dimmed and the step's
full length is already printed on the line above. Steps that are instants
rather than stretches — "chicken out of oven" — never get one: you cannot be
forty minutes into a moment. Nor does a printed plan, which has no now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A dish isn't done when it stops cooking. A chicken has to be carved, a
pudding turned out, a sauce poured — ten minutes of work that has to happen
before anyone eats, and that the plan was quietly assuming took no time at
all. Items now carry a serving prep alongside prep, cook and rest, and the
whole schedule counts back through it: a chicken needing ten minutes of
carving goes into the oven ten minutes earlier than one that doesn't, in both
start and end mode.

It shows on the timeline as its own step — PLATE, "carve / plate" — which
means it gets a chime, a running count and a colour of its own, violet, since
it is the one stage that is neither heat nor waiting. "Ready" moves to the end
of it, because that is when the dish is actually ready. The catalogue carries
a serving time too, so picking Roast chicken fills in 10 minutes along with
the other three; nearly every other dish is zero, a tray of parsnips going
from oven to table as it always did.

The summary strip was also quietly unhelpful: in start mode it showed when to
start and never said when you would eat. It now reads first action, serving
at, start to table, items — with the serve time read off the schedule rather
than the target, so a hand-set start that pushes the meal later says so.

The running count gets its own colour rather than the orange it shared with
the step's own label, where a figure that changes read as part of the heading.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The plan assumed an oven was at temperature the moment a dish reached it. It
isn't, and "turn the oven on" is the real first instruction of a roast, so the
kitchen settings now carry a heat-up time — six minutes by default — and every
oven that gets used earns a HEAT step that far ahead of its first dish.

One per oven, at its own first use, so a combi that only comes into play at
half past gets its own step at twenty-four past rather than being warmed for
two hours alongside the main one. Microwaves get none, and a hob heats while
you stand over it.

It is a property of the kitchen rather than of any dish, which is why it sits
with the shelves and the hobs rather than in the food editor.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
"Move a dish to the main oven" was advice the planner had no business giving:
it had not checked whether there was anywhere to move one, and if there was,
it should have done it rather than leaving the cook to work it out.

A dish is usually in the combi only because the main oven was full when it
went in. Shelves come free as things come out, so it can often move across
partway through, carry on cooking in the main oven, and leave the combi empty
and cooling in time to microwave something. The planner now looks for that: at
each moment something changes — a dish going in, a shelf coming free — it asks
whether the main oven could hold everything that is in the combi's way, all at
once, for the rest of their cooking. The earliest moment that works wins, and
the move becomes a step on the timeline with its own chime: "Move Parsnips →
Main Oven · Shelf 1 · frees the combi for Red cabbage".

A dish is therefore in two places over its cook, so the capacity sweeps and
the appliance summary now work in windows rather than whole cooks — otherwise
the main oven would be overfilled by a dish it was never told about.

A combi chosen by hand is never moved: undoing an override to make room is the
planner overruling the cook, which is the wrong way round. And when no move
fits, the message says so — "the main oven is full for that stretch, so there
is nothing to move" — rather than suggesting one that doesn't exist.

Also: a microwave dish in a kitchen with no combi had nowhere to cook and
nothing said so, despite a comment promising it would.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…cks the plan

Back-scheduling pinned every cook to the serve time. That is right for
anything that suffers from standing and needlessly rigid for a tray of roast
veg: finished a few minutes early and covered, it is no worse off, and those
few minutes can be exactly what lets the combi stop being an oven in time to
be a microwave.

So the kitchen gains a keep-warm allowance — fifteen minutes by default — and
when a microwave dish is stuck, the planner works out how much earlier what is
in the way would have to finish, and holds it back if that is within the
allowance. All or nothing per clash: emptying the combi half way empties
nothing. Only when there is a clash to clear, too, since food should not be
made to wait for nothing.

On the plan this came from, nine minutes is enough. The parsnips and the pigs
in blankets now come out at 15:41 with "Cover and set aside · 9m until serve"
against them, the cauliflower cheese moves to the main oven when the chicken
leaves it, and the red cabbage gets the microwave it has been asking for since
this all started. No conflicts.

Shifting a dish re-opens every allocation decision after it, so the held plan
is only kept when it has fewer conflicts than the unheld one — a hold that
trades one clash for another is not worth anyone's parsnips going cold. A
hand-set start outranks a hold, as it outranks everything else.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A tray moving between ovens halfway through its cook, or coming out early to
sit covered, are not things you would guess from reading the list of dishes —
and until now they only appeared on the stop they happen at, which is the
worst moment to find out. Both now get a "Heads up" card at the top, in the
slot the conflict warning uses.

Amber rather than red, because nothing is wrong: the planner has arranged
something clever and is telling you about it while there is still time to
disagree. Nothing is arranged, nothing is said — with keep-warm turned off the
plan this came from shows its conflict and no notices at all.

The keep-warm note is in there alongside the move for the same reason the move
is: both are work the cook has to remember, and both are invisible from the
dish list. Amber is too pale to write in on a pale amber card, so the label
gets a darker ink of its own in light mode.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
At 15:41 the timeline read: parsnips out, parsnips and pigs ready, pigs out —
two halves of one instruction with the conclusion wedged between them. The
stops within a minute came out in whatever order the events had been built,
and two dishes leaving two different ovens were two rows because the grouping
key included which oven.

Coming out, the appliance only decides the verb, so dishes leaving any oven
are now one instruction: "Parsnips & Pigs in blankets out of oven". Hobs and
the microwave still get their own line, since "off hob" is a different thing
to say. And the rows inside a minute are sorted into the order the jobs
actually get done — oven on, trays out, trays moved, chopping, trays in, then
the things that are merely true afterwards.

While grouping the "out" rows together: a dish in the microwave was being
taken "out of oven". The combi cook type is the microwave; an oven dish that
happens to be cooking in the combi has always been an oven dish.

The appliance summary moves up to sit under the heads-up cards and above the
timeline. It is read while planning — which oven has room, what is where — and
the timeline is long enough that anything after it is effectively filed away.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The timeline answers "what do I do next". At the oven door the other question
is "what is already in there", and that meant reading back up the list and
doing the arithmetic yourself. Every appliance name on the timeline is now a
handle: hover it and a popover says what is in that appliance at that step's
time, which shelf each dish is on, when each comes out, and how full it is.

The name itself is the handle rather than some new icon beside it — it is
already written in the step, and a dotted rule plus a help cursor is enough to
say so. One per row, preferring the sub-line where the appliance detail lives
and falling back to the label for steps like "Heat Combi Oven" that only name
it there.

Built on the popover API, so the browser owns the top layer, Escape and light
dismiss, and on CSS anchor positioning, so the box hangs off the name and
flips itself when there is no room below — both now in all three engines, with
a short manual fallback for older ones. Hover is only wired up where there is
a real pointer; elsewhere popovertarget's click does the work, so a tap opens
it on a phone.

Both the summary cards and the peek now read the schedule through one
applianceWindows(), so they cannot disagree about what is where. A dish whose
stretch in the combi ends at its move time is shown as going next door rather
than coming out; "out" would have the cook reaching for a plate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@remy
remy merged commit 2056d51 into main Nov 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant