LMP = Dashboard - blank progress circle should appear if the session …#3183
LMP = Dashboard - blank progress circle should appear if the session …#3183Tejashrimajage wants to merge 1 commit into
Conversation
…is scheduled and no attendance has been marked
There was a problem hiding this comment.
Code Review
This pull request updates the WeekCalender component and the dashboard to allow conditional event icon rendering and improved circular progress visualization for scheduled events. It also adjusts the path color determination logic for zero attendance. The review feedback identifies a redundant check in useDeterminePathColor.js that can be simplified, and warns against setting the percentage to 100 for zero attendance in WeekCalender.tsx as it creates an inconsistent and non-linear visual representation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if (presentPercentage == 0) return theme.palette.error.main; | ||
| if (presentPercentage < lowLearnerAttendanceLimit) | ||
| return theme.palette.error.main; |
There was a problem hiding this comment.
The check if (presentPercentage == 0) is redundant because the subsequent condition if (presentPercentage < lowLearnerAttendanceLimit) (where lowLearnerAttendanceLimit is 32) already covers the case when presentPercentage is 0 and returns the exact same value (theme.palette.error.main). Removing this redundant check simplifies the logic.
| if (presentPercentage == 0) return theme.palette.error.main; | |
| if (presentPercentage < lowLearnerAttendanceLimit) | |
| return theme.palette.error.main; | |
| if (presentPercentage < lowLearnerAttendanceLimit) | |
| return theme.palette.error.main; |
| } else { | ||
| showCircularProgress = dayDataValuesExist; | ||
| if (dayDataValuesExist && presentPercentage === 0) { | ||
| percentage = 100; | ||
| } | ||
| } |
There was a problem hiding this comment.
Setting percentage = 100 when presentPercentage === 0 creates an inconsistent and non-linear visual representation.
- Inconsistency: On the main dashboard card, 0% attendance is represented as an empty circle (0% filled), whereas here it is represented as a completely filled (100% filled) red circle.
- Non-linear representation: A day with 10% attendance will show a mostly empty (10% filled) red circle, while a day with 0% attendance will show a completely filled (100% filled) red circle, making 0% look like it has higher attendance than 10%.
Removing this override allows 0% attendance to be consistently represented as an empty circle.
} else {
showCircularProgress = dayDataValuesExist;
}
|



…is scheduled and no attendance has been marked
https://prathamdigitalteam.atlassian.net/browse/PS-6701