feat: Preserve Meal Groupings and Add "Copy Entire Day" to Food Diary#862
feat: Preserve Meal Groupings and Add "Copy Entire Day" to Food Diary#862CodeWithCJ merged 6 commits intomainfrom
Conversation
…sing locally instead of applying any date filter.
…onality
Key Changes:
* Meal Grouping Preservation: Refactored the backend copy engine to replicate food_entry_meals containers. When a meal is copied, the system now recreates the "container" on the target day and re-links all
food items, keeping your diary visually and structurally consistent.
* "Copy Entire Day" Feature: Added a new master workflow to copy every meal and food item from one day to another in a single action.
* UI Enhancements:
* Added a new "Copy Day" dropdown in the DailyProgress (Energy Goal) card.
* Added "Copy all from yesterday" (one-click) and "Copy entire day to date" (calendar picker).
* Enhanced CopyFoodEntryDialog to dynamically adapt between single-meal and whole-day copy modes.
* Reliability & Safety:
* Duplicate Prevention: Updated database checks to be "Meal-Aware," allowing the same food to exist in different meal containers without being incorrectly skipped during a copy.
* Timezone Safety: Dates are now calculated on the frontend and passed as strings, ensuring "yesterday" is always accurate relative to the user's local time.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the food diary's copying capabilities by introducing a 'deep copy' mechanism that preserves meal groupings and allows for the copying of an entire day's food entries. It provides users with more flexible and accurate options for managing their food logs, streamlining the process of replicating daily nutrition data while maintaining data integrity and user experience. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable "Copy Entire Day" feature and refactors the backend copy logic to preserve meal groupings, which is a great enhancement for user experience. The backend changes are well-structured, with good code reuse in the service layer. The frontend is updated to support the new functionality. I've identified a couple of areas for improvement in the React components related to best practices and type safety, which I've detailed in the comments.
Tip
Help us review and merge your PR faster!
Please ensure you have completed the Checklist below.
For Frontend changes, please run
pnpm run validateto check for any errors.PRs that include tests and clear screenshots are highly preferred!
Description
Provide a brief summary of your changes.
This PR introduces significant improvements to the Food Diary copying workflow, moving from a "flat" copy to a "deep" copy that preserves organizational structure.
Key Changes:
food items, keeping your diary visually and structurally consistent.
Related Issue
PR type [ ] Issue [x] New Feature [ ] Documentation
Linked Issue: # #741
Checklist
Please check all that apply:
pnpm run validate(especially for Frontend).en) translation file (if applicable).rls_policies.sqlfor any new user-specific tables.Screenshots (if applicable)
Before
[Insert screenshot/GIF here]
After
[Insert screenshot/GIF here]
