workout generator audit: rules engine, structure rules, split patterns, injury UX, metadata cleanup
- Add rules_engine.py with quantitative rules for all 8 workout types - Add quality gate retry loop in generate_single_workout() - Expand calibrate_structure_rules to all 120 combinations (8 types × 5 goals × 3 sections) - Wire WeeklySplitPattern DB records into _pick_weekly_split() - Enforce movement patterns from WorkoutStructureRule in exercise selection - Add straight-set strength support (single main lift, 4-6 rounds) - Add modality consistency check for duration-dominant workout types - Add InjuryStep component to onboarding and preferences - Add sibling exercise exclusion in regenerate and preview_day endpoints - Display generator warnings on dashboard - Expand fix_rep_durations, fix_exercise_flags, fix_movement_pattern_typo - Add audit_exercise_data and check_rules_drift management commands - Add Next.js frontend with dashboard, onboarding, preferences, history pages - Add generator app with ML-powered workout generation pipeline - 96 new tests across 7 test modules Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
118
werkout-frontend/components/onboarding/GoalsStep.tsx
Normal file
118
werkout-frontend/components/onboarding/GoalsStep.tsx
Normal file
@@ -0,0 +1,118 @@
|
||||
"use client";
|
||||
|
||||
import { Card } from "@/components/ui/Card";
|
||||
import { GOAL_LABELS, FITNESS_LEVEL_LABELS } from "@/lib/types";
|
||||
|
||||
interface GoalsStepProps {
|
||||
fitnessLevel: number;
|
||||
primaryGoal: string;
|
||||
secondaryGoal: string;
|
||||
onChange: (data: {
|
||||
fitness_level?: number;
|
||||
primary_goal?: string;
|
||||
secondary_goal?: string;
|
||||
}) => void;
|
||||
}
|
||||
|
||||
const FITNESS_LEVEL_DESCRIPTIONS: Record<number, string> = {
|
||||
1: "New to structured training or returning after a long break.",
|
||||
2: "Consistent training for 6+ months with good form knowledge.",
|
||||
3: "Years of experience with complex programming and periodization.",
|
||||
4: "Competitive athlete or highly experienced lifter.",
|
||||
};
|
||||
|
||||
const goalOptions = Object.keys(GOAL_LABELS);
|
||||
|
||||
export function GoalsStep({
|
||||
fitnessLevel,
|
||||
primaryGoal,
|
||||
secondaryGoal,
|
||||
onChange,
|
||||
}: GoalsStepProps) {
|
||||
return (
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold text-zinc-100 mb-2">
|
||||
Your Fitness Profile
|
||||
</h2>
|
||||
<p className="text-zinc-400 mb-8">
|
||||
Tell us about your experience level and what you want to achieve.
|
||||
</p>
|
||||
|
||||
{/* Fitness Level */}
|
||||
<div className="mb-8">
|
||||
<h3 className="text-sm font-semibold text-zinc-400 uppercase tracking-wider mb-3">
|
||||
Fitness Level
|
||||
</h3>
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
||||
{Object.entries(FITNESS_LEVEL_LABELS).map(([key, label]) => {
|
||||
const level = Number(key);
|
||||
const isSelected = fitnessLevel === level;
|
||||
return (
|
||||
<Card
|
||||
key={level}
|
||||
onClick={() => onChange({ fitness_level: level })}
|
||||
className={`p-4 transition-all duration-150 ${
|
||||
isSelected
|
||||
? "border-[#39FF14] bg-[rgba(57,255,20,0.1)]"
|
||||
: ""
|
||||
}`}
|
||||
>
|
||||
<div className="flex flex-col gap-1">
|
||||
<span
|
||||
className={`text-base font-semibold ${
|
||||
isSelected ? "text-accent" : "text-zinc-100"
|
||||
}`}
|
||||
>
|
||||
{label}
|
||||
</span>
|
||||
<span className="text-sm text-zinc-400">
|
||||
{FITNESS_LEVEL_DESCRIPTIONS[level]}
|
||||
</span>
|
||||
</div>
|
||||
</Card>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Primary Goal */}
|
||||
<div className="mb-6">
|
||||
<label className="block text-sm font-semibold text-zinc-400 uppercase tracking-wider mb-2">
|
||||
Primary Goal
|
||||
</label>
|
||||
<select
|
||||
value={primaryGoal}
|
||||
onChange={(e) => onChange({ primary_goal: e.target.value })}
|
||||
className="w-full bg-zinc-800 border border-zinc-700 text-zinc-100 rounded-lg px-4 py-3 text-base focus:outline-none focus:border-accent transition-colors"
|
||||
>
|
||||
{goalOptions.map((goal) => (
|
||||
<option key={goal} value={goal}>
|
||||
{GOAL_LABELS[goal]}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{/* Secondary Goal */}
|
||||
<div>
|
||||
<label className="block text-sm font-semibold text-zinc-400 uppercase tracking-wider mb-2">
|
||||
Secondary Goal
|
||||
</label>
|
||||
<select
|
||||
value={secondaryGoal}
|
||||
onChange={(e) => onChange({ secondary_goal: e.target.value })}
|
||||
className="w-full bg-zinc-800 border border-zinc-700 text-zinc-100 rounded-lg px-4 py-3 text-base focus:outline-none focus:border-accent transition-colors"
|
||||
>
|
||||
<option value="">None</option>
|
||||
{goalOptions
|
||||
.filter((g) => g !== primaryGoal)
|
||||
.map((goal) => (
|
||||
<option key={goal} value={goal}>
|
||||
{GOAL_LABELS[goal]}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user