Skip to content

Created a gym plan manager#19

Open
officialabd wants to merge 37 commits intomainfrom
gym-plan-manager
Open

Created a gym plan manager#19
officialabd wants to merge 37 commits intomainfrom
gym-plan-manager

Conversation

@officialabd
Copy link
Owner

No description provided.

- Add centralized type definitions re-exporting from models
- Add utility functions: generateId, date formatting, ensureSetCount
- Add Zod validation schemas for plans, logs, exercises
- Add openExerciseSearch helper for Google search
- authStore: Firebase auth state with session tracking
- plansStore: Plans CRUD with draft management and dirty tracking
- sessionStore: Session logging with exercise manipulation
- logsStore: Logs feed with date/plan filtering
- uiStore: View tabs and drag-drop state
- fetchPlans, createPlan, updatePlan, deletePlan
- fetchLogs with date/plan filtering
- fetchRunningSession for session recovery
- createLogEntry, updateLogEntry, deleteLogEntry
- sanitizeLogForWrite for data consistency
- useGymAuth: Firebase auth with login/logout
- useGymPlans: Plans CRUD with save/delete operations
- useGymSession: Session logging with running session recovery
- useGymLogs: Logs fetching with filter management
- icons: SearchIcon, TrashIcon, DragIcon, PlusIcon, MinusIcon, EditIcon
- AuthForm: Email/password login form
- TabNavigation: Tab switching between views
- PlansView: Read-only plan display with day/exercise details
- PlanEditor: Full plan editing with drag-drop exercise reordering
- LogsFeed: Logs list with date range and plan filters
- Single responsive layout for mobile and desktop
- Exercise list with muscle group color indicators
- Completion fraction display (e.g., 2/3)
- SetEditor with +/- buttons and unit selection
- Add/Edit/Remove exercise during session
- Color-coded exercise status (green/orange/blue)
- Replace 30+ useState hooks with Zustand stores
- Use custom hooks for auth, plans, session, logs
- Fix running session loading race condition
- Add isLoadingRunning guards to prevent session overwrite
- zod: Form validation schemas
- zustand: State management replacing useState hooks
- Support NEXT_PUBLIC_FIREBASE_* env variables
- Fallback to hardcoded values for backwards compatibility
- Migrate Firestore structure to user-scoped subcollections:
  - gymPlans/{userId}/plans/{planId}
  - gymLogs/{userId}/logs/{logId}
- Add export buttons to PlansView and LogsFeed for data backup
- Add DownloadIcon component and exportToJsonFile utility
- Update gymService.ts with subcollection helper functions
- Update hooks to pass userId to service functions
- Remove unused code:
  - planToFirestore import from useGymPlans
  - Icon exports from components barrel (kept internal)
  - Entire schemas/gymSchemas.ts (never used)
- Make ExerciseStatusLabel/Color types internal
- Replace plan dropdown with compact clickable list showing name, days count, created/updated dates
- Replace day dropdown with compact clickable list showing day name and exercise count
- Add 'Create new plan' button that auto-generates default title (New Plan X)
- Add 'Add Day' button that auto-generates default title (Day X)
- Selected plan/day highlighted with blue styling
- No plan/day selected by default in edit view
- Clear day selection when switching plans
- Remove unused newPlanTitle input for plan creation
- Remove unused newDayTitle input for day creation
- Replace plan dropdown with compact clickable list
- Add day selection with compact clickable list
- Show exercises only when a day is selected
- Split into three cards: Plans, Days, Exercises
- Add bordered list containers for visual clarity
- No plan/day auto-selected by default
- Clear day selection when switching plans
- Move Export Plans button to card header
…and CloseIcon, disable start button when running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant