Skip to content

[feat] Implement task management system functionality #113

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

Open
wants to merge 39 commits into
base: main
Choose a base branch
from

Conversation

SashankBalusu
Copy link
Collaborator

@SashankBalusu SashankBalusu commented Apr 16, 2025

What's new in this PR 🧑‍🌾

Description

The general premise of this sprint was basically to allow the users to properly track harvesting, weeding, and watering tasks.
Without going into the details here are the general implementations:

  1. The user will get weekly reminders on when to water. We redisplay the task when there are three days left until one full week has elapsed since the last watering.
  2. For weeding, the user either gets biweekly or weekly tasks. Weekly tasks reappear similar to watering tasks, biweekly tasks reappear after 10 days
  3. For harvesting, the task appears by season (there's special logic for the winter season that occurs across years). If the task is marked completed, the plant also gets harvested and the associated logic plays out (as long as the user confirms w the confirmation modal)
  4. A confirmation modal appears whenever a user unchecks a task.
  5. Note: the confirmation modal's buttons are weirdly worded rn, i will fix this by passing in button text as props if this isnt already what Torin's sprint is doing

Screenshots

image
image
image
image

How to review

  1. There are a ton of Supabase columns added with this sprint. IIRC they are plant_name, harvest_season, last_watered, last_weeded, due_date, date_added_to_db, water_frequency, and weeding_frequency, previous_last_watered, and previous_last_weeded
  2. Look through the back end functions in dashboard and userPlants
  3. Basically all of the logic changes take place in dashboard. There are some comments but honestly the best way to review is probably just to mess around with the code and then just ask me to walk u thru the file bc its a bit of a mess and some of the logic is weird at times!
  4. the add details updates are purely to ensure that the database gets the correct information into userplants for the new rows added

Next steps

As Kyle mentioned, it might be better to have a separate tasks table instead of all the additional columns on user plants

Relevant links

Online sources

Related PRs

CC: @kylezryr

@SashankBalusu SashankBalusu linked an issue Apr 16, 2025 that may be closed by this pull request
@kylezryr kylezryr self-requested a review April 17, 2025 00:02
Copy link
Collaborator

@kylezryr kylezryr left a comment

Choose a reason for hiding this comment

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

holy shit massive PR but everything seems to work apart from the bugs i mentioned. you're gonna have to walk me thru the changes too. no styling comments this time since its the next PR but really good job man this works really well good shit

@kylezryr

This comment was marked as outdated.

@kylezryr kylezryr changed the title 95 implement task management system functionality [feat] Implement task management system functionality Apr 18, 2025
@kylezryr kylezryr force-pushed the 95-implement-task-management-system-functionality branch from 1d270da to cb16f89 Compare April 25, 2025 00:24
@kylezryr kylezryr force-pushed the 95-implement-task-management-system-functionality branch from 5070891 to 6649820 Compare April 25, 2025 00:30
Copy link
Collaborator

@kylezryr kylezryr left a comment

Choose a reason for hiding this comment

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

works pretty well, haven't run into bugs so far. i think the only issue is with how we are currently setting dates using either new Date() or toISOString. we should try to avoid toISOString wherever possible because it converts the datestring into UTC 0 time, affecting the actual date itself. try using dayjs to avoid this. other than that works really well, good job!

@kylezryr
Copy link
Collaborator

notes for the frontend styling PR:

  1. tasks div has white background, should match the rest of the page background
    image
  2. we can get the user's name now using userName from useAuth.
  3. add the toast once I merge it too!

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.

Implement task management system functionality
2 participants