fix: filter already-journaled meals from journal drawer dropdown#202
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
recentMealswith the existing['journal']query cache to build a set of already-journaledmeal_event_idsuseEffectalso uses the filtered listTest plan
journal-pendinginvalidation)meal_event_idlink are unaffected (prefill flow from Today nudge still works)https://claude.ai/code/session_01EMYbn7YnYuXoU4bmy3jjHP
Generated by Claude Code