Conversation
…ete button & WIP diet plan button
LexTruong
left a comment
There was a problem hiding this comment.
Great work so far guys! The UI is pretty darn close. There are a few bugs that need to be fixed though:
- The whole page is duplicated.
- The mobile view isn't quite right. For example, the padding is too large, and the progress bars for protein, carbs, and fat should be condensed.
- The edit goal input fields don't work quite right. Additionally, the popup should close if the user clicks outside of it.
- The
Historydate picker doesn't work as intended. The meal tracker page should only ever show the current day's tracked meals. If the user clicks on a previous day in the date picker, a dialog/drawer should popup, as shown in the Figma. Sorry if this was just recently changed. And for days with no tracked meals, we can either disable those days on the date picker or show something like "Nothing tracked on this day" on the dialog/drawer.
packages/db/src/schema/userGoals.ts
Outdated
| .primaryKey() | ||
| .references(() => users.id, { onDelete: "cascade" }), | ||
| calorieGoal: integer("calorie_goal").notNull().default(2000), | ||
| proteinGoal: integer("protein_goal").notNull().default(75), |
There was a problem hiding this comment.
Let's default to 100g of protein 💪
| ) | ||
| .limit(1); | ||
|
|
||
| // If already logged today, update servings instead of creating a new entry |
packages/api/src/nutrition/router.ts
Outdated
| message: "Logged meal not found", | ||
| }); | ||
| } | ||
|
|
There was a problem hiding this comment.
There was already an update meal procedure! Please use the previous one.
|
As for the issues from your PR description:
If you feel there's a better way to implement something, go for it! |
Apologies on my first point. Turns out the duplicate page is an error from a previous merge. Don't worry about it! |
|
Addressed all these changes except for the diet plan functionality! |
… it wont work otherwise)
One issue I had was with index.ts, even though there is a general import from the schema, the page won't function. If I add a manual export from the UserGoalsByDay, then it works, so that inconsistency would have to be fixed |
LexTruong
left a comment
There was a problem hiding this comment.
Hi guys, great work so far! Sorry for taking so long to get to this review. I think leaving the diet plan functionality for after deployment is a good call. Just a few more things for this one:
- Please disable dates in the history that we don't have any logged meal data for. This would just make it easier for users to look back on their progress.
- When I try to edit the goal amounts and delete the whole value in the input box, I can't get rid of the "0".
- For the suggested foods, let's display dishes that have been logged at least once instead of 5+ times in the past week. Can we sort these dishes in decreasing order by how many times they've been logged?
- The following suggestions are for mobile:
4a. Too much padding at the top of the page.
4b. The goals section is formatted quite right. The progress circle isn't centered vertically. The edit goals button should be in the top right of the goals section, instead of the bottom left.
4c. On the counted food cards, there is too much padding above the nutritional info.
Summary
Implemented the Meal Tracker page that allows users to edit and track their nutrition goals by adding editable meal cards to their account.
Changes
Samika's Changes:
Yitong's Changes:
Issues (Direction Requested)
Missing Features:
Small Fixes
Closes #643