Commit Graph

207 Commits

Author SHA1 Message Date
f04318f76a - Updated the AdminReferenceValueTypesPage to enhance text alignment and styling for form fields.
All checks were successful
Deploy Development / deploy (push) Successful in 56s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
- Refactored ProfileReferenceValuesPage to apply consistent styling for form elements and improve layout.
- Adjusted button styles for better visual consistency across the forms.
2026-04-06 20:01:23 +02:00
ab616ba044 feat: Introduce admin reference value types management in API and UI
All checks were successful
Deploy Development / deploy (push) Successful in 54s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 16s
- Added new routes and API endpoints for managing reference value types in the admin section.
- Updated the frontend to include navigation and components for reference value types management.
- Enhanced the backend to support the new reference value types in the data layer and versioning.
2026-04-06 19:51:23 +02:00
f0e6fd04fb feat: Add personal reference values management in settings and API
All checks were successful
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
- Introduced new routes and API endpoints for managing personal reference values.
- Updated the SettingsPage to include a section for reference values with navigation to manage them.
- Enhanced the backend to support reference values in the data layer and versioning.
- Added necessary imports and UI components for a seamless user experience.
2026-04-06 19:45:06 +02:00
e7dedd527f feat: Implement focus area usage types management in API and UI
All checks were successful
Deploy Development / deploy (push) Successful in 51s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
- Added endpoints for listing and updating focus area usage types in the backend.
- Enhanced the AdminFocusAreasPage to display and manage allowed usage types for focus areas.
- Introduced a new state for usage types catalog and integrated it into the focus area editing process.
- Updated API utility functions to support new usage types operations.
2026-04-06 07:28:19 +02:00
49e9c9c214 feat: Integrate caliper data enrichment and weight loading in API responses
All checks were successful
Deploy Development / deploy (push) Successful in 1m0s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 16s
- Enhanced the caliper listing and export functionalities to include enriched data from weight logs.
- Updated the upsert and update operations to utilize new composition functions for body composition calculations.
- Refactored the CaliperScreen component to streamline payload construction by removing unnecessary parameters.
2026-04-06 06:08:37 +02:00
fdaf4471da feat: Adjust navigation height and padding for improved layout and responsiveness
All checks were successful
Deploy Development / deploy (push) Successful in 54s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
2026-04-05 12:16:24 +02:00
6e952f9277 feat: Enhance navigation and dashboard with goals integration and UI improvements
All checks were successful
Deploy Development / deploy (push) Successful in 48s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-04-05 12:07:11 +02:00
952cb90973 feat: Update deployment scripts to use git fetch and reset for more reliable state management
All checks were successful
Deploy Development / deploy (push) Successful in 55s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
2026-04-05 11:39:15 +02:00
bd694b30a6 feat: Add admin access denial alert to Dashboard with timeout handling
All checks were successful
Deploy Development / deploy (push) Successful in 52s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-04-05 11:28:33 +02:00
430a928df6 feat: Update settings page layout with improved field structure and accessibility
All checks were successful
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-04-05 11:19:35 +02:00
c63ec5f700 feat: Enhance profile update functionality with email validation and improved error handling
All checks were successful
Deploy Development / deploy (push) Successful in 51s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-04-05 11:14:01 +02:00
b7f2e2adbe feat: Add Admin Group Hub page and update navigation structure for improved admin management
All checks were successful
Deploy Development / deploy (push) Successful in 53s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-04-05 11:05:45 +02:00
bbc59457ac feat: Refactor admin settings and user management
All checks were successful
Deploy Development / deploy (push) Successful in 53s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 14s
- Removed Admin Panel from SettingsPage and adjusted related logic.
- Added EmailSettings component for SMTP configuration and testing.
- Created admin navigation structure in adminNav.js for better organization.
- Implemented AdminShell layout for consistent admin UI.
- Added RequireAdmin component to protect admin routes.
- Developed AdminHomePage for admin dashboard with navigation links.
- Created AdminSystemPage for SMTP settings and placeholder metadata export.
- Implemented AdminUsersPage for user management, including profile creation and editing.
2026-04-05 10:32:43 +02:00
190c0dd7fa feat: Standardize capture page layout to a unified content width across all relevant pages
All checks were successful
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
2026-04-05 10:21:06 +02:00
a4376d1cd8 feat: Implement CaptureShell layout with sub-navigation for capture section
All checks were successful
Deploy Development / deploy (push) Successful in 46s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 13s
2026-04-05 10:17:47 +02:00
a639d08037 feat: Update capture page layout for improved responsiveness and organization across multiple screens
All checks were successful
Deploy Development / deploy (push) Successful in 46s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
2026-04-05 10:14:07 +02:00
630a3de88a feat: Refactor analysis navigation to use category-based grouping and update state management
All checks were successful
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
2026-04-05 10:06:29 +02:00
6d0e2de66d Gruppierung Analysen
All checks were successful
Deploy Development / deploy (push) Successful in 59s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
2026-04-05 09:04:08 +02:00
1fa0edb3b5 feat: Implement responsive analysis page layout with horizontal navigation for mobile and vertical navigation for desktop
All checks were successful
Deploy Development / deploy (push) Successful in 54s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
2026-04-05 08:52:40 +02:00
ac31c5e014 feat: Implement responsive history page layout with horizontal tabs for mobile and vertical tabs for desktop
All checks were successful
Deploy Development / deploy (push) Successful in 48s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
2026-04-05 08:46:37 +02:00
422a117026 feat: Refactor dashboard layout with new DashboardSection and DashboardTile components for improved responsiveness and organization
All checks were successful
Deploy Development / deploy (push) Successful in 56s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-04-05 08:42:07 +02:00
d51bfd3daa feat: Update dashboard layout to use grid for responsive stat cards
All checks were successful
Deploy Development / deploy (push) Successful in 55s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-04-05 08:12:10 +02:00
c2b2c71ccd feat: Enhance Dashboard layout with responsive greeting and metrics display
All checks were successful
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
2026-04-05 08:03:53 +02:00
7e8422cbd7 feat: Implement responsive desktop sidebar navigation and update app structure
All checks were successful
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
2026-04-05 07:58:38 +02:00
cab5758b0d fix: Save prompt_name in graph_data for readable node display
All checks were successful
Deploy Development / deploy (push) Successful in 53s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Bug:
- Analysis nodes showed "Prompt #7edc6d6b-6cd5..." in canvas
- After re-selecting prompt, showed readable name "Pipeline: Ernährungs-Analyse"
- After loading workflow, showed UUID again

Root Cause:
- Serializer saved only prompt_id, not prompt_name
- Deserializer expected prompt_name but got null
- AnalysisNode fallback logic: data.prompt_name || `Prompt #{prompt_id}`
- Result: Showed UUID as fallback

Fix:
- workflowSerializer.js line 25: Added prompt_name to serialization
- Now saves both prompt_id AND prompt_name in graph_data
- On load: prompt_name is restored → AnalysisNode shows readable name

Testing:
- Create workflow with analysis node + prompt selection
- Save → Canvas should show "Pipeline: Körper-Analyse" (not UUID)
- Reload → Canvas should still show readable name (not UUID)
2026-04-04 22:50:40 +02:00
84c1fa3c1d fix: UUID handling - remove parseInt() for prompt IDs
All checks were successful
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 13s
Critical Bug Fixes:
1. Prompt IDs are UUIDs (strings), NOT numbers
2. parseInt(UUID) produces wrong results:
   - parseInt("3b4d7d64-...") = 3 (truncates at first non-digit)
   - parseInt("aa291dde-...") = NaN
3. This caused:
   - Prompt selection: saved as NaN instead of UUID
   - Load workflow: GET /api/prompts/3 instead of /api/prompts/3b4d7d64-...
   - 405 Method Not Allowed errors

Changes:
- useEffect: loadWorkflow(id) instead of loadWorkflow(parseInt(id))
- Prompt onChange: prompt_id: promptId (string) instead of parseInt(promptId)
- Removed NaN check (unnecessary for UUID strings)

Root Cause: Backend uses UUID primary keys, frontend assumed integer IDs

Testing: Console logs still active for verification
2026-04-04 22:39:08 +02:00
2b8bebd381 debug: Add comprehensive console logging for workflow editor debugging
All checks were successful
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Debug Logs Added:
- useEffect: Log ID validation and loadWorkflow calls
- loadWorkflow: Log API response, graph_data, deserialization results
- handleNodeUpdate: Log updates and resulting node state
- handleSave: Log serialization, API calls, navigation

Bug Fixes:
- useEffect: Add !isNaN(parseInt(id)) check to prevent /api/prompts/NaN calls
- Prompt selection: String conversion for value prop (Number vs String mismatch)
  - <select value={String(selectedNode.data.prompt_id)}>
  - <option value={String(prompt.id)}>
  - onChange: find with String(p.id) === promptId

Issues to Debug:
- Why does useEffect run with id=undefined after navigate?
- Why does loadWorkflow not populate nodes/edges?
- Why does prompt selection not persist?

Next Step: User tests with Browser Console open, reports logs
2026-04-04 22:30:43 +02:00
2f70a39052 fix: Phase 5 - Workflow Editor UX Fixes (Round 3)
All checks were successful
Deploy Development / deploy (push) Successful in 53s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Frontend Fixes:
- AdminPromptsPage: Edit button navigates to workflow-editor for workflow type prompts
- WorkflowEditorPage: Fixed save navigation (alert before navigate)
- WorkflowEditorPage: selectedNode derived from selectedNodeId (eliminates stale state)
- FallbackConfig: Show node labels instead of IDs in fallback edge dropdown
- WorkflowCanvas: Enable edge deletion with deletable: true
- WorkflowEditorPage: Hide sidebar when config panel is open

Bugs Fixed:
- C1: Save error "Method Not Allowed" after success
- C2: Edit button in admin doesn't open workflow editor
- H1: Prompt selection not displayed when re-editing node
- H2: Fallback edge dropdown shows node_1/node_2 instead of names
- H3: Cannot delete edges
- M1: Sidebar takes space when config panel open

Technical Changes:
- Replaced useState(selectedNode) with useState(selectedNodeId) + derived selectedNode
- Removed sync useEffect (no longer needed with derived state)
- Added nodes prop to FallbackConfig for label lookup
- Swapped alert/navigate order to prevent navigation errors

Testing: Manual testing required (see manual test cases)
2026-04-04 21:16:15 +02:00
7d22b052dd fix: Phase 5 - Workflow save + node persistence bugs
All checks were successful
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
KRITISCHE FIXES:

1. Backend: Workflow-Type Support
   - models.py: graph_data Feld hinzugefügt
   - models.py: slug Optional (auto-generiert)
   - prompts.py: 'workflow' in erlaubten Typen
   - prompts.py: graph_data in INSERT/UPDATE
   - prompts.py: Auto-Slug-Generierung aus Name
   - FIX: "Field required: slug" Error behoben

2. Frontend: Node-Updates Persistence
   - selectedNode sync mit nodes array (useEffect)
   - FIX: Änderungen gingen verloren (stale state)
   - FIX: Prompt-Auswahl nicht sichtbar nach Edit
   - FIX: Fallback-Strategy nicht gespeichert
   - FIX: Node-Name Änderungen nicht übernommen

BEHOBEN:
-  Save fehlgeschlagen →  Workflows speicherbar
-  Node-Name ignoriert →  Live-Update
-  Prompt verschwindet →  Bleibt sichtbar
-  Fallback nicht saved →  Persistiert

Tested: Backend API akzeptiert jetzt type='workflow'

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 19:17:41 +02:00
e3ef18674a fix: Phase 5 - Critical UX bugs in Workflow Editor
All checks were successful
Deploy Development / deploy (push) Successful in 55s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Behebt 5 kritische Bugs die Editor unbenutzbar machten:

BUG-01: Config Panel - Close Button hinzugefügt (×)
- User war im Config Panel "gefangen"
- Jetzt: Click × zum Deselektieren

BUG-02: Save UX - Validierungs-Feedback verbessert
- Speichern-Button zeigt Lock-Icon (🔒) bei Fehlern
- Tooltip erklärt warum Speichern blockiert ist
- Error-Message mit Hinweis auf Validierung

BUG-03: Analysis Node - Prompt-Auswahl implementiert
- Dropdown zum Auswählen von Basis-Prompts
- Lädt verfügbare Prompts via API
- Zeigt gewählten Prompt-Namen an

BUG-04: Label-Input - UX verbessert
- Header zeigt "Node-Konfiguration" (nicht Label)
- Input hat Placeholder und Hilfetext
- "Änderungen automatisch übernommen" Hinweis

BUG-05: Admin Page - "Neuer Workflow" Button
- Button neben "+ Neuer Prompt"
- Navigiert zu /workflow-editor/new
- Workflow-Filter im Type-Filter hinzugefügt

Tested: Manuell durch User (alle Bugs bestätigt gefixt)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 18:59:47 +02:00
dc59596f01 feat: Phase 5 - Visual Workflow Editor (Option B)
Some checks failed
Deploy Development / deploy (push) Failing after 1s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 14s
Backend (Mini-Backend 1-2h):
- Migration 016: ai_prompts.graph_data JSONB column
- workflow_executor: graph_data parameter support (backward-compatible)
- prompt_executor: execute_workflow_prompt uses graph_data

Frontend (Main effort 25-35h):
- WorkflowCanvas: React Flow wrapper component
- 5 Custom Nodes: Start, End, Analysis, Logic, Join
- 4 Config Panels: QuestionAugmentation, LogicExpression, Fallback, Join
- workflowValidation: Structural + logical validation
- workflowSerializer: Canvas ↔ JSONB conversion
- WorkflowEditorPage: Main orchestration (420 LOC)
- Route: /workflow-editor/:id
- CSS: workflowEditor.css (300 LOC)

Architecture:
- Option B: ai_prompts.type='workflow' (not separate table)
- panels/ subdirectory for clean separation
- WorkflowCanvas reusable component
- User GUI identical (Workflows = Prompts)
- Backward-compatible (type='pipeline' unchanged)

Version: v0.9m → v0.9n (Phase 5 complete)
Module: workflow 0.5.0 → 0.6.0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 17:56:00 +02:00
a7058c30be feat: Enhance EmojiIconPicker with search functionality and keyword support
All checks were successful
Deploy Development / deploy (push) Successful in 49s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-04-04 14:22:44 +02:00
2101080719 feat: Expand EmojiIconPicker with additional curated emoji groups and enhance functionality for custom groups
All checks were successful
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
2026-04-04 14:17:35 +02:00
5aae999a65 feat: Add EmojiIconPicker component and integrate it into Admin pages for icon selection
All checks were successful
Deploy Development / deploy (push) Successful in 45s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 13s
2026-04-04 14:07:54 +02:00
087e8dd885 feat: Add Placeholder Metadata Export to Admin Panel
All checks were successful
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 19s
Adds download functionality for complete placeholder metadata catalog.

Backend:
- Fix: None-template handling in placeholder_metadata_extractor.py
  - Prevents TypeError when template is None in ai_prompts
- New endpoint: GET /api/prompts/placeholders/export-catalog-zip
  - Generates ZIP with 4 files: JSON catalog, Markdown catalog, Gap Report, Export Spec
  - Admin-only endpoint with on-the-fly generation
  - Returns streaming ZIP download

Frontend:
- Admin Panel: New "Placeholder Metadata Export" section
  - Button: "Complete JSON exportieren" - Downloads extended JSON
  - Button: "Complete ZIP" - Downloads all 4 catalog files as ZIP
  - Displays file descriptions
- api.js: Added exportPlaceholdersExtendedJson() function

Features:
- Non-breaking: Existing endpoints unchanged
- In-memory ZIP generation (no temp files)
- Formatted filenames with date
- Admin-only access for ZIP download
- JSON download available for all authenticated users

Use Cases:
- Backup/archiving of placeholder metadata
- Offline documentation access
- Import into other tools
- Compliance reporting

Files in ZIP:
1. PLACEHOLDER_CATALOG_EXTENDED.json - Machine-readable metadata
2. PLACEHOLDER_CATALOG_EXTENDED.md - Human-readable catalog
3. PLACEHOLDER_GAP_REPORT.md - Unresolved fields analysis
4. PLACEHOLDER_EXPORT_SPEC.md - API specification

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 20:37:52 +02:00
4c22f999c4 feat: Konzept-konforme Nutrition Charts (E1-E5 komplett)
All checks were successful
Deploy Development / deploy (push) Successful in 53s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 17s
Backend Enhancements:
- E1: Energy Balance mit 7d/14d rolling averages + balance calculation
- E2: Protein Adequacy mit 7d/28d rolling averages
- E3: Weekly Macro Distribution (100% stacked bars, ISO weeks, CV)
- E4: Nutrition Adherence Score (0-100, goal-aware weighting)
- E5: Energy Availability Warning (multi-trigger heuristic system)

Frontend Refactoring:
- NutritionCharts.jsx komplett überarbeitet
- ScoreCard component für E4 (circular score display)
- WarningCard component für E5 (ampel system)
- Alle Charts zeigen jetzt Trends statt nur Rohdaten
- Legend + enhanced metadata display

API Updates:
- getWeeklyMacroDistributionChart (weeks parameter)
- getNutritionAdherenceScore
- getEnergyAvailabilityWarning
- Removed old getMacroDistributionChart (pie)

Konzept-Compliance:
- Zeitfenster: 7d, 28d, 90d selectors
- Deutlich höhere Aussagekraft durch rolling averages
- Goal-mode-abhängige Score-Gewichtung
- Cross-domain warning system (nutrition × recovery × body)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 07:28:56 +02:00
d4500ca00c feat: Phase 0c Frontend Phase 1 - Nutrition + Recovery Charts
All checks were successful
Deploy Development / deploy (push) Successful in 46s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
- Create NutritionCharts component (E1-E5)
  - Energy Balance Timeline
  - Macro Distribution (Pie)
  - Protein Adequacy Timeline
  - Nutrition Consistency Score

- Create RecoveryCharts component (R1-R5)
  - Recovery Score Timeline
  - HRV/RHR vs Baseline (dual-axis)
  - Sleep Duration + Quality (dual-axis)
  - Sleep Debt Accumulation
  - Vital Signs Matrix (horizontal bar)

- Add 9 chart API functions to api.js
  - 4 nutrition endpoints (E1-E5)
  - 5 recovery endpoints (R1-R5)

- Integrate into History page
  - Add NutritionCharts to existing Nutrition tab
  - Create new Recovery tab with RecoveryCharts
  - Period selector controls chart timeframe

Charts use Recharts (existing dependency)
All charts display Chart.js-compatible data from backend
Confidence handling: Show 'Nicht genug Daten' message

Files:
+ frontend/src/components/NutritionCharts.jsx (329 lines)
+ frontend/src/components/RecoveryCharts.jsx (342 lines)
M frontend/src/utils/api.js (+14 functions)
M frontend/src/pages/History.jsx (+22 lines, new Recovery tab)
2026-03-29 07:02:54 +02:00
d7aa0eb3af feat: show target_date in goal list next to target value
All checks were successful
Deploy Development / deploy (push) Successful in 44s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
- Start value already showed start_date in parentheses
- Now target value also shows target_date in parentheses
- Consistent UX: both dates visible at their respective values
2026-03-28 14:50:34 +01:00
623f34c184 debug: extensive frontend logging for goal dates
All checks were successful
Deploy Development / deploy (push) Successful in 54s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-03-28 14:46:06 +01:00
ab29a85903 debug: Add console logging to trace start_date loading
All checks were successful
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-03-28 13:55:29 +01:00
3604ebc781 fix: Load actual start_date in edit form + improve timeline display
All checks were successful
Deploy Development / deploy (push) Successful in 48s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 15s
**Problem 1:** Edit form showed today's date instead of stored start_date
- Cause: Fallback logic `goal.start_date || today` always defaulted to today
- Fix: Load actual date or empty string (no fallback)
- Input field: Remove fallback from value binding

**Problem 2:** Timeline only showed target_date, not start_date
- Added dedicated timeline display below values
- Shows: "📅 15.01.26 → 31.05.26"
- Only appears if at least one date exists
- Start date with calendar icon, target date bold

**Result:**
- Editing goals now preserves the start_date ✓
- Timeline clearly shows start → target dates ✓
- No more accidental overwrites with today's date ✓

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 13:50:47 +01:00
1c7b5e0653 fix: Include start_date in goal edit form and API call
All checks were successful
Deploy Development / deploy (push) Successful in 51s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
**Bug:** start_date was not being loaded into edit form or sent in update request

**Fixed:**
1. handleEditGoal() - Added start_date to formData when editing
2. handleSaveGoal() - Added start_date to API payload for both create and update

Now when editing a goal:
- start_date field is populated with existing value
- Changing start_date triggers backend to recalculate start_value
- Update request includes start_date

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 13:19:10 +01:00
327319115d feat: Frontend - Startdatum field in goal form
All checks were successful
Deploy Development / deploy (push) Successful in 44s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Added start_date field to goal creation/editing form:

1. New "Startdatum" input field before "Zieldatum"
   - Defaults to today
   - Hint: "Startwert wird automatisch aus historischen Daten ermittelt"

2. Display start_date in goals list
   - Shows next to start_value: "85 kg (01.01.26)"
   - Compact format for better readability

3. Updated formData state
   - Added start_date with today as default
   - API calls automatically include it

User can now:
- Set historical start date (e.g., 3 months ago)
- Backend auto-populates start_value from that date
- See exact start date and value for each goal

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 13:15:56 +01:00
63bd103b2c feat: Phase 0b - add avg_per_week_30d to frontend dropdown
All checks were successful
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-03-28 10:50:51 +01:00
378bf434fc fix: 3 critical bugs in Goals and Vitals
All checks were successful
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 21s
**Bug 1: Focus contributions not saved**
- GoalsPage: Added focus_contributions to data object (line 232)
- Was missing from API payload, causing loss of focus area assignments

**Bug 2: Filter focus areas in goal form**
- Only show focus areas user has weighted (weight > 0)
- Cleaner UX, avoids confusion with non-prioritized areas
- Filters focusAreasGrouped by userFocusWeights

**Bug 3: Vitals RHR entry - Internal Server Error**
- Fixed: Endpoint tried to INSERT into vitals_log (renamed in Migration 015)
- Now uses vitals_baseline table (correct post-migration table)
- Removed BP fields from baseline endpoint (use /blood-pressure instead)
- Backward compatible return format

All fixes tested and ready for production.
2026-03-27 21:04:28 +01:00
3116fbbc91 feat: Dynamic Focus Areas system v2.0 - fully implemented
All checks were successful
Deploy Development / deploy (push) Successful in 44s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
**Migration 032:**
- user_focus_area_weights table (profile_id, focus_area_id, weight)
- Migrates legacy 6 preferences to dynamic weights

**Backend (focus_areas.py):**
- GET /user-preferences: Returns dynamic focus weights with percentages
- PUT /user-preferences: Saves user weights (dict: focus_area_id → weight)
- Auto-calculates percentages from relative weights
- Graceful fallback if Migration 032 not applied

**Frontend (GoalsPage.jsx):**
- REMOVED: Goal Mode cards (obsolete)
- REMOVED: 6 hardcoded legacy focus sliders
- NEW: Dynamic focus area cards (weight > 0 only)
- NEW: Edit mode with sliders for all 26 areas (grouped by category)
- Clean responsive design

**How it works:**
1. Admin defines focus areas in /admin/focus-areas (26 default)
2. User sets weights for areas they care about (0-100 relative)
3. System calculates percentages automatically
4. Cards show only weighted areas
5. Goals assign to 1-n focus areas (existing functionality)
2026-03-27 20:51:19 +01:00
dfcdfbe335 fix: restore Goal Mode cards and fix focus areas display
All checks were successful
Deploy Development / deploy (push) Successful in 44s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
- Restored GOAL_MODES constant and selection cards at top
- Fixed focusAreas/focusPreferences variable confusion
- Legacy 6 focus preferences show correctly in Fokus-Bereiche card
- Dynamic 26 focus areas should display in goal form
- Goal Mode cards now visible and functional again
2026-03-27 20:40:33 +01:00
6ab0a8b631 fix: Rename focusAreas → focusPreferences (duplicate state variable)
All checks were successful
Deploy Development / deploy (push) Successful in 44s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
- Line 60: focusPreferences (user's legacy preferences)
- Line 74: focusAreas (focus area definitions)
- Updated all references to avoid name collision
- Fixes build error in vite
2026-03-27 19:58:35 +01:00
6a961ce88f feat: Frontend Phase 3.2 - Goal Form Focus Areas + Badges
Some checks failed
Deploy Development / deploy (push) Failing after 34s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
**Goal Form Extended:**
- Load focus area definitions on page load
- Multi-Select UI grouped by category (7 categories)
- Chip-style selection (click to toggle)
- Weight sliders per selected area (0-100%)
- Selected areas highlighted in accent color
- Focus contributions saved/loaded on create/edit

**Goal Cards:**
- Focus Area badges below status
- Shows icon + name + weight percentage
- Hover shows full details
- Color-coded (accent-light background)

**Integration Complete:**
- State: focusAreas, focusAreasGrouped
- Handlers: handleCreateGoal, handleEditGoal
- Data flow: Backend → Frontend → Display

**Result:**
- User can assign goals to multiple focus areas
- Visual indication of what each goal contributes to
- Foundation for Phase 0b (goal-aware AI scoring)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 19:54:45 +01:00
d14157f7ad feat: Frontend Phase 3.1 - Focus Areas Admin UI
All checks were successful
Deploy Development / deploy (push) Successful in 52s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
- AdminFocusAreasPage: Full CRUD for focus area definitions
- Route: /admin/focus-areas
- AdminPanel: Link zu Focus Areas (neben Goal Types)
- api.js: 7 neue Focus Area Endpoints

Features:
- Category-grouped display (7 categories)
- Inline editing
- Active/Inactive toggle
- Create form with validation
- Show/Hide inactive areas

Next: Goal Form Multi-Select
2026-03-27 19:51:18 +01:00