diff --git a/conductor/archive/add_calcium_20260213/index.md b/conductor/archive/add_calcium_20260213/index.md new file mode 100644 index 0000000..e44f0f1 --- /dev/null +++ b/conductor/archive/add_calcium_20260213/index.md @@ -0,0 +1,5 @@ +# Track add_calcium_20260213 Context + +- [Specification](./spec.md) +- [Implementation Plan](./plan.md) +- [Metadata](./metadata.json) diff --git a/conductor/archive/add_calcium_20260213/metadata.json b/conductor/archive/add_calcium_20260213/metadata.json new file mode 100644 index 0000000..a7a0f5d --- /dev/null +++ b/conductor/archive/add_calcium_20260213/metadata.json @@ -0,0 +1,8 @@ +{ + "track_id": "add_calcium_20260213", + "type": "feature", + "status": "new", + "created_at": "2026-02-13T00:00:00Z", + "updated_at": "2026-02-13T00:00:00Z", + "description": "Add Calcium bottom row of 'Daily Totals' on the tracker page" +} diff --git a/conductor/archive/add_calcium_20260213/plan.md b/conductor/archive/add_calcium_20260213/plan.md new file mode 100644 index 0000000..6fb4bac --- /dev/null +++ b/conductor/archive/add_calcium_20260213/plan.md @@ -0,0 +1,18 @@ +# Implementation Plan - Add Calcium to Tracker Totals + +This plan follows the Test-Driven Development (TDD) process as outlined in `conductor/workflow.md`. + +## Phase 1: Infrastructure and Red Phase +- [x] Task: Create a failing E2E test for Calcium display + - [ ] Define a new test in `tests/calcium_display.spec.js` that navigates to the tracker and expects a "Calcium" label and a numeric value in the Daily Totals section. + - [ ] Execute the test and confirm it fails (Red Phase). + +## Phase 2: Implementation (Green Phase) [checkpoint: 7718a7f] +- [x] Task: Update tracker template to include Calcium + - [ ] Modify `templates/tracker.html` to add a fourth column to the third row of the "Daily Totals" card. + - [ ] Update existing `col-4` classes in that row to `col-3` to accommodate the new column. + - [ ] Bind the display to `day_totals.calcium` with a `0` decimal place filter and "mg" unit. +- [x] Task: Verify implementation + - [ ] Execute the E2E test created in Phase 1 and confirm it passes (Green Phase). + - [ ] Run existing backend tests to ensure no regressions in nutrition calculations. +- [x] Task: Conductor - User Manual Verification 'Implementation' (Protocol in workflow.md) diff --git a/conductor/archive/add_calcium_20260213/spec.md b/conductor/archive/add_calcium_20260213/spec.md new file mode 100644 index 0000000..289c6a8 --- /dev/null +++ b/conductor/archive/add_calcium_20260213/spec.md @@ -0,0 +1,25 @@ +# Specification - Add Calcium to Tracker Totals + +## Overview +This track adds a Calcium display to the "Daily Totals" section of the tracker page. This allows users to track their calcium intake (in mg) alongside other micronutrients and macronutrients. + +## Functional Requirements +- **Display Calcium:** Add a new column to the third row of the "Daily Totals" card on the `tracker.html` page. +- **Unit of Measurement:** Calcium shall be displayed in milligrams (mg). +- **Precision:** Calcium values shall be rounded to the nearest whole number (0 decimal places). +- **Data Source:** Use the `day_totals.calcium` value provided by the backend, which is already correctly calculated in `calculate_day_nutrition_tracked`. + +## Non-Functional Requirements +- **UI Consistency:** The new Calcium display should match the style of the existing Sugar, Fiber, and Sodium displays (border, padding, centered text, small muted label). +- **Responsiveness:** The layout should remain functional on various screen sizes. Adding a fourth column to the row may require adjusting column widths (e.g., from `col-4` to `col-3`). + +## Acceptance Criteria +- [ ] A "Calcium" box is visible in the "Daily Totals" section of the tracker page. +- [ ] The value displayed matches the sum of calcium from all tracked foods for that day. +- [ ] The unit "mg" is displayed next to or below the value. +- [ ] The layout of the "Daily Totals" card remains clean and balanced. + +## Out of Scope +- Adding Calcium to individual food or meal breakdown tables. +- Updating Open Food Facts import logic (unless found to be missing Calcium data during verification). +- Adding Calcium targets or progress bars. diff --git a/conductor/tracks.md b/conductor/tracks.md index ad90cdc..0b5c54e 100644 --- a/conductor/tracks.md +++ b/conductor/tracks.md @@ -3,6 +3,3 @@ This file tracks all major tracks for the project. Each track has its own detailed plan in its respective folder. --- - -- [x] **Track: Add Calcium bottom row of "Daily Totals" on the tracker page** - *Link: [./tracks/add_calcium_20260213/](./tracks/add_calcium_20260213/)*