# Changelog All notable changes to the POWR project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ### Added - Zustand workout store for state management - Created comprehensive workout state store with Zustand - Implemented selectors for efficient state access - Added workout persistence and recovery - Built automatic timer management with background support - Developed minimization and maximization functionality - Workout tracking implementation with real-time tracking - Added workout timer with proper background handling - Implemented rest timer functionality - Added exercise set tracking with weight and reps - Created workout minimization and maximization system - Implemented active workout bar for minimized workouts - SQLite database implementation with development seeding - Successfully integrated SQLite with proper transaction handling - Added mock exercise library with 10 initial exercises - Implemented development database seeder - Added debug logging for database operations - Event caching system for future Nostr integration - Added EventCache service for Nostr event handling - Implemented proper transaction management - Added cache metadata tracking - Database schema improvements - Added nostr_events and event_tags tables - Added cache_metadata table for performance optimization - Added exercise_media table for future media support - Alphabetical quick scroll in exercise library - Dynamic letter highlighting for available sections - Smooth scrolling to selected sections - Sticky section headers for better navigation - Basic exercise template creation functionality - Input validation for required fields - Schema-compliant field constraints - Native picker components for standardized inputs - Enhanced error handling in database operations - Detailed SQLite error logging - Improved transaction management - Added proper error types and propagation - Template management features - Basic template creation interface - Favorite template functionality - Template categories and filtering - Quick-start template actions - Full-screen template details with tab navigation - Replaced bottom sheet with dedicated full-screen layout - Implemented material top tabs for content organization - Added Overview, History, and Social tabs - Improved template information hierarchy - Added contextual action buttons based on template source - Enhanced social sharing capabilities - Improved workout history visualization ### Changed - Improved workout screen navigation consistency - Standardized screen transitions and gestures - Added back buttons for clearer navigation - Implemented proper workout state persistence - Enhanced exercise selection interface - Updated add-exercises screen with cleaner UI - Added multi-select functionality for bulk exercise addition - Implemented exercise search and filtering - Improved exercise library interface - Removed "Recent Exercises" section for cleaner UI - Added alphabetical section organization - Enhanced keyboard handling for input fields - Increased description text area size - Updated NewExerciseScreen with constrained inputs - Added dropdowns for equipment selection - Added movement pattern selection - Added difficulty selection - Added exercise type selection - Improved DbService with better error handling - Added proper SQLite error types - Enhanced transaction rollback handling - Added detailed debug logging - Updated type system for better data handling - Consolidated exercise and template types - Added proper type guards - Improved type safety in components - Enhanced template display UI - Added category pills for filtering - Improved spacing and layout - Better visual hierarchy for favorites - Migrated from React Context to Zustand for state management - Improved performance with fine-grained rendering - Enhanced developer experience with simpler API - Better type safety with TypeScript integration - Added persistent workout state for recovery - Redesigned template details experience - Migrated from bottom sheet to full-screen layout - Restructured content with tab-based navigation - Added dedicated header with prominent action buttons - Improved attribution and source indication - Enhanced visual separation between template metadata and content ### Fixed - Workout navigation gesture handling issues - Workout timer inconsistency during app background state - Exercise deletion functionality - Keyboard overlap issues in exercise creation form - SQLite transaction nesting issues - TypeScript parameter typing in database services - Null value handling in database operations - Development seeding duplicate prevention - Template category spacing issues - Exercise list rendering on iOS - Database reset and reseeding behavior - Template details UI overflow issues - Navigation inconsistencies between template screens - Content rendering issues in bottom sheet components ### Technical Details 1. Database Schema Enforcement: - Added CHECK constraints for equipment types - Added CHECK constraints for exercise types - Added CHECK constraints for categories - Proper handling of foreign key constraints 2. Input Validation: - Equipment options: bodyweight, barbell, dumbbell, kettlebell, machine, cable, other - Exercise types: strength, cardio, bodyweight - Categories: Push, Pull, Legs, Core - Difficulty levels: beginner, intermediate, advanced - Movement patterns: push, pull, squat, hinge, carry, rotation 3. Error Handling: - Added SQLite error type definitions - Improved error propagation in LibraryService - Added transaction rollback on constraint violations 4. Database Services: - Added EventCache service for Nostr events - Improved ExerciseService with transaction awareness - Added DevSeederService for development data - Enhanced error handling and logging 5. Workout State Management with Zustand: - Implemented selector pattern for performance optimization - Added module-level timer references for background operation - Created workout persistence with auto-save functionality - Developed state recovery for crash protection - Added support for future Nostr integration - Implemented workout minimization for multi-tasking 6. Template Details UI Architecture: - Implemented MaterialTopTabNavigator for content organization - Created screen-specific components for each tab - Developed conditional rendering based on template source - Implemented context-aware action buttons - Added proper navigation state handling ### Migration Notes - Exercise creation now enforces schema constraints - Input validation prevents invalid data entry - Enhanced error messages provide better debugging information - Template management requires updated type definitions - Workout state now persists across app restarts - Component access to workout state requires new selector pattern - Template details navigation has changed from modal to screen-based approach ## [0.1.0] - 2024-02-09 ### Added - Initial project setup with Expo and React Native - Basic tab navigation structure - Theme support (light/dark mode) - SQLite database integration - Basic exercise library interface ### Changed - Migrated to TypeScript - Updated to latest Expo SDK - Implemented NativeWind for styling ### Fixed - iOS status bar appearance - Android back button handling - SQLite transaction management ### Security - Added basic input validation - Implemented secure storage for sensitive data ## [0.0.1] - 2024-02-01 ### Added - Initial repository setup - Basic project structure - Development environment configuration - Documentation templates