Commit Graph

27 Commits

Author SHA1 Message Date
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 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 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 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 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 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 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 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 d2f157c73d Design overhaul: Dark fitness theme, no emojis
CSS:
- Dark background (#0a0a0f, #0d0d12, #15151b)
- Orange accent (#ff6b35)
- Muted text (#a1a1aa, #71717a)
- Inter font from Google Fonts
- Workout type colors (push/pull/legs/etc)

Dashboard:
- Calendar dots are CSS circles, not emoji
- Coach avatar uses SVG icon
- All emojis replaced with Icons.jsx SVGs
- Navigation uses proper icons

WorkoutPage:
- Warmup exercises without emojis
- Check icons instead of emoji checkmarks
- Arrow icons for navigation
- Fire icon for warmup section

Professional fitness app aesthetic inspired by Nike/FITBOD
2026-02-01 19:45:03 +01:00
clawd aff9ce7ce9 Add design overhaul plan + partial icon work
TODO: Comprehensive design plan for fitness app feel
- Dark theme color palette
- Professional typography guidelines
- SVG icons to replace ALL emojis
- UI component standards
- Inspiration from Nike/FITBOD/Strong

Partial work from Claude Code:
- Icons.jsx component (SVG icons)
- Dashboard.jsx updates (some emoji removal)
2026-02-01 19:13:14 +01:00
clawd 5a2d8b1830 Redesign Dashboard + add WorkoutSelectPage
Dashboard (cleaner):
- Week calendar at TOP
- Coach greeting (workout today or rest tips)
- If workout: gradient card with arrow → WorkoutPage
- If rest: tips + '+ Lägg till pass' → WorkoutSelectPage
- Quick stats at bottom

WorkoutSelectPage:
- Visual workout cards with icons and colors
- Preview of exercises
- Select + Start flow
- Fixed bottom action button
2026-02-01 14:43:10 +01:00
clawd 21dd68483a Dashboard: show workout list when no scheduled workout
- 'Välj pass' section with all available workouts
- Compact workout cards with exercise tags
- Click any workout → WorkoutPage
- No more 'Vilodag' - user can always pick a workout
2026-02-01 14:30:12 +01:00
clawd 73d1f39ea9 Add WorkoutPage with warmup exercises (Claude Code)
- Dedicated workout page with progress tracking
- Warmup section with general + muscle-specific exercises
- Preparatory sets (2x10 @ 50% of first exercise)
- Checkbox tracking for warmup completion
- Progress bar showing completed exercises
- Animated 'Finish workout' button when done
- Mobile-first CSS with responsive design

Built by Claude Code 2.1.29
2026-02-01 14:20:00 +01:00
clawd 66812f9db2 Add ProfilePage and ProgressPage
ProfilePage:
- View/edit user info (name, age, height, goal, level)
- Show current measurements (weight, body fat, waist, neck)
- Show strength records (bench/squat/deadlift 1RM)

ProgressPage:
- Tab navigation (weight, body fat, strength)
- SVG line charts for progress visualization
- Stats showing current, first, and change
- Trend indicators (up/down)

Dashboard:
- Navigation icons for profile (👤) and progress (📊)
- Connected navigation to App.jsx routing
2026-02-01 11:50:52 +01:00
clawd a4724e7118 Add Dashboard with weekly calendar and today's workout
- Dashboard.jsx: main landing page after login
- Coach greeting based on time of day
- Weekly calendar showing workout days
- Today's workout card with exercises
- Quick stats (workouts/week, streak)
- Upcoming workouts list
- Full responsive CSS
- App.jsx updated to show Dashboard first
2026-02-01 11:09:16 +01:00
clawd 14f39e178a Refactor: separera user_measurements och user_strength tabeller
- Ny databasstruktur för historik/progress tracking
- Nya endpoints: POST/GET measurements och strength
- Onboarding sparar till rätt tabeller
- Beräknar och sparar body_fat_pct
- Fixar tomma numeriska fält (null istället för '')
- Döljer 1RM för nybörjare
2026-02-01 00:10:48 +01:00
clawd 13ade5e903 Initial commit: Gravl MVP med onboarding 2026-01-31 23:33:20 +01:00