- Enhanced exaSearch service with Exa API + fallback tier system
* Tier 1: Exa API (primary)
* Tier 2: Synthetic results with suggested web sources
* Improved error handling with graceful degradation
- Updated backend exerciseResearch route to return provider info
* Returns 'provider' field identifying which API was used
* Returns 'status' field (success/degraded) for UI feedback
* Better error messages for debugging
- Enhanced ResearchDisplay component with fallback feedback
* New ResearchProviderBadge shows which provider was used
* Visual indicators for fallback results (Suggested badge)
* Support for multiple provider types (exa, fallback, gemini, etc.)
* Improved error handling and recovery flows
- Updated ExerciseResearchPanel with better error handling
* Proper response parsing from backend
* Forwards provider and status info to display component
* Improved accessibility with tooltip hints
- Added comprehensive Research Display styling
* Responsive layout for mobile and desktop
* Visual hierarchy for summaries and sources
* Provider badge styling with color-coding
* Fallback state indicators for user awareness
- ExerciseResearchPanel: add ProviderBadge component showing which AI
tier (Ollama/Gemini/OpenRouter/OpenCode/Exa) served the response
- Add auto-retry on 429/503 with 2s delay and retry counter in button
- Normalize error messages for common failure modes (network, rate-limit)
- ResearchDisplay: pass onRetry prop to error state for inline retry button
- CSS: .research-panel-controls flex row, .provider-badge with per-provider
colour coding, .rd-error-actions + .rd-retry button styles
- Add ResearchDisplay.jsx: pure presentational component for research
data with loading skeleton, accessible error state, and source cards
- Refactor ExerciseResearchPanel to delegate rendering to ResearchDisplay
(separates fetch/state logic from display)
- Add ExerciseEncyclopediaPage.css: full dark-theme stylesheet using
CSS variables (--bg-*, --text-*, --accent, --border, --radius-*)
replacing the light-theme WorkoutEditPage.css import
- Update ExerciseEncyclopediaPage.jsx: new semantic class names,
keyboard-accessible card toggle (Enter key + role=button + aria-expanded)
- Mobile-responsive at 600px breakpoint
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Changed API fallback chain:
- Tier 1: Ollama (local, free, always available)
- Tier 2: Gemini (free tier with quota limits)
- Tier 3: OpenRouter (cheap, flexible fallback)
- Tier 4: OpenCode (final backup)
This saves costs by using local Ollama for most tasks.
OpenRouter only used when Ollama unavailable.
Added OpenRouter as tertiary fallback:
- Primary: Gemini (free tier, quota-limited)
- Secondary: OpenCode (fallback if Gemini quota exceeded)
- Tertiary: OpenRouter (final fallback, supports multiple models)
gemini-fallback.js now tries all three in sequence with proper error handling.
- Configured OpenCode as fallback when Gemini quota exceeded
- Created gemini-fallback.js utility (tries Gemini → OpenCode)
- API keys stored in .env (excluded from git)
- PM unblocked: can resume 05-03 with fallback system
Flow: Gemini (primary) → OpenCode (fallback) → fail gracefully
- 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>
- 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
- 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.
- 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
- 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
- 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