Commit Graph

70 Commits

Author SHA1 Message Date
clawd bf372b28f5 checkpoint: 05-03 completed 2026-03-02 19:22:50 +01:00
clawd 83ccd6c601 feat(05-03): Exercise research frontend integration
- Add ExerciseResearchPanel component with Get Research button, loading state, summary display, and source links
- Add ExerciseEncyclopediaPage with exercise list and integrated research panel
- Wire encyclopedia view into App.jsx navigation
- Add encyclopedia nav button to Dashboard
- Add CSS for research panel and encyclopedia search

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 19:20:40 +01:00
clawd 53f026aee2 feat(05-02): exa-search research integration 2026-03-02 14:10:32 +01:00
clawd 994cc9e984 feat(05-01): Exercise database schema + CRUD API 2026-03-02 13:03:30 +01:00
clawd 5a9ea9c9a8 checkpoint: phase 05 (exercise encyclopedia) ready to start
Phase 04 (workout modification) complete:
- 14 commits rebased onto main
- All features verified and staged
- Ready for merge

Phase 05 structure defined:
- 05-01: Exercise DB schema & CRUD API
- 05-02: AI research integration (exa-search)
- 05-03: Demo video generation (Veo)
- 05-04: Search & Add UI
- 05-05: Exercise detail view
- 05-06: User ratings & feedback

Next: PM starts 05-01 (backend foundation)
2026-03-02 09:26:32 +01:00
clawd fac53a3605 chore: add dist and build artifacts to .gitignore
- Exclude frontend/dist/ (build output)
- Exclude .py files (script templates)
- Exclude PY temp files
2026-03-02 09:25:10 +01:00
clawd 994f406050 fix: make backend listen on 0.0.0.0 instead of localhost
This allows Traefik and other containers on the docker network to reach the backend API.
2026-03-02 09:25:10 +01:00
clawd f941011130 chore: remove stray EOF and PLANEOF files 2026-03-02 09:25:10 +01:00
clawd fa95e880b2 docs: add CLAUDE.md — agent development guidelines
- Core principles for autonomous agents with verification
- Checkpoint-based self-monitoring patterns
- Generalized agent workflow (no project-specific agents)
- Single source of truth in ~/clawd/claude-agents-skills/
- PM autonomy and cron job configuration
- Verification protocol to prevent hallucinations
- Together with CODING-CONVENTIONS.md, foundation for agent development
2026-03-02 09:25:10 +01:00
clawd f63f4c0420 04-06-02: Save error handling & retry logic
- Added specific error type differentiation:
  * Network errors → 'Anslutning misslyckades'
  * Validation (400) → 'Ogiltiga ändringar'
  * Auth (401/403) → 'Saknar behörighet'
  * Server (500+) → 'Serverfel'
  * Generic fallback messages

- Implemented retry tracking:
  * retryCount state for monitoring attempts
  * lastSavePayload storage for potential retry (future feature)
  * Console logging with context for debugging

- Enhanced error handling:
  * getErrorMessage() function for error classification
  * Comprehensive error logging with workout/exercise context
  * Draft preserved on all error types (no data loss)

- Improved UI/UX:
  * Error banner with specific, actionable messages
  * 'Försök igen' button with retry tracking
  * Sync status feedback (idle/saving/saved/error)
  * Success checkmark animation (2s duration)
  * Spinner animation during save

- CSS Enhancements:
  * @keyframes spin for loading spinner
  * @keyframes slideInCheckmark for success feedback
  * Mobile-responsive error banner (flex column on <480px)
  * Smooth animations for state transitions

Tests: npm run build ✓ (no syntax errors)
Files modified:
  - frontend/src/pages/WorkoutEditPage.jsx
  - frontend/src/pages/WorkoutEditPage.css
2026-03-02 09:25:10 +01:00
clawd 475cf10b17 04-06: Plan persistence improvements and implement draft persistence
- Created 04-06-PLAN.md outlining persistence improvements phases
- Phase 04-06-01: Draft persistence via localStorage
  - Added useDraftWorkout hook for auto-saving/loading drafts
  - Integrated hook into WorkoutEditPage
  - Added draft recovery prompt UI
  - Drafts cleared after successful save
- Phase 04-06-02: Save error handling & retry (scaffolding)
  - Added error state and syncStatus tracking
  - Added handleRetry() for failed saves
  - Error banner with retry button
- Phase 04-06-03: Sync status UI (scaffolding)
  - Added visual feedback for save progress
  - Status indicators: saving, saved, error
  - Disabled UI during save to prevent conflicts
- Created comprehensive styles for new UI components

Status: 04-06-01 complete and integrated. Ready for testing.
2026-03-02 09:25:10 +01:00
clawd cf85e9e314 04-05: Reset to Original feature - custom workouts can be reverted to program versions
- Added reset button (refresh icon) to custom workout cards
- Implemented confirmation dialog to prevent accidental resets
- Integrated with DELETE /api/custom-workouts/:id endpoint
- Added CSS styling: reset button, success message, modal dialog
- Added refresh icon to SVG library
- Frontend build successful

Changes:
- frontend/src/pages/WorkoutSelectPage.jsx (reset flow logic)
- frontend/src/App.css (170 new lines for reset/modal styling)
- frontend/src/components/Icons.jsx (refresh icon)
- Checkpoint updated with task completion metadata
2026-03-02 09:25:10 +01:00
clawd b5c9250a10 feat(04-04-visual-distinction): Add custom vs program workout badges on WorkoutSelectPage
- Fetch custom workouts for authenticated user
- Display 'Anpassad' (custom) or 'Program' badge on each workout card
- Add badge component with orange accent for custom, muted color for program
- Badge positioned bottom-right of workout icon
- Responsive styling consistent with Gravl dark theme
- All build checks pass
2026-03-02 09:25:10 +01:00
clawd a24199e56c feat(04-03-partial): ExercisePicker and WorkoutEditPage components - swap/add/remove exercises with sets/reps editing 2026-03-02 09:25:10 +01:00
clawd 5fd21719d0 test(e2e): add Playwright with browser tests for login, logo, dashboard 2026-03-02 09:25:10 +01:00
clawd 4bd2c9607d feat(phase-4): Backend API for custom workouts
- Add custom_workouts and custom_workout_exercises tables (schema)
- New endpoints:
  - GET /api/exercises - List all exercises for picker
  - POST /api/custom-workouts - Fork program workout
  - GET /api/custom-workouts - List user's custom workouts
  - GET /api/custom-workouts/:id - Get workout with exercises
  - PUT /api/custom-workouts/:id - Update workout exercises
  - DELETE /api/custom-workouts/:id - Delete custom workout
- Updated endpoints for source_type support:
  - GET /api/logs - Filter by source_type and custom_workout_id
  - POST /api/logs - Save with source_type and custom_workout_id
  - DELETE /api/logs - Support custom workout log deletion
- Adds Phase 4 planning overview

Completes: 04-01-schema-migration, 04-02-backend-api
Next: 04-03-frontend-workout-edit
2026-03-02 09:25:10 +01:00
clawd 22750bfa06 fix(staging): fix Traefik service linking with explicit service labels 2026-03-02 09:25:10 +01:00
clawd 4b39f39e3e feat(staging): add Traefik-based staging with automatic subdomains 2026-03-02 09:25:10 +01:00
clawd 7694ca6313 feat(infra): add staging environment setup with docker-compose and scripts 2026-03-02 09:25:10 +01:00
sphinxen 15d7aff096 Merge pull request 'feature/03-design-polish' (#1) from feature/03-design-polish into main
Reviewed-on: https://gitea.homelab.local/clawd/gravl/pulls/1
2026-03-02 09:08:10 +01:00
clawd 362f4eed49 checkpoint: mark phase 3 complete (03-01, 03-02, 03-03) 2026-03-01 00:03:48 +01:00
clawd 6d1da03fec 03-03: Workout Experience Polish - enhanced exercise cards, progress badges, rest timer, KLART button, warmup styling 2026-02-28 23:47:36 +01:00
clawd 5d0e0e3952 feat(dashboard): polish header logo, stat cards, calendar and animations
- Replace gravl icon text with Logo component in dashboard header
- Stat cards: gradient depth + per-card colour accent (orange/green/amber)
- Calendar today: pulsing glow animation; workout days get subtle brand tint
- Arrow nudge animation on today-workout-card hover
- Section stagger fade-in on page load (calendar → coach → stats)
- Larger stat-value font (3xl) with tighter letter-spacing
- Consistent gap spacing in dashboard-main (space-6)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 23:22:34 +01:00
clawd be4a149a47 feat(auth): polish login/register with logo, gradients and animations 2026-02-28 22:59:08 +01:00
clawd 0cd6cd0269 checkpoint: mark 03-01-login-onboarding-polish as completed 2026-02-28 22:58:24 +01:00
clawd e40b486ae5 feat(onboarding): add conversational ChatOnboarding component 2026-02-28 22:06:15 +01:00
clawd 04bab32e26 design: WorkoutPage Hevy-style redesign + AlternativeModal + backend API
- Add GET /api/exercises/:id/alternatives endpoint
- Add GET /api/exercises/:id/last-workout endpoint
- New AlternativeModal component for swapping exercises
- WorkoutPage: single-tap logging, +/- buttons, rest timer
- Updated Icons with new workout icons
- Polish: card shadows, borders, micro-interactions
- Tasks directory for project management
2026-02-28 21:25:23 +01:00
clawd 0e5cec927a docs: add TDD coding conventions
Red/Green/Refactor cycle is now mandatory for all development
2026-02-28 14:43:25 +01:00
clawd 7b4625c78f docs: add phase 3 design polish planning, update progress 2026-02-26 23:53:22 +01:00
clawd a72deba7a6 docs(phase-02): complete phase execution 2026-02-21 18:49:36 +01:00
clawd 84fa21214b docs: add Stop hook implementation plan
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 18:47:13 +01:00
clawd 0462adab8d docs(02-02): complete DELETE logs endpoint plan — summary and state update
- 02-02-SUMMARY.md: backend DELETE endpoint + frontend deleteLog wiring
- STATE.md: phase 2 marked complete, decisions added, position advanced to phase 3 ready
2026-02-21 18:46:26 +01:00
clawd d222acd45c docs: add Stop hook design doc
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 18:45:43 +01:00
clawd 64633981ed feat(02-02): wire deleteLog through App.jsx and WorkoutPage to ExerciseCard
- Added deleteLog function in App.jsx: calls DELETE /api/logs and removes entry from local logs state
- Passed onDeleteSet={deleteLog} to WorkoutPage in workout view render
- Updated WorkoutPage function signature to accept onDeleteSet prop
- Passed onDeleteSet through to each ExerciseCard (ExerciseCard already calls it in handleDeleteSet)
- Non-logged sets (404 from backend) silently ignored via catch block
2026-02-21 18:44:58 +01:00
clawd 889eb50070 feat(02-02): add DELETE /api/logs endpoint to backend
- DELETE /api/logs accepts user_id, program_exercise_id, date, set_number in request body
- Deletes matching workout_logs row by composite key
- Returns 200 + deleted id on success, 404 if row not found
- Consistent with existing POST /api/logs (no auth middleware, user_id from body)
2026-02-21 18:44:18 +01:00
clawd 74844fa3e7 docs(02-01): complete flexible sets plan 01 — summary and state update
- 02-01-SUMMARY.md: dynamic setList refactor, add-set modal, delete-set with last-set guard
- STATE.md: advance to phase 2 plan 2, record decisions, update metrics and session

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 18:43:18 +01:00
clawd e0930fdef9 feat(02-01): add CSS for add-set button, delete-set button, and set-type modal
- .add-set-btn: full-width dashed border button, 44px touch target, accent hover
- .delete-set-btn: 36px wide inline button, subtle opacity, red on hover, disabled state
- .set-type-modal-overlay: fixed fullscreen overlay with semi-transparent dark background
- .set-type-modal: bottom-sheet card (border-radius top only), max-width 600px
- .set-type-option: full-width option card with label/description layout, 56px tall
- .set-type-option.dropset: accent-colored title for dropset option
- .set-type-cancel: borderless cancel button, 44px touch target
- Uses existing dark theme variables: --bg-card, --bg-secondary, --border, --accent, --text-primary, --text-secondary
2026-02-21 18:41:33 +01:00
clawd 303e332d65 feat(02-01): refactor ExerciseCard to dynamic setList with add-set modal and delete-set
- Replace fixed setInputs object with setList array state
- Add showAddModal state and set-type chooser modal (Vanligt set / Dropset)
- handleAddNormal: append one set pre-filled from last row's weight and reps
- handleAddDropset: append 3 sets at 100%/80%/60% weight (rounded to 2.5kg), 10 reps
- handleDeleteSet: remove by index with last-set guard (no delete when only 1 remains)
- handleComplete and handleInputChange updated to use array index (idx+1 as set_number)
- Progress badge and all-done class use setList.length instead of exercise.sets
- onDeleteSet prop added (optional stub for backend wiring in plan 02)
- Add trash icon SVG to Icons.jsx (outline trash can, consistent with icon library)
2026-02-21 18:40:45 +01:00
clawd 26b7809027 docs(phase-02): research flexible sets phase
Researched:
- Dropset conventions: 20-25% weight reduction per step (HIGH confidence, strength training literature)
- React array management: Use filter() for immutable removals (HIGH confidence, official React docs)
- Mobile delete UX: Combine inline icons + optional swipe, 48px touch targets (HIGH confidence, WCAG + NN/G)
- Lightweight modal: Plain CSS overlay pattern without component library (MEDIUM confidence, verified with community)
- Backend set numbering: Recommend frontend renumbering before save to handle gaps (MEDIUM confidence, needs verification)

Key deliverables:
- Standard Stack: React 18 + plain CSS (no new dependencies)
- Architecture Patterns: Dynamic array management, lightweight modal, inline delete with optional confirmation
- Don't Hand-Roll: Array mutations (use filter), modal dialog (CSS is simpler than library), set calculations
- Common Pitfalls: Set numbering gaps, missing reps defaults, arbitrary weight reductions, last-set deletion
- Code Examples: Add/remove sets, dropset calculations, delete patterns with renumbering

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 18:01:42 +01:00
clawd b4e2fbff3c docs(02): capture phase context 2026-02-21 17:55:32 +01:00
clawd 9e98a8dc60 docs(phase-1): complete phase execution 2026-02-16 08:25:56 +01:00
clawd 2083aaadad docs(01-02): complete stepper integration plan — summary and state update
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 08:22:48 +01:00
clawd 8bb221e829 feat(01-02): integrate WeightInput and RepsInput into ExerciseCard set rows
- Import WeightInput and RepsInput in WorkoutPage.jsx
- Replace bare <input type="number"> elements with stepper components
- Update .set-inputs alignment to flex-start for taller steppers
- Update .set-row alignment to flex-start
- Remove now-redundant .weight-input and .reps-input CSS rules (main + mobile)
2026-02-16 08:21:26 +01:00
clawd eb00ce739d docs(01-03): complete touch target audit plan
- 01-03-SUMMARY.md: audit confirmed all 44px targets already in place from 01-01
- STATE.md: advanced to plan 3/3, updated metrics and decisions

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-16 08:06:00 +01:00
clawd 53ecf14f63 docs(01-input-ux-01): complete stepper input components plan
- SUMMARY.md: documents StepperInput, WeightInput, RepsInput creation
- STATE.md: advanced to plan 1/3, added component decisions
2026-02-16 08:05:11 +01:00
clawd acd715676d feat(01-input-ux-01): add WeightInput, RepsInput wrappers + stepper CSS
- WeightInput: wraps StepperInput with step=2.5, suffix=kg
- RepsInput: wraps StepperInput with step=1, no suffix
- App.css: appended stepper styles (.stepper-wrapper, .stepper-btn, etc.)
- Buttons min 44x44px touch targets, font-size 16px on input
- No existing CSS removed; block appended at end
2026-02-16 08:04:07 +01:00
clawd 0a8c44b5a1 feat(01-input-ux-01): create StepperInput controlled component
- Reusable stepper with +/- buttons flanking a number input
- Handles min clamping, max constraint, decimal steps
- Controlled component (no internal state): value/onChange props
- 44px touch targets, 16px font, aria-labels present
- Rejects non-numeric input silently
2026-02-16 08:03:04 +01:00
clawd fc6b4ce00b docs(01-input-ux): create phase plan 2026-02-16 06:38:05 +01:00
clawd 23cc848f28 docs(01-input-ux): research mobile input UX patterns
Comprehensive research on implementing Phase 1: Input UX for fitness app.
Documents standard stack (React 18 + CSS custom properties), architecture
patterns (stepper components with 44px touch targets, validation), common
pitfalls (iOS auto-zoom, negative values), and verified code examples.

Key findings:
- Mobile touch target minimum 44px (iOS HIG, Material Design, WCAG 2.1)
- iOS auto-zoom prevented with font-size >= 16px on inputs
- Negative value validation in onChange handlers (not just HTML min attr)
- Custom stepper buttons recommended over native browser spinners
- Plain React state sufficient for Phase 1 (no form libraries needed)
- Weight input: 2.5kg steps; Reps input: 1 rep steps
- Includes reusable StepperInput component, WeightInput, RepsInput

All patterns verified against official docs (MDN, Apple HIG, Material Design,
WCAG 2.1) and industry best practices (NN/G, Chakra UI, Material Design).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 06:34:21 +01:00
clawd ed174ad976 docs: create roadmap (3 phases) 2026-02-16 06:29:59 +01:00