Implement Plan page with phase overview and exercise reference (P2.13)
Add comprehensive training plan reference page that displays: - Current phase status (day, phase name, training type, weekly limit) - Phase overview cards for all 5 cycle phases with weekly intensity limits - Strength training exercises reference with sets and reps - Rebounding techniques organized by phase - Weekly training guidelines for each phase The page fetches cycle data from /api/cycle/current and highlights the current phase. Implements full TDD with 16 tests covering loading states, error handling, phase display, and exercise reference sections. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@ This file is maintained by Ralph. Run `./ralph-sandbox.sh plan 3` to generate ta
|
||||
|
||||
## Current State Summary
|
||||
|
||||
### Overall Status: 609 tests passing across 34 test files
|
||||
### Overall Status: 625 tests passing across 35 test files
|
||||
|
||||
### Library Implementation
|
||||
| File | Status | Gap Analysis |
|
||||
@@ -61,7 +61,7 @@ This file is maintained by Ralph. Run `./ralph-sandbox.sh plan 3` to generate ta
|
||||
| Settings/Garmin (`/settings/garmin`) | **COMPLETE** | Token management UI, connection status, disconnect functionality, 27 tests |
|
||||
| Calendar (`/calendar`) | **COMPLETE** | MonthView with navigation, ICS subscription section, token regeneration, 23 tests |
|
||||
| History (`/history`) | **COMPLETE** | Table view with date filtering, pagination, decision styling, 26 tests |
|
||||
| Plan (`/plan`) | **NOT IMPLEMENTED** | Placeholder only - shows heading and placeholder text, needs phase details display |
|
||||
| Plan (`/plan`) | **COMPLETE** | Phase overview, training guidelines, rebounding techniques, 16 tests |
|
||||
|
||||
### Components
|
||||
| Component | Status | Notes |
|
||||
@@ -116,6 +116,7 @@ This file is maintained by Ralph. Run `./ralph-sandbox.sh plan 3` to generate ta
|
||||
| `src/components/dashboard/override-toggles.test.tsx` | **MISSING** - Needs tests for toggle state and callbacks |
|
||||
| `src/components/dashboard/mini-calendar.test.tsx` | **EXISTS** - 23 tests (calendar grid, phase colors, navigation, legend) |
|
||||
| `src/components/calendar/day-cell.test.tsx` | **MISSING** - Needs tests for phase coloring, click handler |
|
||||
| `src/app/plan/page.test.tsx` | **EXISTS** - 16 tests (loading states, error handling, phase display, exercise reference, rebounding techniques) |
|
||||
| E2E tests | **AUTHORIZED SKIP** - Per specs/testing.md |
|
||||
|
||||
### Critical Business Rules (from Spec)
|
||||
@@ -447,18 +448,18 @@ Full feature set for production use.
|
||||
- **Why:** Users want to review their training history
|
||||
- **Depends On:** P2.8
|
||||
|
||||
### P2.13: Plan Page Implementation
|
||||
- [ ] Phase-specific training plan view
|
||||
- **Current State:** Placeholder only - shows "Exercise Plan" heading and placeholder text, no actual content
|
||||
### P2.13: Plan Page Implementation ✅ COMPLETE
|
||||
- [x] Phase-specific training plan view
|
||||
- **Files:**
|
||||
- `src/app/plan/page.tsx` - Current phase details, upcoming phases, limits
|
||||
- `src/app/plan/page.tsx` - Phase overview, training guidelines, exercise reference, rebounding techniques
|
||||
- **Tests:**
|
||||
- Component tests: phase info display, limits shown correctly
|
||||
- **Features Needed:**
|
||||
- Current phase details (name, day range, characteristics)
|
||||
- Upcoming phases preview
|
||||
- Phase-specific training limits and recommendations
|
||||
- Integration with cycle.ts utilities
|
||||
- `src/app/plan/page.test.tsx` - 16 tests covering loading states, error handling, phase display, exercise reference, rebounding techniques
|
||||
- **Features Implemented:**
|
||||
- Current phase status display (day, phase name, training type, weekly limit)
|
||||
- Phase overview cards for all 5 phases with weekly intensity minute limits
|
||||
- Strength training exercises reference with descriptions
|
||||
- Rebounding techniques organized by phase (follicular and luteal)
|
||||
- Weekly guidelines for each phase with training goals
|
||||
- **Why:** Users want detailed training guidance
|
||||
- **Depends On:** P0.4, P1.3
|
||||
|
||||
@@ -795,7 +796,6 @@ P4.* UX Polish ────────> After core functionality complete
|
||||
|
||||
| Priority | Task | Effort | Notes |
|
||||
|----------|------|--------|-------|
|
||||
| Medium | P2.13 Plan Page | Medium | Placeholder exists, needs content |
|
||||
| Medium | P2.18 OIDC Auth | Large | Production auth requirement |
|
||||
| Medium | P3.11 Component Tests | Medium | 5 components need tests |
|
||||
| Low | P3.7 Error Handling | Small | Polish |
|
||||
@@ -860,13 +860,14 @@ P4.* UX Polish ────────> After core functionality complete
|
||||
- [x] **GET /api/health** - Health check endpoint with PocketBase connectivity check, 14 tests (P2.15)
|
||||
- [x] **GET /metrics** - Prometheus metrics endpoint with counters, gauges, histograms, 33 tests (18 lib + 15 route) (P2.16)
|
||||
|
||||
### Pages (6 complete, 1 placeholder)
|
||||
### Pages (7 complete)
|
||||
- [x] **Login Page** - Email/password form with PocketBase auth, error handling, loading states, redirect, 14 tests (P1.6)
|
||||
- [x] **Dashboard Page** - Complete daily interface with /api/today integration, DecisionCard, DataPanel, NutritionPanel, OverrideToggles, 23 tests (P1.7)
|
||||
- [x] **Settings Page** - Form for cycleLength, notificationTime, timezone with validation, loading states, error handling, 28 tests (P2.9)
|
||||
- [x] **Settings/Garmin Page** - Token input form, connection status, expiry warnings, disconnect functionality, 27 tests (P2.10)
|
||||
- [x] **Calendar Page** - MonthView with navigation controls, ICS subscription section with URL display, copy button, token regeneration, 23 tests (P2.11)
|
||||
- [x] **History Page** - Table view of DailyLogs with date filtering, pagination, decision styling, 26 tests (P2.12)
|
||||
- [x] **Plan Page** - Phase overview, training guidance, exercise reference, rebounding techniques, 16 tests (P2.13)
|
||||
|
||||
### Test Infrastructure
|
||||
- [x] **test-setup.ts** - Global test setup with @testing-library/jest-dom matchers and cleanup
|
||||
|
||||
311
src/app/plan/page.test.tsx
Normal file
311
src/app/plan/page.test.tsx
Normal file
@@ -0,0 +1,311 @@
|
||||
// ABOUTME: Unit tests for the Plan page component.
|
||||
// ABOUTME: Tests phase display, training guidance, and exercise reference content.
|
||||
import { render, screen, waitFor } from "@testing-library/react";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
// Mock fetch globally
|
||||
const mockFetch = vi.fn();
|
||||
global.fetch = mockFetch;
|
||||
|
||||
import PlanPage from "./page";
|
||||
|
||||
// Mock response data matching /api/cycle/current shape
|
||||
const mockCycleResponse = {
|
||||
cycleDay: 12,
|
||||
phase: "FOLLICULAR",
|
||||
phaseConfig: {
|
||||
name: "FOLLICULAR",
|
||||
days: [4, 14],
|
||||
weeklyLimit: 120,
|
||||
dailyAvg: 17,
|
||||
trainingType: "Strength + rebounding",
|
||||
},
|
||||
daysUntilNextPhase: 3,
|
||||
cycleLength: 31,
|
||||
};
|
||||
|
||||
describe("PlanPage", () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
describe("loading and error states", () => {
|
||||
it("shows loading state initially", () => {
|
||||
mockFetch.mockImplementation(() => new Promise(() => {}));
|
||||
render(<PlanPage />);
|
||||
expect(screen.getByText(/loading/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows error state when fetch fails", async () => {
|
||||
mockFetch.mockResolvedValueOnce({
|
||||
ok: false,
|
||||
json: () => Promise.resolve({ error: "Failed to fetch cycle data" }),
|
||||
});
|
||||
|
||||
render(<PlanPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByRole("alert")).toBeInTheDocument();
|
||||
});
|
||||
expect(screen.getByText(/failed to fetch/i)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe("page header", () => {
|
||||
it("renders the Exercise Plan heading", async () => {
|
||||
mockFetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve(mockCycleResponse),
|
||||
});
|
||||
|
||||
render(<PlanPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent(
|
||||
"Exercise Plan",
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("current phase section", () => {
|
||||
it("displays current phase name in status", async () => {
|
||||
mockFetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve(mockCycleResponse),
|
||||
});
|
||||
|
||||
render(<PlanPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
// Current status section shows "Day X · PHASE_NAME"
|
||||
expect(screen.getByText(/day 12 · follicular/i)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
it("displays current cycle day", async () => {
|
||||
mockFetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve(mockCycleResponse),
|
||||
});
|
||||
|
||||
render(<PlanPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText(/day 12/i)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
it("displays days until next phase", async () => {
|
||||
mockFetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve(mockCycleResponse),
|
||||
});
|
||||
|
||||
render(<PlanPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText(/3 days until/i)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
it("displays current phase training type", async () => {
|
||||
mockFetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve(mockCycleResponse),
|
||||
});
|
||||
|
||||
render(<PlanPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
// Training type label and value are present (multiple instances OK)
|
||||
expect(screen.getByText("Training type:")).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getAllByText("Strength + rebounding").length,
|
||||
).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
it("displays weekly limit for current phase", async () => {
|
||||
mockFetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve(mockCycleResponse),
|
||||
});
|
||||
|
||||
render(<PlanPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
// Weekly limit label and value are present (multiple instances OK)
|
||||
expect(screen.getByText("Weekly limit:")).toBeInTheDocument();
|
||||
expect(screen.getAllByText(/120 min\/week/).length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("phase overview section", () => {
|
||||
it("displays all five phases", async () => {
|
||||
mockFetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve(mockCycleResponse),
|
||||
});
|
||||
|
||||
render(<PlanPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
// Check for phase cards by testid
|
||||
expect(screen.getByTestId("phase-MENSTRUAL")).toBeInTheDocument();
|
||||
expect(screen.getByTestId("phase-FOLLICULAR")).toBeInTheDocument();
|
||||
expect(screen.getByTestId("phase-OVULATION")).toBeInTheDocument();
|
||||
expect(screen.getByTestId("phase-EARLY_LUTEAL")).toBeInTheDocument();
|
||||
expect(screen.getByTestId("phase-LATE_LUTEAL")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
it("displays weekly limits for each phase", async () => {
|
||||
mockFetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve(mockCycleResponse),
|
||||
});
|
||||
|
||||
render(<PlanPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
// Phase limits appear in the phase cards as "X min/week"
|
||||
const menstrualCard = screen.getByTestId("phase-MENSTRUAL");
|
||||
const follicularCard = screen.getByTestId("phase-FOLLICULAR");
|
||||
const ovulationCard = screen.getByTestId("phase-OVULATION");
|
||||
const earlyLutealCard = screen.getByTestId("phase-EARLY_LUTEAL");
|
||||
const lateLutealCard = screen.getByTestId("phase-LATE_LUTEAL");
|
||||
|
||||
expect(menstrualCard).toHaveTextContent("30 min/week");
|
||||
expect(follicularCard).toHaveTextContent("120 min/week");
|
||||
expect(ovulationCard).toHaveTextContent("80 min/week");
|
||||
expect(earlyLutealCard).toHaveTextContent("100 min/week");
|
||||
expect(lateLutealCard).toHaveTextContent("50 min/week");
|
||||
});
|
||||
});
|
||||
|
||||
it("highlights the current phase", async () => {
|
||||
mockFetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve(mockCycleResponse),
|
||||
});
|
||||
|
||||
render(<PlanPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
const currentPhaseCard = screen.getByTestId("phase-FOLLICULAR");
|
||||
expect(currentPhaseCard).toHaveClass("ring-2");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("exercise reference section", () => {
|
||||
it("displays strength training exercises", async () => {
|
||||
mockFetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve(mockCycleResponse),
|
||||
});
|
||||
|
||||
render(<PlanPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText(/squats/i)).toBeInTheDocument();
|
||||
expect(screen.getByText(/push-ups/i)).toBeInTheDocument();
|
||||
expect(screen.getByText(/deadlifts/i)).toBeInTheDocument();
|
||||
expect(screen.getByText(/plank/i)).toBeInTheDocument();
|
||||
expect(screen.getByText(/kettlebell/i)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
it("displays rebounding techniques section", async () => {
|
||||
mockFetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve(mockCycleResponse),
|
||||
});
|
||||
|
||||
render(<PlanPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText(/rebounding techniques/i)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
it("displays phase-specific rebounding guidance", async () => {
|
||||
mockFetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve(mockCycleResponse),
|
||||
});
|
||||
|
||||
render(<PlanPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
// Rebounding techniques section contains different techniques per phase
|
||||
expect(
|
||||
screen.getByText(/health bounce, lymphatic drainage/i),
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByText(/maximum intensity, plyometric/i),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("different phases", () => {
|
||||
it("shows menstrual phase correctly when current", async () => {
|
||||
mockFetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
...mockCycleResponse,
|
||||
cycleDay: 2,
|
||||
phase: "MENSTRUAL",
|
||||
phaseConfig: {
|
||||
name: "MENSTRUAL",
|
||||
days: [1, 3],
|
||||
weeklyLimit: 30,
|
||||
dailyAvg: 10,
|
||||
trainingType: "Gentle rebounding only",
|
||||
},
|
||||
daysUntilNextPhase: 2,
|
||||
}),
|
||||
});
|
||||
|
||||
render(<PlanPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText(/day 2/i)).toBeInTheDocument();
|
||||
const currentPhaseCard = screen.getByTestId("phase-MENSTRUAL");
|
||||
expect(currentPhaseCard).toHaveClass("ring-2");
|
||||
});
|
||||
});
|
||||
|
||||
it("shows late luteal phase correctly when current", async () => {
|
||||
mockFetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
...mockCycleResponse,
|
||||
cycleDay: 28,
|
||||
phase: "LATE_LUTEAL",
|
||||
phaseConfig: {
|
||||
name: "LATE_LUTEAL",
|
||||
days: [25, 31],
|
||||
weeklyLimit: 50,
|
||||
dailyAvg: 8,
|
||||
trainingType: "Gentle rebounding ONLY",
|
||||
},
|
||||
daysUntilNextPhase: 4,
|
||||
}),
|
||||
});
|
||||
|
||||
render(<PlanPage />);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText(/day 28/i)).toBeInTheDocument();
|
||||
const currentPhaseCard = screen.getByTestId("phase-LATE_LUTEAL");
|
||||
expect(currentPhaseCard).toHaveClass("ring-2");
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,11 +1,301 @@
|
||||
// ABOUTME: Exercise plan reference page.
|
||||
// ABOUTME: Displays the full monthly exercise plan by phase.
|
||||
// ABOUTME: Displays the full monthly exercise plan by phase with current phase highlighted.
|
||||
"use client";
|
||||
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import type { CyclePhase, PhaseConfig } from "@/types";
|
||||
|
||||
interface CycleData {
|
||||
cycleDay: number;
|
||||
phase: CyclePhase;
|
||||
phaseConfig: PhaseConfig;
|
||||
daysUntilNextPhase: number;
|
||||
cycleLength: number;
|
||||
}
|
||||
|
||||
// Phase configurations for display
|
||||
const PHASES: Array<{
|
||||
name: CyclePhase;
|
||||
displayName: string;
|
||||
weeklyLimit: number;
|
||||
trainingType: string;
|
||||
description: string;
|
||||
}> = [
|
||||
{
|
||||
name: "MENSTRUAL",
|
||||
displayName: "Menstrual",
|
||||
weeklyLimit: 30,
|
||||
trainingType: "Gentle rebounding only",
|
||||
description: "Focus on rest and gentle movement. Light lymphatic drainage.",
|
||||
},
|
||||
{
|
||||
name: "FOLLICULAR",
|
||||
displayName: "Follicular",
|
||||
weeklyLimit: 120,
|
||||
trainingType: "Strength + rebounding",
|
||||
description:
|
||||
"Building phase - increase intensity and add strength training.",
|
||||
},
|
||||
{
|
||||
name: "OVULATION",
|
||||
displayName: "Ovulation",
|
||||
weeklyLimit: 80,
|
||||
trainingType: "Peak performance",
|
||||
description: "Peak energy - maximize intensity and plyometric movements.",
|
||||
},
|
||||
{
|
||||
name: "EARLY_LUTEAL",
|
||||
displayName: "Early Luteal",
|
||||
weeklyLimit: 100,
|
||||
trainingType: "Moderate training",
|
||||
description:
|
||||
"Maintain intensity but listen to your body for signs of fatigue.",
|
||||
},
|
||||
{
|
||||
name: "LATE_LUTEAL",
|
||||
displayName: "Late Luteal",
|
||||
weeklyLimit: 50,
|
||||
trainingType: "Gentle rebounding ONLY",
|
||||
description:
|
||||
"Wind down phase - focus on stress relief and gentle movement.",
|
||||
},
|
||||
];
|
||||
|
||||
const STRENGTH_EXERCISES = [
|
||||
{ name: "Squats", sets: "3x8-12" },
|
||||
{ name: "Push-ups", sets: "3x5-10" },
|
||||
{ name: "Single-leg Deadlifts", sets: "3x6-8 each" },
|
||||
{ name: "Plank", sets: "3x20-45s" },
|
||||
{ name: "Kettlebell Swings", sets: "2x10-15" },
|
||||
];
|
||||
|
||||
const REBOUNDING_TECHNIQUES = [
|
||||
{
|
||||
phase: "Menstrual",
|
||||
techniques: "Health bounce, lymphatic drainage",
|
||||
},
|
||||
{
|
||||
phase: "Follicular",
|
||||
techniques: "Strength bounce, intervals",
|
||||
},
|
||||
{
|
||||
phase: "Ovulation",
|
||||
techniques: "Maximum intensity, plyometric",
|
||||
},
|
||||
{
|
||||
phase: "Luteal",
|
||||
techniques: "Therapeutic, stress relief",
|
||||
},
|
||||
];
|
||||
|
||||
export default function PlanPage() {
|
||||
const [cycleData, setCycleData] = useState<CycleData | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const fetchCycleData = useCallback(async () => {
|
||||
const response = await fetch("/api/cycle/current");
|
||||
const data = await response.json();
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.error || "Failed to fetch cycle data");
|
||||
}
|
||||
|
||||
return data as CycleData;
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
async function loadData() {
|
||||
try {
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
const data = await fetchCycleData();
|
||||
setCycleData(data);
|
||||
} catch (err) {
|
||||
setError(err instanceof Error ? err.message : "An error occurred");
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
loadData();
|
||||
}, [fetchCycleData]);
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="container mx-auto p-8">
|
||||
<h1 className="text-2xl font-bold mb-8">Exercise Plan</h1>
|
||||
{/* Exercise plan content will be implemented here */}
|
||||
<p className="text-gray-500">Exercise plan placeholder</p>
|
||||
<p className="text-zinc-500">Loading...</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (error) {
|
||||
return (
|
||||
<div className="container mx-auto p-8">
|
||||
<h1 className="text-2xl font-bold mb-8">Exercise Plan</h1>
|
||||
<div role="alert" className="text-red-500">
|
||||
Error: {error}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="container mx-auto p-8">
|
||||
<h1 className="text-2xl font-bold mb-8">Exercise Plan</h1>
|
||||
|
||||
{cycleData && (
|
||||
<div className="space-y-8">
|
||||
{/* Current Phase Status */}
|
||||
<section className="bg-zinc-100 dark:bg-zinc-800 rounded-lg p-6">
|
||||
<h2 className="text-lg font-semibold mb-2">Current Status</h2>
|
||||
<p className="text-xl font-medium">
|
||||
Day {cycleData.cycleDay} · {cycleData.phase.replace("_", " ")}
|
||||
</p>
|
||||
<p className="text-zinc-600 dark:text-zinc-400">
|
||||
{cycleData.daysUntilNextPhase} days until next phase
|
||||
</p>
|
||||
<p className="mt-2">
|
||||
<span className="font-medium">Training type:</span>{" "}
|
||||
{cycleData.phaseConfig.trainingType}
|
||||
</p>
|
||||
<p>
|
||||
<span className="font-medium">Weekly limit:</span>{" "}
|
||||
{cycleData.phaseConfig.weeklyLimit} min/week
|
||||
</p>
|
||||
</section>
|
||||
|
||||
{/* Phase Overview */}
|
||||
<section>
|
||||
<h2 className="text-lg font-semibold mb-4">Phase Overview</h2>
|
||||
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
|
||||
{PHASES.map((phase) => (
|
||||
<div
|
||||
key={phase.name}
|
||||
data-testid={`phase-${phase.name}`}
|
||||
className={`rounded-lg p-4 border ${
|
||||
cycleData.phase === phase.name
|
||||
? "ring-2 ring-blue-500 bg-blue-50 dark:bg-blue-900/20"
|
||||
: "bg-white dark:bg-zinc-900"
|
||||
}`}
|
||||
>
|
||||
<h3 className="font-semibold text-base">
|
||||
{phase.displayName}
|
||||
</h3>
|
||||
<p className="text-sm text-zinc-600 dark:text-zinc-400 mt-1">
|
||||
{phase.trainingType}
|
||||
</p>
|
||||
<p className="text-sm font-medium mt-2">
|
||||
{phase.weeklyLimit} min/week
|
||||
</p>
|
||||
<p className="text-xs text-zinc-500 mt-2">
|
||||
{phase.description}
|
||||
</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Strength Training Reference */}
|
||||
<section>
|
||||
<h2 className="text-lg font-semibold mb-4">
|
||||
Strength Training (Follicular Phase)
|
||||
</h2>
|
||||
<p className="text-sm text-zinc-600 dark:text-zinc-400 mb-4">
|
||||
Mon/Wed/Fri during follicular phase (20-25 min per session)
|
||||
</p>
|
||||
<div className="bg-white dark:bg-zinc-900 rounded-lg border">
|
||||
<table className="w-full">
|
||||
<thead>
|
||||
<tr className="border-b">
|
||||
<th className="text-left p-3 font-medium">Exercise</th>
|
||||
<th className="text-left p-3 font-medium">Sets × Reps</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{STRENGTH_EXERCISES.map((exercise) => (
|
||||
<tr key={exercise.name} className="border-b last:border-0">
|
||||
<td className="p-3">{exercise.name}</td>
|
||||
<td className="p-3 text-zinc-600 dark:text-zinc-400">
|
||||
{exercise.sets}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Rebounding Techniques */}
|
||||
<section>
|
||||
<h2 className="text-lg font-semibold mb-4">
|
||||
Rebounding Techniques
|
||||
</h2>
|
||||
<p className="text-sm text-zinc-600 dark:text-zinc-400 mb-4">
|
||||
Adjust your rebounding style based on your current phase
|
||||
</p>
|
||||
<div className="grid gap-3 md:grid-cols-2">
|
||||
{REBOUNDING_TECHNIQUES.map((item) => (
|
||||
<div
|
||||
key={item.phase}
|
||||
className="bg-white dark:bg-zinc-900 rounded-lg border p-4"
|
||||
>
|
||||
<h3 className="font-medium">{item.phase}</h3>
|
||||
<p className="text-sm text-zinc-600 dark:text-zinc-400 mt-1">
|
||||
{item.techniques}
|
||||
</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Weekly Schedule Reference */}
|
||||
<section>
|
||||
<h2 className="text-lg font-semibold mb-4">Weekly Guidelines</h2>
|
||||
<div className="space-y-4">
|
||||
<div className="bg-white dark:bg-zinc-900 rounded-lg border p-4">
|
||||
<h3 className="font-medium">Menstrual Phase (Days 1-3)</h3>
|
||||
<ul className="text-sm text-zinc-600 dark:text-zinc-400 mt-2 list-disc pl-5 space-y-1">
|
||||
<li>Morning: 10-15 min gentle rebounding</li>
|
||||
<li>Evening: 15-20 min restorative movement</li>
|
||||
<li>No strength training</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div className="bg-white dark:bg-zinc-900 rounded-lg border p-4">
|
||||
<h3 className="font-medium">Follicular Phase (Days 4-14)</h3>
|
||||
<ul className="text-sm text-zinc-600 dark:text-zinc-400 mt-2 list-disc pl-5 space-y-1">
|
||||
<li>Mon/Wed/Fri: Strength training (20-25 min)</li>
|
||||
<li>Tue/Thu: Active recovery rebounding (20 min)</li>
|
||||
<li>Weekend: Choose your adventure</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div className="bg-white dark:bg-zinc-900 rounded-lg border p-4">
|
||||
<h3 className="font-medium">
|
||||
Ovulation + Early Luteal (Days 15-24)
|
||||
</h3>
|
||||
<ul className="text-sm text-zinc-600 dark:text-zinc-400 mt-2 list-disc pl-5 space-y-1">
|
||||
<li>Days 15-16: Peak performance (25-30 min strength)</li>
|
||||
<li>
|
||||
Days 17-21: Modified strength (reduce intensity 10-20%)
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div className="bg-white dark:bg-zinc-900 rounded-lg border p-4">
|
||||
<h3 className="font-medium">Late Luteal Phase (Days 22-28)</h3>
|
||||
<ul className="text-sm text-zinc-600 dark:text-zinc-400 mt-2 list-disc pl-5 space-y-1">
|
||||
<li>Daily: Gentle rebounding only (15-20 min)</li>
|
||||
<li>Optional light bodyweight Mon/Wed if feeling good</li>
|
||||
<li>Rest days: Tue/Thu/Sat/Sun</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user