Changelog
Current release: 1.8.0 ()
All notable changes to Pro Nutrition Planner are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
Version 1.8.0
Added
- Plan Builder – Plan notes (export preface): Add Notes button (between Save and Export Meal Plan) adds up to three titled note blocks above the first meal. Each block has a heading and body, optional Delete, and the same header/layout styling as meal cards (including dark theme). Notes are stored on `meal_plans.export_notes` (JSON), included when saving the plan, copied when duplicating a plan, and rendered before meals on the Export Meal Plan PDF. Database column is added automatically on connect; optional SQL migration `007_meal_plans_export_notes.sql`.
- Plan Builder – Grocery list days: Export Grocery Shopping List opens a short modal to enter days (1–14); the PDF scales ingredient amounts accordingly (default 7). Filename and copy reflect the chosen day count.
Changed
- Plan Builder – Meal reorder: Move up/down only swaps meal blocks so plan-level notes stay fixed above meals.
- Plan Builder – Notes UI (dark/light): Plan note title and body fields use the same classes and theme rules as meal names and per-meal notes (typography, green note outline, header bar alignment with meal-actions).
Version 1.7.0
Added
- Clients – Add multiple clients: New Add multiple clients action on the Clients list (when not read-only) opens `/app/clients-bulk.php`. Coaches can add dynamic rows (capped by remaining slots on their plan), fill calculator-aligned fields (goal as % of TDEE, activity Sedentary–Heavy, macros, etc.), use per-field help toggles, and submit once. Creates all clients with `client_targets` in a single transaction (all-or-nothing). Validation errors reference client row position on the form. Responsive card layout for mobile with sticky action bar.
Version 1.6.0
Added
- Theme system (logged-in app): Manual Light/Dark mode toggle added in the top navigation near the user menu for coach/admin interfaces. Preference is stored in localStorage (`pnp-theme`) and reapplied across app/admin pages on future visits.
- Theming infrastructure: New foundational theme layer using root-level `data-theme` and shared CSS tokens, plus `assets/css/theme.css` and `assets/js/theme.js` for scalable future theming work.
Changed
- Load behavior / UX: Added early head script to apply saved theme before render, reducing flash-of-incorrect-theme on page load.
- Meal Builder – dark mode polish: Editable fields were refined to reduce the blocky/spreadsheet feel in dark mode. Ingredient/amount/notes fields and meal-header inputs now use subtler backgrounds with clearer hover/focus states.
- Meal Builder – calorie goal copy: Meal calorie goal placeholder updated to "Enter Calorie Goal" for clearer guidance.
- Footer version display: Footer changelog version link now reflects the updated app version (`APP_VERSION` from `app/version.php`).
Fixed
- Meal Builder – Apply Recipe behavior: Applying a recipe now replaces the current meal ingredient list instead of appending on top of existing items, making recipe comparisons faster and cleaner. Related stale undo-scale state for that meal is cleared when recipe replacement occurs.
Version 1.5.0
Added
- Ingredients – Micronutrients: Calcium, magnesium, iron, and zinc added to the ingredients database (migration `004_ingredients_micronutrients.sql`). All new fields default to 0; existing ingredients can be updated via bulk import or single-ingredient edit.
- Plan Builder – Plan totals: Collapsible "More micronutrients" section under Sodium in the Plan Totals sidebar, showing plan-wide totals for Potassium, Calcium, Magnesium, Iron, and Zinc (mg). Styled to match the sidebar (black accent, dropdown chevron). Totals update live when adding ingredients or applying recipes.
Changed
- Admin – Bulk import: Ingredients CSV template and import now include columns for Calcium, Magnesium, Iron, Zinc (13 columns total). Expected columns copy updated.
- Admin – Single ingredient form: Add/Edit ingredient form includes four new fields: Calcium (mg), Magnesium (mg), Iron (mg), Zinc (mg).
- CLI import: `tools/import-data.php` ingredients CSV supports the four new micronutrient columns (optional; default 0).
- Scaling & APIs: Ingredient snapshots and meal/plan totals include the five micros; ingredients-search and recipe-items APIs return the new fields so typeahead and recipe application carry micronutrient data. Single-ingredient typeahead selection now stores calcium, magnesium, iron, zinc in the item snapshot so plan micro totals update live when adding an ingredient (not only when applying a recipe).
Version 1.4.0
Changed
- Plan Builder – Ingredient reordering: Added a dedicated drag handle (hamburger icon) in the lock column with click / drag / drop support for reordering ingredients within a meal. The dragged row now shows a transparent “ghost” copy that follows the cursor for clearer feedback, and the drop position is indicated by a highlighted target row.
Version 1.3.0
Added
- Recipe notes / instructions: Recipes (meal catalogue and custom) now support a notes field for method and instructions. When you apply a recipe to a meal in the Plan Builder, the recipe's notes auto-populate the "Notes for this meal" box, in line with how ingredients are applied.
- Database: New `notes` column on `recipes` table (migration `003_recipes_notes.sql`). Column is created automatically on first DB use if missing.
- One-time import: Script `tools/import-recipe-notes.php` to backfill recipe notes from a CSV (`meal_name`, `method_and_notes`). Usable via CLI or browser with secret key.
- Bulk import (admin): Meals CSV template and import now include a Notes column (second column after Meal Name). Template download and `importMeals()` parse and save notes.
- CLI import: Long-format meal catalogue CSV supports an optional fourth column for recipe notes (taken from the first row per meal).
- Admin Global Recipes: Add/Edit recipe form includes a "Recipe notes / instructions" textarea; notes are saved and returned by the API.
- Coach/private recipes: Add/Edit recipe form includes a "Recipe notes / instructions" textarea; notes are saved and flow into the Plan Builder when the recipe is applied.
- Plan Builder – Notes styling: The "Notes for this meal" textarea uses the same font family (DM Sans), line-height, and text colour as the rest of the page for consistent aesthetics.
Changed
- API `recipe-items.php`: Response now includes `recipe.notes` so the Plan Builder can fill the meal notes when applying a recipe.
- Plan Builder – Apply Recipe: Applying a recipe now sets the meal name, ingredients, and notes from the selected recipe in one step.
Version 1.2.0
Added
- Plan Builder – Export Grocery Shopping List: New button “Export Grocery Shopping List” next to the meal plan export. Produces a PDF in the same layout, branding, and colours as the meal plan, listing ingredients with weekly totals (daily total × 7). Gram/ml amounts are aggregated per ingredient; serve-based items show weekly quantity with portion description.
Changed
- Plan Builder – Export Meal Plan: The former “Generate PDF” button is now labelled “Export Meal Plan”.
Version 1.1.0
Added
- Plan Builder – Sticky Macro Bar: Fixed bar at the bottom showing Calories, Protein, Carbs, and Fat with Target, Current, and Remaining. Collapsible with state persisted in localStorage (`pnpStickyMacroBarCollapsed`). Coloured left borders match the plan totals-card (green/red/green/amber). Uses existing totals and DOM targets; no horizontal overlap (padding-bottom via `--stickybar-space`). iOS safe area respected; responsive layout (4 blocks desktop, 2×2 mobile). Label copy uses “Remaining” (not “Rem”).
Changed
- Plan Builder – Mobile layout: Ingredient table becomes stacked cards on viewports ≤768px. Each row shows: ingredient name (full width), Amt and Cals in separate columns with short labels, P/C/F/Fi/Na in a compact row, then delete. No horizontal scrolling; `overflow-x: hidden` on mobile for builder page and content.
- Plan Builder – Meal totals on mobile: Totals row shows explicit labels (P, C, F, Fi, Na, Cals) with bullet separators so “Meal Total: • P 38.9 • C 25.4 …” is readable. Values live in `.meal-total-val`; labels in `.meal-total-lbl` (hidden on desktop).
- Header logo (mobile): Logo no longer stretches on small screens. CSS: `width: auto; height: auto; max-height: 36px; object-fit: contain` (and 34px max on desktop).
Fixed
- Plan Builder – Mobile: Amount and Calories in ingredient cards no longer overlap or merge (“AmountCal”). Separate flex columns with min-width, 12px gap, and labels “Amt” / “Cals”.
- Plan Builder – Mobile: Meal header actions (Scale, Apply Recipe, Delete) wrap with `flex-wrap` and gap so they fit on narrow viewports.
Version 1.0.0
Added
- Initial launch