Kanishk — Bell: Part A (48/24 PT week alerts) + Part B (task 50/75/90 alerts), PT week & time-travel#3932
Conversation
…time-travel testing, week-safe localStorage
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thank you all, merging! |
Shravan-neelamsetty
left a comment
There was a problem hiding this comment.
Hi Kanishk , While testing locally, I’m consistently running into an issue with the dev time-travel helper: calling bellTest.goTo(...) keeps throwing a “Component not mounted yet” error (attached screenshot), even after waiting and retrying on the dashboard. The bell UI is visible, but the helper never seems to hook in for me, so I’m unable to exercise the 48h/24h scenarios via the test kit. This looks like a dev-only mounting/timing issue rather than a logic problem with the alerts themselves, but I wanted to flag it since it blocks local testing on my end.

Vikas-8055
left a comment
There was a problem hiding this comment.
Hi Kanishk, while testing locally, bellTest.goTo(...) keeps throwing a "Component not mounted yet" error even though the bell UI is visible on the dashboard. This seems like a dev-only mounting/timing issue rather than a logic problem with the alerts. Just flagging since it blocks local testing of the 48h/24h scenarios.








Description
This PR implements and tests two improvements to the Dashboard bell:


Part A (High Priority):
localStorage“seen” flags so each threshold shows only once/week.Part B (High Priority):
getUserTasks(userId)) and aggregates logged time per task fromtimeEntries.localStorageseen flags (reset when a new week starts).Related PRs (if any)
N/A
Main changes explained
BellNotification.jsx(existing bell)startOfPSTWeek,endOfPSTWeek.::hours::seen48,::hours::seen24).window.__setBellNow+bellTesthelper) for testing without reload in dev environment.timeEntries.state.userTask.tasksviagetUserTasks) and fallback paths.${userId}::${weekKey}::taskHours::<taskId>::seen::<bucket>).getUserTasks(userId)to ensure the volunteer’s tasks are available on Dashboard.How to test
A) Part A – Hours warnings at 48h/24h before PT week end
Clear the weekly seen flags:
Jump to these checkpoints and open the bell to confirm:
B) Part B – Task progress alerts at 50/75/90% of estimated hours
We test with two roles (or two logins).
Admin setup
Volunteer flow
Log in as the Volunteer (the same userId passed to the Bell).
Navigate to the Dashboard (bell mounted).
The app auto-fetches tasks with getUserTasks(userId); wait a second for Redux to populate.
Log time entries against that task so that totals cross:
3.5h / 7h → 50% alert shows.
5.25h / 7h → 75% alert shows.
6.3h / 7h → 90% alert shows.
Click the bell → a modal lists alerts:
“Hey! Your is <50|75|90>% complete…”
Click “Mark all as read” to set seen flags for the current week (per task & bucket).
To test again in the same week, clear task flags in console:
Object.keys(localStorage)
.filter(k => k.includes('::taskHours::') && k.includes('::seen::'))
.forEach(k => localStorage.removeItem(k));
Acceptance criteria
At 50/75/90% of estimated hours, the bell shows a red dot and the modal lists each alert once per bucket per week.
“Mark all as read” hides them until a higher bucket is reached or the week flips.
No alerts for tasks without an estimate or when pct >= 100.
Screenshots
Notes
All logic is week-scoped to Pacific Time (Sunday 00:00 PT).
localStorage keys are namespaced by userId and week start time.
If you see no Part B alerts, ensure:
You are logged in as the assigned volunteer.
estimatedHours is set and > 0.
Time entries reference the assigned taskId field the reducer uses.