Skip to content

Conversation

@justanotheratom
Copy link
Collaborator

Summary

  • Add memberMiscNotes to FoodNotesStore — extracted on load, preserved during sync, re-extracted on version mismatch retry
  • Add MiscNotesCard component: read-only card with bullet list and "Chat" button to open IngrediBot
  • Show misc notes card in UnifiedCanvasView after preference cards, filtered by selected member
  • Reload food notes when AI bot sheet is dismissed in editing mode to pick up new misc notes

Test plan

  • Write misc via IngrediBot agent → verify Notes card appears in food notes detail view
  • Edit allergies in iOS → sync → verify misc notes survive the sync round-trip
  • Switch between family members → verify correct misc notes shown per member
  • Dismiss IngrediBot sheet → verify food notes reload and new misc notes appear
  • Verify empty misc (no notes) doesn't show the Notes card

- Add memberMiscNotes to FoodNotesStore, extracted on load
- Preserve misc notes during sync (merge back after buildContentFromPreferences)
- Re-extract misc from server content on version mismatch retry
- Add MiscNotesCard component with read-only display and Chat button
- Show misc notes card in UnifiedCanvasView after preference cards
- Reload food notes when AI bot sheet is dismissed from editing mode
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bbaa43d1f8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 123 to +127
memberPreferencesCache["Everyone"] = prefs
memberMiscNotes["Everyone"] = extractMiscNotes(from: familyNote.content)
} else {
memberPreferencesCache["Everyone"] = Preferences()
memberMiscNotes["Everyone"] = []

Choose a reason for hiding this comment

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

P2 Badge Clear misc notes on empty/failed loads

When fetchFoodNotesAll() returns nil or throws, loadFoodNotesAll resets memberPreferencesCache/canvasPreferences but never clears memberMiscNotes. Because UnifiedCanvasView reads memberMiscNotes directly, a transient backend failure or an empty response will still surface stale misc notes from the previous load. This regression is introduced by the new memberMiscNotes state and should be reset in the else/catch paths to keep the UI consistent with the cleared caches.

Useful? React with 👍 / 👎.

- Clear memberMiscNotes in both nil response and catch blocks to prevent stale data
- Add screenOverride parameter to showAIBotSheetWithContext()
- Pass "food_notes" screen override when opening IngrediBot from MiscNotesCard
- Check screenOverride in IngrediBotChatView.contextKey before route-based detection
The context key determines conversation persistence, not screen behavior.
Pass it as a view parameter to IngrediBotChatView (like scanId, feedbackId)
rather than having the view reach into coordinator state.
Previously, when no member filter was selected, the misc notes card
only looked for notes under the "Everyone" key (family-level).
However, IngrediBot correctly saves personal preferences to
member-level notes using the member's UUID.

Now when no filter is selected:
- Aggregate misc notes from all members + family ("Everyone")
- When a specific member is selected, show only their notes

This fixes the issue where misc notes weren't appearing after
saying something like "I hate cinnamon" to IngrediBot.
Similar to how sections with selections are sorted to the top,
the misc notes card now appears right after the AI Summary card
(and before the section cards) when it has content.

This gives better visibility to the free-text notes from IngrediBot.
@justanotheratom justanotheratom merged commit fafc936 into develop Feb 3, 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