Skip to content

Cooking mode: show recipe notes as cards of their own #836

Done

Description

@dubadub

Why

Recipe notes (> lines) show in the recipe page of cook server but cooking mode drops them. Recipes that explain technique in notes, such as the Cooklang cooking course, lose that text at the moment the cook is at the stove.

Today

  • src/web/templates.rs, cooking_mode_json: RecipeSectionItem::Note(_) => None, so notes never reach the cooking-mode data.
  • static/js/cooking-mode.js, buildCards: one section card per section, one step card per step, then the done card.

Wanted behaviour

Cook mode stays a pager. Within a section, pages follow the order of the file:

  1. The ingredients page, where one is shown today.
  2. Then the section's blocks in order: a step is a step page, a note is a note page.

Rules:

  • Notes before the first step make a note page after the ingredients page and before step 1 (the same order as the recipe view).
  • Notes after the last step make a note page after the last step.
  • Adjacent notes share one page. Notes with no step between them make one note page, each note its own paragraph. In a sample of 16,268 recipes, 40% of notes sit after the last step, often two or three in a row; one page each would add a swipe per note at the end. Confirmed 2026-11-13: adjacent notes share one page.
  • A section with notes and no steps gets its note page under the section's name.
  • Step numbers do not change. A note page has no number; its header reads "Note", with the section name where one is shown.
  • Progress counts pages, so it moves on a note page.
  • Opening cook mode at step N still lands on step N.
  • A note page has no timers, no ingredient list and no step photo. It scrolls when the text is long.
  • Text is plain, styled like the note in the recipe view. A URL in a note is tappable and opens outside cook mode.

Out of scope here: showing a video link in a note as a play card. That comes later.

Acceptance recipe

= Sear

> A

Salt @chicken thighs{4}.

> B

> C

Fry in a #pan{} for ~{12%minutes}.

> D

= Rest

> E

Expected pages: Ingredients (Sear) · Note A · Step 1 · Note B + C · Step 2 · Note D · Note E (Rest). Step 2 is still "Step 2". A recipe with no notes pages exactly as it does today.

In CookCLI the last note page comes before the "Bon Appetit!" card.

What changes

  • cooking_mode_json emits notes in order with the steps (for example an items array of {type: "step" | "note", …}), keeping steps if anything else reads it.
  • buildCards pushes a type: 'note' card for each run of notes; renderCard gets a note branch; the live region announces "Note".
  • Note text comes from the JSON and goes through the existing escapeHTML.

Watch out for

  • Step text is captured from .step-body elements only (captureStepHTML), so note cards must not advance stepHTMLIndex.
  • totalInSection keeps counting steps.

Checks

  • The acceptance recipe pages as listed.
  • A recipe with no notes pages as before.
  • Keyboard and swipe navigation, section pills and timers work across note cards.

Activity

  1. jjohnnystwsss commented on Nov 23, 2026

    @jjohnnystwsss
    Contributor

    I'd like to take this on, following the acceptance recipe and the page order described above. I'll keep adjacent notes on one card, preserve step numbers and opening at a specific step, and cover navigation, section pills, timers, and escaping/link handling in tests. I'll also check that recipes without notes behave as before.

    I'll use Codex to help with implementation and tests and disclose the assistance in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions