Skip to content

Add shared dailyNotes field replacing rest-only restNotes#24

Merged
aidmax merged 3 commits intomainfrom
claude/add-daily-notes-field-3VeaZ
May 6, 2026
Merged

Add shared dailyNotes field replacing rest-only restNotes#24
aidmax merged 3 commits intomainfrom
claude/add-daily-notes-field-3VeaZ

Conversation

@aidmax
Copy link
Copy Markdown
Owner

@aidmax aidmax commented May 6, 2026

Adds a Daily Notes textarea visible on all entry types (cycling, rest,
other), placed below the Entry Type selector. Replaces restNotes which
was rest-only. Includes draft migration shim so old restNotes values
are automatically carried over to dailyNotes on restore.

  • schema: add dailyNotes (shared), remove restNotes (rest-only)
  • home.tsx: Daily Notes UI always visible, update all three markdown
    generators, remove Notes from Rest Day section, update FIELD_TO_SECTION
  • use-form-persistence: migrate restNotes → dailyNotes on draft restore
  • tests: update schema and utils tests, add cycling/other dailyNotes cases

https://claude.ai/code/session_01WCETrYAfnUPD7wzy3YZUyi

claude added 2 commits May 6, 2026 05:06
Adds a Daily Notes textarea visible on all entry types (cycling, rest,
other), placed below the Entry Type selector. Replaces restNotes which
was rest-only. Includes draft migration shim so old restNotes values
are automatically carried over to dailyNotes on restore.

- schema: add dailyNotes (shared), remove restNotes (rest-only)
- home.tsx: Daily Notes UI always visible, update all three markdown
  generators, remove Notes from Rest Day section, update FIELD_TO_SECTION
- use-form-persistence: migrate restNotes → dailyNotes on draft restore
- tests: update schema and utils tests, add cycling/other dailyNotes cases

https://claude.ai/code/session_01WCETrYAfnUPD7wzy3YZUyi
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 6, 2026

Greptile Summary

This PR promotes restNotes from a rest-only field to a shared dailyNotes field visible on all three entry types (cycling, rest, other), placing the textarea directly below the Entry Type selector. A migration shim in use-form-persistence transparently carries over any saved restNotes value from existing localStorage drafts.

  • Schema: dailyNotes: z.string().optional() replaces restNotes in shared/schema-static.ts; all three markdown generators in home.tsx now emit dailyNotes as bullet points.
  • Migration: Draft restore in use-form-persistence.ts copies restNotes → dailyNotes (when dailyNotes is absent) then deletes restNotes before calling form.reset, ensuring old drafts are upgraded on next load.
  • Tests: Schema and utils test fixtures updated; new cases cover cycling and other entry types with dailyNotes, including ordering assertions.

Confidence Score: 4/5

Safe to merge; the only gap is a stale restNotes mention left in the CLAUDE.md Markdown Output section that contradicts the rest of the updated documentation.

The feature change is straightforward and well-executed — schema, UI, markdown generators, migration shim, and tests are all consistent with each other. The single remaining issue is that the Markdown Output Per Entry Type block in CLAUDE.md still names restNotes instead of dailyNotes, which will mislead future readers of the docs.

CLAUDE.md — the Markdown Output Per Entry Type section has a stale restNotes reference that needs updating.

Important Files Changed

Filename Overview
CLAUDE.md Updates schema fields and adds dailyNotes to shared-optional, but the Markdown Output Per Entry Type section still references the removed restNotes field.
client/src/hooks/use-form-persistence.ts Migration shim correctly copies restNotes to dailyNotes (only when dailyNotes is absent) then deletes restNotes from the mutable draft object before form.reset; logic is sound.
client/src/pages/home.tsx Adds shared Daily Notes textarea above cycling/rest/other-specific sections, threads dailyNotes through all three markdown generators, and removes the rest-only restNotes field and its FIELD_TO_SECTION mapping.
shared/schema-static.ts Adds dailyNotes as an optional shared string field and removes restNotes; schema is clean and consistent with the PR description.
client/src/test/schema.test.ts Test fixture swapped from restNotes to dailyNotes; no issues found.
client/src/test/utils.test.ts Local markdown-generator copies updated to match production code; new cycling and other dailyNotes test cases added with ordering assertions.
package-lock.json Several packages had the peer: true flag removed, re-classifying them as direct dependencies; no functional impact on the feature change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Draft restored from localStorage] --> B{Has restNotes?}
    B -- Yes --> C{dailyNotes already set?}
    C -- No --> D[Copy restNotes to dailyNotes]
    C -- Yes --> E[Keep existing dailyNotes]
    D --> F[Delete restNotes]
    E --> F
    B -- No --> F
    F --> G[form.reset with migrated data]
    G --> H{entryType selector}
    H --> I[cycling]
    H --> J[rest]
    H --> K[other]
    I --> L[Daily Notes textarea visible]
    J --> L
    K --> L
    L --> M{dailyNotes filled?}
    M -- Yes --> N[Append as bullet points to markdown]
    M -- No --> O[Omit from markdown]
Loading

Comments Outside Diff (1)

  1. CLAUDE.md, line 131-133 (link)

    P2 Stale restNotes reference in Markdown Output section

    The ### Markdown Output Per Entry Type documentation still lists restNotes for the rest entry type, but that field was removed in this PR and replaced by the shared dailyNotes field. Any future developer reading this section will be misled about both what field is used and where it appears, since dailyNotes is now rendered for all three entry types, not just rest.

Reviews (1): Last reviewed commit: "Update package-lock.json after npm insta..." | Re-trigger Greptile

Replace restNotes with dailyNotes in the Markdown Output Per Entry Type
documentation block, which was missed in the initial commit.

https://claude.ai/code/session_01WCETrYAfnUPD7wzy3YZUyi
@aidmax aidmax merged commit 40e33b4 into main May 6, 2026
1 check 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