Skip to content

LMP = Dashboard - blank progress circle should appear if the session …#3183

Draft
Tejashrimajage wants to merge 1 commit into
tekdi:release-1.16.0-prod-fixfrom
Tejashrimajage:attendance-circle-fix
Draft

LMP = Dashboard - blank progress circle should appear if the session …#3183
Tejashrimajage wants to merge 1 commit into
tekdi:release-1.16.0-prod-fixfrom
Tejashrimajage:attendance-circle-fix

Conversation

@Tejashrimajage

Copy link
Copy Markdown
Contributor

…is scheduled and no attendance has been marked

https://prathamdigitalteam.atlassian.net/browse/PS-6701

…is scheduled and no attendance has been marked
@Tejashrimajage Tejashrimajage marked this pull request as draft June 26, 2026 09:59

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment on lines +11 to 13
if (presentPercentage == 0) return theme.palette.error.main;
if (presentPercentage < lowLearnerAttendanceLimit)
return theme.palette.error.main;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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.

Suggested change
if (presentPercentage == 0) return theme.palette.error.main;
if (presentPercentage < lowLearnerAttendanceLimit)
return theme.palette.error.main;
if (presentPercentage < lowLearnerAttendanceLimit)
return theme.palette.error.main;

Comment on lines +120 to +125
} else {
showCircularProgress = dayDataValuesExist;
if (dayDataValuesExist && presentPercentage === 0) {
percentage = 100;
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Setting percentage = 100 when presentPercentage === 0 creates an inconsistent and non-linear visual representation.

  1. 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.
  2. 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;
      }

@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant