Skip to content

feat: redesign the menu and shopping PDF exports - #69

Merged
guplem merged 4 commits into
mainfrom
feat/pdf-export-redesign
Sep 24, 2026
Merged

guplem merged 4 commits into
mainfrom
feat/pdf-export-redesign

Conversation

@guplem

@guplem guplem commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Both PDF exports get a clearer layout, and no information is lost. Every value of the old PDFs is still printed. A human approved the design from before/after previews built with the bundled default recipes and menu.

Menu PDF

  • Each week starts on its own page. Before, week 2 broke in the middle of its table.
  • A cook note ("2p · cook 6 servings") is bold teal, and a leftovers note is gray italic. A legend under the title explains both.
  • The recipes start on a new page. Each recipe shows its facts as chips (servings, total time, work time, cooking time) and its ingredients in a two-column grid with the amounts aligned on the right.
  • Each step shows a bold teal number, then its times, then the ingredients that it uses.

Shopping PDF

  • Each trip starts on its own page, with a banner such as "Trip 1 of 3: now · 65 items".
  • Each ingredient has a box to tick, a bold name, and the amount on the right.
  • Product rows start with the packs to buy. The best product has a green "Recommended" badge. "Freeze on arrival" is a blue badge.
  • "Needed for" is a small striped table with three columns: when, dish, and amount.
  • An ingredient with no store product says so. A line under the title explains how to use the page in the shop.

Both

  • New lib/theme/pdf_theme.dart holds the shared colors (the teal of the app seed color), the page, a "Page X of Y" footer, a section banner and a badge.
  • The PDF text reader of the tests moves to test/helpers/pdf_bytes_reader.dart, so the menu tests can count pages and read drawn text too.

Tests

  • Red-green TDD for every new text function and for the page breaks. I reverted each page break once, and only the matching test failed.
  • 1050 tests pass, flutter analyze is clean, and the format check passes.

Out of scope

  • The built-in PDF font cannot draw characters outside Latin-1 (for example € or ½). A bundled font would fix this, but the tests read drawn text in a way that only works with the built-in font. This needs its own PR.
  • The shopping PDF already listed only the week-1 meals under a long-life item that trip 1 buys for several weeks (for example 28 eggs bought, 8 listed). This PR does not change that. It needs its own fix.

🤖 Generated with Claude Code

guplem and others added 4 commits September 24, 2026 12:58
The menu PDF and the shopping PDF each set their own sizes and grays,
so the two files looked unrelated. pdf_theme.dart now holds one teal
accent (the default seed color of the app), the A4 page, a footer with
"Page X of Y", a section banner, and a small badge.

A footer names the document and the page, so a loose printed page still
says where it belongs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Before, week 2 broke in the middle of its table, the bullet list of
ingredients took a lot of height, and a cook meal looked the same as a
leftovers meal. Now:

- Each week and the recipe section start on a new page.
- A cook note is bold teal, a leftovers note is gray italic, and a
  legend under the title explains both.
- Each recipe shows its facts as chips and its ingredients in a grid of
  two columns. The header and the grid stay on one page.
- Each step shows a teal number, then its times, then the ingredients
  that it uses, on separate lines.

No information is lost: every value of the old PDF is still printed.

The text reader of the shopping tests moves to test/helpers, so the
menu tests can count pages and read drawn text too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Before, every product line was an underlined blue link, the trip title
was a bare "now", and the meal lines were long sentences. Now:

- Each trip starts on a new page, with a banner that numbers the trip
  and counts its items ("Trip 1 of 3: now", "65 items").
- Each ingredient has a box to tick, and its amount sits on the right.
- Product rows start with the packs to buy. The best product carries a
  green "Recommended" badge, and "Freeze on arrival" is a blue badge.
- "Needed for" is a small striped table: when, dish, amount.
- An ingredient with no store product says so, and a line under the
  title explains how to read the page.

No information is lost: every value of the old PDF is still printed.
The meals table stays a separate page widget, so a staple with 80 meal
lines still continues over two pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@guplem guplem added the waiting-for-human-check No human has verified this yet -- direct AI output label Sep 24, 2026
@guplem guplem self-assigned this Sep 24, 2026
@guplem
guplem merged commit 410dafa into main Sep 24, 2026
1 check passed
@guplem
guplem deleted the feat/pdf-export-redesign branch September 24, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-for-human-check No human has verified this yet -- direct AI output

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant