Skip to content

Add Feel slider to Rest Day section and include F: in rest markdown#23

Closed
aidmax wants to merge 2 commits intomainfrom
claude/implement-entry-types-DepXo
Closed

Add Feel slider to Rest Day section and include F: in rest markdown#23
aidmax wants to merge 2 commits intomainfrom
claude/implement-entry-types-DepXo

Conversation

@aidmax
Copy link
Copy Markdown
Owner

@aidmax aidmax commented May 5, 2026

The spec requires the Feel (W/P/N/G/S) slider to appear in the Rest Day
section for rest entries, and for the selected feel value to be output
as F: <value> in the rest markdown alongside recovery metrics and weight.

Updates utils.test.ts to match: adds two new feel tests for rest output
and removes the stale expect(md).not.toContain('F:') assertion that
treated feel as cycling-only.

https://claude.ai/code/session_01FXEJfqBTt5cUkoQkFmrzEo

claude added 2 commits May 5, 2026 16:46
The spec requires the Feel (W/P/N/G/S) slider to appear in the Rest Day
section for rest entries, and for the selected feel value to be output
as `F: <value>` in the rest markdown alongside recovery metrics and weight.

Updates utils.test.ts to match: adds two new feel tests for rest output
and removes the stale `expect(md).not.toContain('F:')` assertion that
treated feel as cycling-only.

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

greptile-apps Bot commented May 5, 2026

Greptile Summary

This PR extends the Feel (W/P/N/G/S) slider to the Rest Day section of the form and emits F: <value> in the rest markdown output when a feel value is set. Tests are updated to match the new behavior, removing the stale "no F: in rest output" assertion and adding dedicated include/omit tests.

  • home.tsx: Adds the Feel <FormField> after the Weight input in the Rest Day section and appends F: ${data.feel} to generateRestMarkdown when feel is truthy.
  • utils.test.ts: Mirrors the markdown change in the local test copy of generateRestMarkdown, removes the outdated assertion, and adds two new unit tests covering feel presence and absence.
  • CLAUDE.md: Documentation updated to reflect feel's new role in rest entries.

Confidence Score: 3/5

The markdown generation and tests are correct, but the Rest Day feel slider has a visual bug that could confuse users about whether feel is actually set.

When a rest entry has no feel value set, the slider thumb renders at the Weak position (index 0 clamped to min=1) while the label simultaneously shows Normal (N). A user who hasn't touched the slider sees contradictory signals and may not realize feel is actually undefined and will be absent from the markdown output.

client/src/pages/home.tsx — specifically the new Feel FormField block added to the Rest Day section and the section's hasData computation.

Important Files Changed

Filename Overview
client/src/pages/home.tsx Adds a Feel slider to the Rest Day section and emits F: value in rest markdown; slider has a label/position mismatch when feel is undefined, and the section's hasData indicator doesn't track feel.
client/src/test/utils.test.ts Test file updated to mirror the new rest markdown logic: removes stale not.toContain assertion and adds two new focused tests for feel inclusion/omission on rest entries.
CLAUDE.md Documentation updated to reflect that feel is now reused by rest entries and appears as F: in rest markdown output.
package-lock.json Several packages had their peer: true flag removed, reflecting a lockfile regeneration with no version changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User opens form] --> B{entryType?}
    B -- cycling --> C[Core Metrics section\nGoal / RPE / Feel required]
    B -- rest --> D[Rest Day section\nWeight + Feel optional + restNotes]
    B -- other --> E[Activity section\nactivityGoal + activityNotes]
    D --> F{feel defined?}
    F -- yes --> G[Slider at correct position\nLabel shows value]
    F -- no / undefined --> H[findIndex returns -1\nvalue=0, min=1 clamped to Weak\nLabel shows Normal N]
    G --> I[generateRestMarkdown]
    H --> I
    I --> J{data.feel truthy?}
    J -- yes --> K[append F: value]
    J -- no --> L[omit F: line]
    K --> M[Markdown output]
    L --> M
Loading

Comments Outside Diff (1)

  1. client/src/pages/home.tsx, line 1273-1275 (link)

    P2 The Rest Day section's hasData indicator doesn't account for feel. If a user sets only the feel slider and nothing else, the section badge won't activate, making it look like the section is empty even though F: will appear in the markdown output.

Reviews (1): Last reviewed commit: "Remove stale lockfile entries from npm i..." | Re-trigger Greptile

Comment thread client/src/pages/home.tsx
Comment on lines +1301 to 1336
<FormField
control={form.control}
name="feel"
render={({ field }) => (
<FormItem>
<FormLabel className="flex items-center gap-2">
<Smile className="w-4 h-4 text-green-500" />
F (Feel): {feelOptions.find(opt => opt.value === field.value)?.label || 'Normal (N)'}
</FormLabel>
<FormControl>
<div className="px-2 py-4">
<Slider
value={[feelOptions.findIndex(opt => opt.value === field.value) + 1]}
onValueChange={(value) => field.onChange(feelOptions[value[0] - 1]?.value || 'N')}
max={5}
min={1}
step={1}
className="w-full"
/>
<div className="flex justify-between text-xs text-gray-500 mt-2">
<span>Weak</span>
<span>Poor</span>
<span>Normal</span>
<span>Good</span>
<span>Strong</span>
</div>
</div>
</FormControl>
<FormMessage />
</FormItem>
)}
/>

<FormField
control={form.control}
name="restNotes"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 When feel is undefined (the user hasn't moved the slider on a rest entry), feelOptions.findIndex(...) returns -1, making value={[0]}. Because min={1}, Radix clamps the thumb to position 1 (Weak) — yet the label fallback shows "Normal (N)". The thumb and label disagree, misleading the user about what value (if any) will be written to the markdown. The cycling slider never encounters this because feel is required there; rest entries need an explicit "not set" state.

Suggested change
<FormField
control={form.control}
name="feel"
render={({ field }) => (
<FormItem>
<FormLabel className="flex items-center gap-2">
<Smile className="w-4 h-4 text-green-500" />
F (Feel): {feelOptions.find(opt => opt.value === field.value)?.label || 'Normal (N)'}
</FormLabel>
<FormControl>
<div className="px-2 py-4">
<Slider
value={[feelOptions.findIndex(opt => opt.value === field.value) + 1]}
onValueChange={(value) => field.onChange(feelOptions[value[0] - 1]?.value || 'N')}
max={5}
min={1}
step={1}
className="w-full"
/>
<div className="flex justify-between text-xs text-gray-500 mt-2">
<span>Weak</span>
<span>Poor</span>
<span>Normal</span>
<span>Good</span>
<span>Strong</span>
</div>
</div>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="restNotes"
<FormField
control={form.control}
name="feel"
render={({ field }) => (
<FormItem>
<FormLabel className="flex items-center gap-2">
<Smile className="w-4 h-4 text-green-500" />
F (Feel): {feelOptions.find(opt => opt.value === field.value)?.label || 'Not set'}
</FormLabel>
<FormControl>
<div className="px-2 py-4">
<Slider
value={[Math.max(1, feelOptions.findIndex(opt => opt.value === field.value) + 1)]}
onValueChange={(value) => field.onChange(feelOptions[value[0] - 1]?.value || 'N')}

@aidmax aidmax closed this May 6, 2026
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