From 71c7b6873c3e85f771dfaf39c4f8cbbb46784390 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 6 May 2026 06:27:10 +0000 Subject: [PATCH 1/2] Move daily notes to top of markdown output, right after the date header Daily notes now appear immediately after the date header across all entry types (cycling, rest, other), with a blank line separating them from the rest of the entry content. https://claude.ai/code/session_01SneaWjtLEPz4Gg6W8HXtpG --- client/src/pages/home.tsx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/client/src/pages/home.tsx b/client/src/pages/home.tsx index 19f235d..458d5da 100644 --- a/client/src/pages/home.tsx +++ b/client/src/pages/home.tsx @@ -229,10 +229,6 @@ function generateCyclingMarkdown(data: InsertWorkout): string { markdown += data.description + '\n'; } - if (data.dailyNotes) { - markdown += '\n' + formatBulletPoints(data.dailyNotes) + '\n'; - } - return markdown; } @@ -247,10 +243,6 @@ function generateRestMarkdown(data: InsertWorkout): string { } if (data.weight) markdown += `Weight: ${data.weight}\n`; - if (data.dailyNotes) { - markdown += '\n' + formatBulletPoints(data.dailyNotes) + '\n'; - } - return markdown; } @@ -263,16 +255,16 @@ function generateOtherMarkdown(data: InsertWorkout): string { markdown += '\n' + formatBulletPoints(data.activityNotes) + '\n'; } - if (data.dailyNotes) { - markdown += '\n' + formatBulletPoints(data.dailyNotes) + '\n'; - } - return markdown; } function generateMarkdown(data: InsertWorkout): string { let markdown = `---\n## ${formatWorkoutDate(data.workoutDate)}\n\n`; + if (data.dailyNotes) { + markdown += formatBulletPoints(data.dailyNotes) + '\n\n'; + } + switch (data.entryType) { case "rest": markdown += generateRestMarkdown(data); From c0b50b37d33e85d592f69cf2be465d18c02ed540 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 6 May 2026 06:33:16 +0000 Subject: [PATCH 2/2] Fix stale local markdown helper copies in utils.test.ts Update test-local copies of generateCyclingMarkdown, generateRestMarkdown, generateOtherMarkdown, and generateMarkdown to match the production change that moved dailyNotes to the top (right after the date header). Fix two ordering assertions and their test names to reflect the new position, add a rest+dailyNotes ordering test. https://claude.ai/code/session_01SneaWjtLEPz4Gg6W8HXtpG --- client/src/test/utils.test.ts | 36 ++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/client/src/test/utils.test.ts b/client/src/test/utils.test.ts index bb233a7..f923659 100644 --- a/client/src/test/utils.test.ts +++ b/client/src/test/utils.test.ts @@ -119,10 +119,6 @@ function generateCyclingMarkdown(data: InsertWorkout): string { markdown += data.description + '\n'; } - if (data.dailyNotes) { - markdown += '\n' + formatBulletPoints(data.dailyNotes) + '\n'; - } - return markdown; } @@ -137,10 +133,6 @@ function generateRestMarkdown(data: InsertWorkout): string { } if (data.weight) markdown += `Weight: ${data.weight}\n`; - if (data.dailyNotes) { - markdown += '\n' + formatBulletPoints(data.dailyNotes) + '\n'; - } - return markdown; } @@ -153,16 +145,16 @@ function generateOtherMarkdown(data: InsertWorkout): string { markdown += '\n' + formatBulletPoints(data.activityNotes) + '\n'; } - if (data.dailyNotes) { - markdown += '\n' + formatBulletPoints(data.dailyNotes) + '\n'; - } - return markdown; } function generateMarkdown(data: InsertWorkout): string { let markdown = `---\n## ${formatWorkoutDate(data.workoutDate)}\n\n`; + if (data.dailyNotes) { + markdown += formatBulletPoints(data.dailyNotes) + '\n\n'; + } + switch (data.entryType) { case "rest": markdown += generateRestMarkdown(data); @@ -252,6 +244,16 @@ describe('generateMarkdown — rest output', () => { expect(md).toContain('- Decided to skip training'); }); + it('daily notes appear before Rest Day marker when both present', () => { + const md = generateMarkdown({ + ...baseRest, + dailyNotes: 'Feeling off today', + }); + const dailyIdx = md.indexOf('- Feeling off today'); + const restDayIdx = md.indexOf('Rest Day'); + expect(dailyIdx).toBeLessThan(restDayIdx); + }); + it('excludes cycling-only fields', () => { const md = generateMarkdown({ ...baseRest, @@ -333,7 +335,7 @@ describe('generateMarkdown — other output', () => { expect(md).not.toContain('TSS:'); }); - it('includes daily notes as bullets after activity notes', () => { + it('includes daily notes as bullets before activity notes', () => { const md = generateMarkdown({ ...baseOther, activityGoal: 'MFR', @@ -345,7 +347,7 @@ describe('generateMarkdown — other output', () => { expect(md).toContain('- Apartment move stress'); const activityIdx = md.indexOf('- Full body protocol v3'); const dailyIdx = md.indexOf('- Long day at work'); - expect(activityIdx).toBeLessThan(dailyIdx); + expect(dailyIdx).toBeLessThan(activityIdx); }); it('includes daily notes when no activity notes', () => { @@ -366,7 +368,7 @@ describe('generateMarkdown — cycling daily notes', () => { feel: 'G', }; - it('includes daily notes at end of cycling output', () => { + it('includes daily notes in cycling output', () => { const md = generateMarkdown({ ...base, dailyNotes: 'New apartment adaptation\nBarometric pressure dropped', @@ -375,7 +377,7 @@ describe('generateMarkdown — cycling daily notes', () => { expect(md).toContain('- Barometric pressure dropped'); }); - it('daily notes appear after Planned when both present', () => { + it('daily notes appear before Planned when both present', () => { const md = generateMarkdown({ ...base, description: 'Sweet Spot Base II', @@ -383,7 +385,7 @@ describe('generateMarkdown — cycling daily notes', () => { }); const plannedIdx = md.indexOf('Planned'); const dailyIdx = md.indexOf('- Commute stress'); - expect(plannedIdx).toBeLessThan(dailyIdx); + expect(dailyIdx).toBeLessThan(plannedIdx); }); it('omits daily notes section when empty', () => {