-
Notifications
You must be signed in to change notification settings - Fork 0
feat: display and preserve misc notes from IngrediBot #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 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
There was a problem hiding this 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".
| memberPreferencesCache["Everyone"] = prefs | ||
| memberMiscNotes["Everyone"] = extractMiscNotes(from: familyNote.content) | ||
| } else { | ||
| memberPreferencesCache["Everyone"] = Preferences() | ||
| memberMiscNotes["Everyone"] = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Summary
memberMiscNotestoFoodNotesStore— extracted on load, preserved during sync, re-extracted on version mismatch retryMiscNotesCardcomponent: read-only card with bullet list and "Chat" button to open IngrediBotUnifiedCanvasViewafter preference cards, filtered by selected memberTest plan