Skip to content

Move daily notes to top of markdown output, right after the date header#26

Merged
aidmax merged 2 commits intomainfrom
claude/reorder-daily-notes-markdown-xVjYV
May 6, 2026
Merged

Move daily notes to top of markdown output, right after the date header#26
aidmax merged 2 commits intomainfrom
claude/reorder-daily-notes-markdown-xVjYV

Conversation

@aidmax
Copy link
Copy Markdown
Owner

@aidmax aidmax commented May 6, 2026

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

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
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 6, 2026

Greptile Summary

This PR centralises dailyNotes rendering: instead of each entry-type helper (generateCyclingMarkdown, generateRestMarkdown, generateOtherMarkdown) individually appending daily notes at the end, the top-level generateMarkdown() now injects them immediately after the date header, followed by a blank-line separator before the entry-specific content.

  • home.tsx: Removed the dailyNotes block from all three per-type helpers and added a single injection point in generateMarkdown()formatBulletPoints(data.dailyNotes) + '\ \ ' — before the switch on entryType.
  • utils.test.ts: Updated the local helper copies and all ordering assertions (dailyIdx < plannedIdx, dailyIdx < activityIdx, dailyIdx < restDayIdx); renamed test descriptions to match the new semantics; added a new rest-day ordering test verifying that daily notes appear before the Rest Day marker.

Confidence Score: 5/5

Safe to merge — the refactor is a clean single-point consolidation with no behavioural regressions for any entry type.

The change is a straightforward lift-and-shift of four identical dailyNotes blocks into one place in generateMarkdown(). The format string is consistent with the existing pattern, the local test copies were updated in lockstep, all ordering assertions were corrected, and a new test covers the rest-day ordering case that was previously missing. No edge cases are introduced and no existing tests are invalidated.

No files require special attention — both changed files are well-aligned after this PR.

Important Files Changed

Filename Overview
client/src/pages/home.tsx Centralises dailyNotes rendering into generateMarkdown() before the entry-type switch; removes the three per-type dailyNotes blocks cleanly with no leftover references.
client/src/test/utils.test.ts Local helper copies updated to mirror production change; ordering assertions flipped correctly; new rest-day ordering test added; all three previously flagged stale-copy issues resolved.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["generateMarkdown(data)"] --> B["Emit date header\n---\n## DD.MM.YYYY\n\n"]
    B --> C{data.dailyNotes?}
    C -- yes --> D["Emit dailyNotes bullets\n+ blank line separator"]
    C -- no --> E{data.entryType}
    D --> E
    E -- rest --> F["generateRestMarkdown()\nRest Day + metrics"]
    E -- other --> G["generateOtherMarkdown()\nG: + activityNotes"]
    E -- cycling/default --> H["generateCyclingMarkdown()\nG/R/F + metrics + WWW/WCBI + Planned"]
    F --> I[Return markdown]
    G --> I
    H --> I
Loading

Reviews (2): Last reviewed commit: "Fix stale local markdown helper copies i..." | Re-trigger Greptile

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
@aidmax
Copy link
Copy Markdown
Owner Author

aidmax commented May 6, 2026

@greptile-apps

@aidmax aidmax merged commit 26cfb91 into main May 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants