Changelog
PNP v1.7.0
Changelog
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/).
[Unreleased]
[1.7.0] - 2026-04-03
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.
[1.6.0] - 2026-03-25
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.
[1.5.0] - 2026-03-10
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).
[1.4.0] - 2026-03-13
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.
[1.3.0] - 2026-03-10
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.
[1.2.0] - 2026-03-03
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”.
[1.1.0] - 2026-03-03
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.
[1.0.0] - 2026-03-02
Added
- Initial launch