Make Daily Notes collapsible and move above Entry Type selector#25
Make Daily Notes collapsible and move above Entry Type selector#25
Conversation
Registers "daily-notes" as a proper section ID so it participates in expand/collapse all and persists open/closed state like other sections. Moves the block from below Entry Type to between Date and Entry Type, reflecting that daily notes are date-level context independent of type. - use-section-state: add "daily-notes" to SectionId union and ALL_SECTION_IDS - home.tsx: add "daily-notes" to SECTION_DEFAULTS (open), FIELD_TO_SECTION, and all three VISIBLE_SECTIONS_BY_TYPE arrays; wrap Daily Notes in CollapsibleSection; reorder Date → Daily Notes → Entry Type - use-section-state.test.ts: add "daily-notes"/"rest-day"/"activity" to test defaults and persisted fixtures to match complete SectionId set - CLAUDE.md: update section IDs list and default expansion docs https://claude.ai/code/session_01WCETrYAfnUPD7wzy3YZUyi
Greptile SummaryThis PR registers
Confidence Score: 5/5Safe to merge — all changes are additive, internally consistent, and well-tested. Every data structure touched by the new section ID is updated together. The localStorage merge logic already handles new keys gracefully, so existing users' stored state will silently gain the new default. Test fixtures were correctly extended to cover the full key set, and the rendered component follows the same controlled CollapsibleSection pattern used by every other section in the form. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Form renders] --> B[Date Section - unconditional]
B --> C[Daily Notes CollapsibleSection - unconditional]
C --> D{Entry Type Selector}
D -->|cycling| E[Core Metrics\nFueling\nPerformance\nRecovery\nReflection]
D -->|rest| F[Recovery\nRest Day]
D -->|other| G[Activity]
subgraph VISIBLE_SECTIONS_BY_TYPE
cycling_ids[cycling: daily-notes, core-metrics, fueling, performance-metrics, recovery-metrics, reflection]
rest_ids[rest: daily-notes, recovery-metrics, rest-day]
other_ids[other: daily-notes, activity]
end
subgraph Expand_All_Collapse_All
H[allExpanded = visibleSectionIds.every sectionStates]
H --> I[expandAllOrCollapseAll toggles all visible including daily-notes]
end
subgraph localStorage_persistence
J[ALL_SECTION_IDS - 8 keys including daily-notes]
J --> K[Merge stored vs defaults on mount]
K --> L[Unknown keys dropped, missing keys use defaults]
end
Reviews (1): Last reviewed commit: "Make Daily Notes collapsible and move it..." | Re-trigger Greptile |
Summary
"daily-notes"as a properSectionIdso it participates in Expand/Collapse All and persists open/closed state alongside other sectionsCollapsibleSection(open by default) instead of a plain static divChanges
use-section-state.ts"daily-notes"toSectionIdunion andALL_SECTION_IDShome.tsx"daily-notes"toSECTION_DEFAULTS(open),FIELD_TO_SECTION, and all threeVISIBLE_SECTIONS_BY_TYPEarrays; swap plain div forCollapsibleSection; reorder Date → Daily Notes → Entry Typeuse-section-state.test.ts"rest-day"and"activity")CLAUDE.mdTest plan
npm run test:run)https://claude.ai/code/session_01WCETrYAfnUPD7wzy3YZUyi
Generated by Claude Code