Files
WerkoutAPI/werkout-frontend/components/workout/ExerciseRow.tsx
Trey t 1c61b80731 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>
2026-02-22 20:07:40 -06:00

80 lines
2.2 KiB
TypeScript

import Link from "next/link";
import { Badge } from "@/components/ui/Badge";
import type { SupersetExercise } from "@/lib/types";
function mediaUrl(path: string): string {
if (typeof window === "undefined") return path;
return `${window.location.protocol}//${window.location.hostname}:8001${path}`;
}
interface ExerciseRowProps {
exercise: SupersetExercise;
}
export function ExerciseRow({ exercise }: ExerciseRowProps) {
const ex = exercise.exercise;
const details: string[] = [];
if (exercise.reps) {
details.push(`${exercise.reps} reps`);
}
if (exercise.duration) {
details.push(`${exercise.duration}s`);
}
if (exercise.weight) {
details.push(`${exercise.weight} lbs`);
}
const muscles = ex.muscles?.map((m) => m.name) || [];
return (
<div className="flex items-center justify-between px-4 py-3 border-b border-zinc-800/50 last:border-b-0">
<div className="flex-1 min-w-0">
<div className="flex items-center gap-2">
<span className="text-sm font-medium text-zinc-100 truncate">
{ex.name}
</span>
{ex.video_url && (
<Link
href={mediaUrl(ex.video_url)}
target="_blank"
rel="noopener noreferrer"
className="flex-shrink-0 text-[#39FF14] hover:text-[#39FF14]/80 transition-colors"
title="Watch video"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="currentColor"
stroke="none"
>
<polygon points="5 3 19 12 5 21 5 3" />
</svg>
</Link>
)}
</div>
{details.length > 0 && (
<p className="text-xs text-zinc-400 mt-0.5">{details.join(" / ")}</p>
)}
{muscles.length > 0 && (
<div className="flex flex-wrap gap-1 mt-1.5">
{muscles.map((name) => (
<Badge
key={name}
variant="default"
className="text-[10px] px-1.5 py-0"
>
{name}
</Badge>
))}
</div>
)}
</div>
</div>
);
}