Skip to content

feat(web): show recipe notes in cooking mode - #855

Merged
dubadub merged 2 commits into
cooklang:mainfrom
jjohnnystwsss:feat/836-cooking-note-cards
Nov 24, 2026
Merged

dubadub merged 2 commits into
cooklang:mainfrom
jjohnnystwsss:feat/836-cooking-note-cards

Conversation

@jjohnnystwsss

Copy link
Copy Markdown
Contributor

Summary

Cooking mode now keeps recipe notes in their file order instead of dropping them. Adjacent notes share a card, including notes before the first step, after the last step, and in sections with no steps. This follows the acceptance recipe in #836.

  • Keep the legacy step-only data alongside ordered items; preserve step numbers, captured step HTML, pictures and timers. startCookingMode(globalStepNumber) locates a step independently of inserted note cards, while the usual no-argument call still starts at the beginning.
  • Include note pages in progress, keyboard/swipe navigation and section selection. Announce the note label and section in the live region; long notes scroll within the card.
  • Keep note content plain and escaped. Explicit HTTP(S) links open in a separate tab with noopener noreferrer.
  • Add the note label in all ten locales and document the behavior.

Closes #836.

Verification

On macOS ARM64 with Rust 1.100.0 and Node 26:

  • cargo test --workspace --no-fail-fast: 1,907 passed, 0 failed.
  • cargo test --no-default-features --no-fail-fast: 489 passed, 0 failed; existing dead-code warnings for disabled server/feed paths remain.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings, cargo fmt --all -- --check, git diff --check, and JavaScript syntax check passed.
  • Full Chromium project: 346 passed, 5 skipped and one pantry test failed because an earlier run had left seed/config/pantry.conf changed. After restoring that fixture, the focused pantry retry passed (347 distinct passing cases across the run and retry, 5 skipped). The existing picture-dialog test now waits for its asynchronously loaded options before reading them.
  • All three new Rust regressions fail on the unmodified base. The acceptance browser test also fails on the base because the note cards are absent.
  • Browser coverage includes the acceptance page sequence, grouping, step HTML/numbering, step targeting, section navigation, swipes, timer persistence, escaping, links, long-note scrolling and legacy step-only data. Touch gestures are synthetic Chromium events; no physical phone testing is claimed.

The acceptance sequence is Ingredients (Sear) → Note A → Step 1 → Note B + C → Step 2 → Note D → Note E (Rest) → Bon Appetit. Desktop and phone-size screenshots use a synthetic recipe.

Screenshots

Desktop note card

Note card at phone width

Release note

Cooking mode shows recipe notes between steps without changing step numbers.

Codex assisted with implementation and tests.

@dubadub dubadub left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this works well: notes keep their file order, step numbers and timers are unaffected, and the note text is escaped properly. I'm approving. Three optional cleanups, here or in a follow-up:

  1. Steps are sent twice. Each section's cooking-mode JSON now carries every step in both steps and items. The only reader is cooking-mode.js, which uses steps only for section.steps.length, and the picture-dialog e2e test already had to patch both lists. Counting steps from items and dropping steps would leave one source of truth.
  2. Unused globalStepNumber. startCookingMode(globalStepNumber) gains a parameter, but nothing passes it: both the Cook button and the keyboard shortcut call startCookingMode(). Please drop it unless something is going to use it (starting at a given step, for example).
  3. Links only in cooking mode. Cooking mode turns http(s) URLs in notes into links, but recipe.html shows the same notes as plain text. Either keep them plain in cooking mode or add the same linking to the recipe page, so a note looks the same in both views.

- Send each section's steps once, in `items`. Cooking mode counts a
  section's steps from it, so the `steps` list is gone from the JSON.
- Drop the `globalStepNumber` parameter of `startCookingMode`: both
  callers open cooking mode at the start.
- Link http(s) URLs in notes on the recipe page too (`link_urls` filter),
  with the same rules as cooking mode, so a note reads the same in both
  views.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jjohnnystwsss

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I took all three in b352a4b:

  1. Steps are sent twice: the JSON now has only items. Cooking mode counts a section's steps from it (for the section card and "Step N of M"), and the two e2e tests that read or patched steps use items.
  2. Unused globalStepNumber: removed, along with the test that called startCookingMode(2) directly and the legacy step-only test, since no page sends that shape any more.
  3. Links only in cooking mode: I went with linking on the recipe page as well, since Cooking mode: show recipe notes as cards of their own #836 asks for tappable URLs in cooking mode. A link_urls filter escapes the note and links http(s) URLs with the same rules as noteHTML (trailing .,;:!? stay outside, other schemes stay text). There are unit tests for it and a test that renders the recipe page; docs/server.md now says both views link.

Checks: cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test (1367 passed), and the whole Chromium Playwright project: 344 passed, 5 skipped; two shopping-list-live ticks tests failed in the parallel run and passed with --workers=1.

@dubadub
dubadub merged commit cb41bff into cooklang:main Nov 24, 2026
5 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.

Cooking mode: show recipe notes as cards of their own

2 participants