diff --git a/CLAUDE.md b/CLAUDE.md index 4152c1b..ae49935 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -117,9 +117,10 @@ Old drafts (pre-entryType) are migrated to `cycling` on restore in `use-form-per ### Workout Schema Fields Always required: `entryType` (`cycling`/`rest`/`other`), `workoutDate` +Shared-optional: `dailyNotes` (free-form, rendered as bullets; visible on all entry types below the Entry Type selector) Cycling-required (via `superRefine`): `goal`, `rpe` (1-10), `feel` (W/P/N/G/S) Cycling-optional: `choIntakePre`, `choIntake`, `choIntakePost`, `normalizedPower`, `tss`, `avgHeartRate`, `hrv`, `rMSSD`, `rhr`, `trainerRoadRpe`, `trainerRoadLgt`, `whatWentWell`, `whatCouldBeImproved`, `description` -Rest-only: `weight` (positive number, kg), `restNotes` (free-form, rendered as bullets). Rest entries also reuse `hrv`/`rMSSD`/`rhr`/`trainerRoadLgt`. +Rest-only: `weight` (positive number, kg). Rest entries also reuse `hrv`/`rMSSD`/`rhr`/`trainerRoadLgt`. Other-only: `activityGoal` (e.g. "MFR", "Yoga"), `activityNotes` (free-form, rendered as bullets). ### Markdown Abbreviations @@ -127,7 +128,7 @@ G=Goal (cycling) or Activity (other), R=RPE, F=Feel, Ci-Pre=Carbohydrate Intake ### Markdown Output Per Entry Type - **cycling**: `G` / `R` / `F` + optional metrics + WWW/WCBI/Planned blocks (current format, unchanged) -- **rest**: `Rest Day` marker + present-only recovery metrics and `Weight` + bulleted `restNotes` +- **rest**: `Rest Day` marker + present-only recovery metrics and `Weight` + bulleted `dailyNotes` - **other**: optional `G: ` + bulleted `activityNotes`; no metrics ## Environment Variables (Deployment Only) diff --git a/client/src/hooks/use-form-persistence.ts b/client/src/hooks/use-form-persistence.ts index f13a3fa..f910602 100644 --- a/client/src/hooks/use-form-persistence.ts +++ b/client/src/hooks/use-form-persistence.ts @@ -50,6 +50,12 @@ export function useFormPersistence( if (data && typeof data === "object" && !data.entryType) { data.entryType = "cycling"; } + if (data && typeof data === "object" && data.restNotes && !data.dailyNotes) { + data.dailyNotes = data.restNotes; + } + if (data && typeof data === "object") { + delete data.restNotes; + } form.reset(draft.data); setWasRestored(true); } diff --git a/client/src/pages/home.tsx b/client/src/pages/home.tsx index 949ca90..c31f555 100644 --- a/client/src/pages/home.tsx +++ b/client/src/pages/home.tsx @@ -70,7 +70,6 @@ const FIELD_TO_SECTION: Partial> = { whatCouldBeImproved: "reflection", description: "reflection", weight: "rest-day", - restNotes: "rest-day", activityGoal: "activity", activityNotes: "activity", }; @@ -149,8 +148,8 @@ function getDefaultWorkoutValues(): InsertWorkout { whatWentWell: "", whatCouldBeImproved: "", description: "", + dailyNotes: "", weight: undefined, - restNotes: "", activityGoal: "", activityNotes: "", }; @@ -228,6 +227,10 @@ function generateCyclingMarkdown(data: InsertWorkout): string { markdown += data.description + '\n'; } + if (data.dailyNotes) { + markdown += '\n' + formatBulletPoints(data.dailyNotes) + '\n'; + } + return markdown; } @@ -242,8 +245,8 @@ function generateRestMarkdown(data: InsertWorkout): string { } if (data.weight) markdown += `Weight: ${data.weight}\n`; - if (data.restNotes) { - markdown += '\n' + formatBulletPoints(data.restNotes) + '\n'; + if (data.dailyNotes) { + markdown += '\n' + formatBulletPoints(data.dailyNotes) + '\n'; } return markdown; @@ -258,6 +261,10 @@ function generateOtherMarkdown(data: InsertWorkout): string { markdown += '\n' + formatBulletPoints(data.activityNotes) + '\n'; } + if (data.dailyNotes) { + markdown += '\n' + formatBulletPoints(data.dailyNotes) + '\n'; + } + return markdown; } @@ -724,6 +731,33 @@ export default function Home() { + {/* Daily Notes — all entry types */} +
+ ( + + + + Daily Notes + + +