Skip to content

Fix expressed feeds showing duration instead of ml amount#1

Closed
eddmann wants to merge 2 commits intomainfrom
claude/investigate-ml-duration-issue-fF4je
Closed

Fix expressed feeds showing duration instead of ml amount#1
eddmann wants to merge 2 commits intomainfrom
claude/investigate-ml-duration-issue-fF4je

Conversation

@eddmann
Copy link
Copy Markdown
Owner

@eddmann eddmann commented Mar 24, 2026

Summary

  • Frontend: Display logic now uses entry.type to decide format — breast feeds show duration, formula/expressed feeds always show ml amount
  • Backend: Duration recalculation on edit is now restricted to breast feeds only, preventing duration_seconds from being set on expressed/formula entries

Root cause

The display conditional checked duration_seconds before amount_ml regardless of feed type. When an expressed feed was edited (changing times), the backend recalculated duration_seconds — which was intended only for breast feeds. Once set, the UI prioritized duration over the ml amount.

Test plan

  • bun test src/pages/Feed.test.tsx — 16 tests pass
  • bun test worker/test/http/feed.http.test.ts — 10 tests pass

https://claude.ai/code/session_01HMNC1Vw48E32d6qkNrWzke

claude added 2 commits March 24, 2026 08:03
The display logic checked duration_seconds before amount_ml regardless
of feed type. When an expressed feed was edited and times changed, the
backend recalculated duration_seconds (intended only for breast feeds),
causing the UI to show a duration instead of the ml amount.

- Frontend: use entry.type to decide display format (breast → duration,
  formula/expressed → ml)
- Backend: only recalculate duration_seconds for breast feed entries

https://claude.ai/code/session_01HMNC1Vw48E32d6qkNrWzke
Formula and expressed feeds are instant events where started_at and
ended_at are set to the same timestamp on creation. When editing the
time, only started_at was updated, leaving ended_at stale. Now the
backend keeps them in sync for non-breast feed types.

https://claude.ai/code/session_01HMNC1Vw48E32d6qkNrWzke
@eddmann eddmann closed this Mar 24, 2026
@eddmann eddmann reopened this Mar 24, 2026
@eddmann eddmann closed this Mar 24, 2026
@eddmann eddmann deleted the claude/investigate-ml-duration-issue-fF4je branch March 24, 2026 15:28
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