Skip to content

fix: filter already-journaled meals from journal drawer dropdown#202

Merged
d3mocide merged 11 commits into
mainfrom
claude/busy-cannon-qj4tia
Jun 14, 2026
Merged

fix: filter already-journaled meals from journal drawer dropdown#202
d3mocide merged 11 commits into
mainfrom
claude/busy-cannon-qj4tia

Conversation

@d3mocide

Copy link
Copy Markdown
Owner

Summary

  • After logging a journal entry for a meal, that meal was still appearing in the drawer's meal selector dropdown as if it hadn't been logged
  • The drawer now cross-references recentMeals with the existing ['journal'] query cache to build a set of already-journaled meal_event_ids
  • Meals with existing journal entries are filtered out of the dropdown; the auto-selection useEffect also uses the filtered list
  • Added a new empty state message: "All meals today have already been journaled" for when every recent meal has been logged

Test plan

  • Log a journal entry for a meal via the drawer — after saving, reopen the drawer and confirm the logged meal no longer appears in the dropdown
  • Confirm the Today page nudge also disappears after logging (existing behavior via journal-pending invalidation)
  • Confirm the "All meals today have already been journaled" message appears when all recent meals have journal entries
  • Confirm meals without a meal_event_id link are unaffected (prefill flow from Today nudge still works)

https://claude.ai/code/session_01EMYbn7YnYuXoU4bmy3jjHP


Generated by Claude Code

claude added 11 commits June 14, 2026 01:05
Meals that already have a journal entry were still appearing in the
drawer's meal selector, making it look like they hadn't been logged.
Cross-reference recent_meals with existing journal entries and exclude
any meal whose meal_event_id is already journaled, so the dropdown only
shows meals that still need a journal entry.

https://claude.ai/code/session_01EMYbn7YnYuXoU4bmy3jjHP
Weekly recap insights now render as a dedicated card in Coach > Insights
with a green header band and a stats mini-dashboard (days logged, avg
calories, fiber days on target, weight change when available) above the
LLM-generated narrative.

Push notifications for all insights now deep-link to the specific card
via ?insight=<id> — the Insights tab reads this param, scrolls the card
into view, and highlights its border. The weekly recap push URL is
updated to carry the alert_id so the notification lands directly on
the right card.

Also extracts AskLumaButton to avoid duplication between the two card
types, and adds payload to the Insight frontend type.

https://claude.ai/code/session_01EMYbn7YnYuXoU4bmy3jjHP
Tapping or clicking any number input now immediately selects its current
value so typing replaces it rather than appending. Single delegated
listener in App so it covers every number field across the app.

https://claude.ai/code/session_01EMYbn7YnYuXoU4bmy3jjHP
…stacking context

Glass cards create a stacking context via backdrop-filter, trapping the
dropdown inside it regardless of z-index. Render the menu via
createPortal into document.body as a fixed-position element positioned
from getBoundingClientRect so it always floats above all cards.

https://claude.ai/code/session_01EMYbn7YnYuXoU4bmy3jjHP
…barcode scan

Replace the single icon button that cycled through search/favorites modes in
NutritionCalculatorCard with a visible "Search | Favorites" segmented control
so users can see and tap directly to the mode they want.

Fix the barcode scanner in ScanTab starting the camera automatically on every
mount/tab-switch, which caused iOS to re-prompt for camera permission each time.
Scanner now starts only when the user explicitly taps "Start scanning".

https://claude.ai/code/session_01EMYbn7YnYuXoU4bmy3jjHP
Replace the full-width labelled segmented bar with a compact inline pill
containing just the Search and Star icons, keeping the mode toggle on the
same line as the food input so the card layout is unchanged.

https://claude.ai/code/session_01EMYbn7YnYuXoU4bmy3jjHP
Calories (max target): bar + number turn green at 90-100%, red when over 100%.
Protein (min target): bar + number turn green when ≥ 90% of goal.
Both transitions are smooth (400ms) so the color shift feels live as you log.

https://claude.ai/code/session_01EMYbn7YnYuXoU4bmy3jjHP
Add a 'bad' (red) state to RingLegend so all ring stats match the streak
rule display. Max targets (sat fat, sugar): green ≤100%, amber 100–110%,
red >110%. Min target (fiber): green ≥90%, amber <90%.

https://claude.ai/code/session_01EMYbn7YnYuXoU4bmy3jjHP
Replace vague range descriptions with the actual thresholds used by the
color system and streak engine so the info card matches live behavior.

https://claude.ai/code/session_01EMYbn7YnYuXoU4bmy3jjHP
Both backend (streak.py) and frontend (streak.ts) were using strict ≤100%
for sat fat/sugar and ≥100% for fiber. Added CEILING_GRACE=1.10 and
FLOOR_TOLERANCE=0.90 constants so 109.4% sat fat correctly counts as met,
matching the streak explanation text and the UI color thresholds.

https://claude.ai/code/session_01EMYbn7YnYuXoU4bmy3jjHP
test_streak.py: split ceiling/floor test into three — at-target, within-grace,
and beyond-grace — so the new 10% tolerances are explicitly covered and the old
assertions that expected grace-zone values to fail are removed.

coach.tsx: cast payload through unknown to avoid TS2352 on RecapPayload.

https://claude.ai/code/session_01EMYbn7YnYuXoU4bmy3jjHP
@d3mocide d3mocide marked this pull request as ready for review June 14, 2026 02:36
@d3mocide d3mocide merged commit a0e4277 into main Jun 14, 2026
4 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