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 |
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