Skip to content

Gayatri - Fix rounding inconsistency between chart labels and legend in Blue Square Stats donut chart - #5455

Open
sawantgayatri19 wants to merge 16 commits into
developmentfrom
Gayatri-Fix-BlueSquare-Rounding
Open

Gayatri - Fix rounding inconsistency between chart labels and legend in Blue Square Stats donut chart#5455
sawantgayatri19 wants to merge 16 commits into
developmentfrom
Gayatri-Fix-BlueSquare-Rounding

Conversation

@sawantgayatri19

Copy link
Copy Markdown

Description
Fixed a rounding inconsistency bug on the Total Org Summary dashboard where the Blue Square Stats donut chart's inline callout labels showed whole numbers while the legend displayed one decimal place (e.g., 5% vs 5.3%). This update standardizes the percentage precision across both chart callout labels and the legend so they consistently match to one decimal place.
Related PRS (if any):
N/A

Main changes explained:

  • Updated src/components/TotalOrgSummary/VolunteerStatus/externalLabelGuidesPlugin.js to remove premature Math.round() truncation and preserve floating-point percentage values.
  • Updated src/components/TotalOrgSummary/DonutChart/DonutChart.jsx to apply .toFixed(1) to percentage values within the externalLabelGuides plugin formatter.

How to test:

  1. check into current branch (Gayatri-Fix-BlueSquare-Rounding)
  2. do npm install and npm run start:local to run this PR locally (ensure backend HGNRest is running)
  3. Clear site data/cache
  4. log as admin user
  5. go to dashboard → Total Org Summary → Teams and Blue Squares → Blue Square Stats
  6. verify that callout percentages and legend percentages match to one decimal place (e.g., 6.7%) (feel free to include screenshot here)
  7. verify this new feature works in dark mode

Screenshots or videos of changes:
(Attach your screenshot showing matching callout and legend percentages)

Screenshot 2026-08-20 at 11 20 02 AM Note: Standardizes percentage precision globally for all DonutChart instances utilizing external label guides.

@netlify

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 42d43d1
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/6a91ad1abd19b40008c6ea8f
😎 Deploy Preview https://deploy-preview-5455--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@one-community one-community changed the title Fix rounding inconsistency between chart labels and legend in Blue Square Stats donut chart Gayatri - Fix rounding inconsistency between chart labels and legend in Blue Square Stats donut chart Aug 22, 2026
@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Aug 22, 2026
ShreyasB02
ShreyasB02 previously approved these changes Aug 22, 2026

@ShreyasB02 ShreyasB02 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.

Hello,

Tested this PR locally with the backend development branch. Verified that the rounding is consistent between the chart labels and the the legend in the blue squares stats donut start section under total org summary.

Also verified that it works perfectly in dark mode and content is legible.

Approving the PR.

Image

@DeMoliT1on DeMoliT1on 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.

Tested on local for branch Gayatri-Fix-BlueSquare-Rounding and verified that the values on chart labels and legend on the Blue Square Stats are consistent and do not mismatch.

Also checked that UI is consistent for both light mode and dark mode.

I observed that few of the Unit Test cases are failing for the PR checks, appreciate if you could look into it.

Image Image

@iAbhi001
iAbhi001 self-requested a review August 23, 2026 02:45
iAbhi001
iAbhi001 previously approved these changes Aug 23, 2026

@iAbhi001 iAbhi001 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.

Hello @sawantgayatri19,

Tested this PR locally with the backend development branch running.

Verification details:

  • Navigated to Dashboard → Total Org Summary → Teams and Blue Squares → Blue Square Stats.
  • Verified that the percentage callout labels and legend values in the Blue Square Stats donut chart are now completely aligned and consistently formatted to one decimal place (e.g., 6.7% on both).
  • Tested across both Light Mode and Dark Mode; text legibility, contrast, and layout look solid in both themes.
  • Verified that no visual truncation or premature rounding occurs on the callouts.

Everything functions as expected. Approving the PR! 👍

(Note: Don't forget to resolve the current merge conflicts in yarn.lock and check the CI test suite before merging).

image

@sawantgayatri19
sawantgayatri19 dismissed stale reviews from iAbhi001 and ShreyasB02 via cda1994 August 24, 2026 00:18
@sawantgayatri19

Copy link
Copy Markdown
Author

ShreyasB02

Thanks for testing this, Shreyas! Your approval got dismissed automatically since I pushed some additional commits (fixed a few CI/test issues unrelated to the rounding fix itself). Would you mind taking another quick look and re-approving when you get a chance? The rounding behavior you verified hasn't changed.

@sawantgayatri19

Copy link
Copy Markdown
Author

@DeMoliT1on Thanks for the thorough testing! You flagged that some unit tests were failing in CI — that's fixed now. It turned out to be a Node.js version mismatch in the CI workflow files plus a stale/duplicate route in routes.jsx, both unrelated to the rounding logic itself. All checks are passing now except the unrelated Netlify deploy-preview ones. Could you take another look and re-approve since your review was dismissed by the new commits?

@sawantgayatri19

Copy link
Copy Markdown
Author

@iAbhi001 Thanks for the detailed verification, and for flagging the yarn.lock merge conflict and CI check note! Both are resolved now — the merge conflict is fixed, and all the real test/lint checks are passing (the only red ones left are the Netlify deploy-preview checks, which are unrelated infra issues, not code problems). Since your approval got dismissed by the new commits, would you mind re-reviewing when you have a moment?

@RuthwikHM RuthwikHM 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.

I tested the changes out locally and they are working as expected. Just one small change is to not commit the package-json and yarn lock files as none of the changes made require changes to the dependency versions from what I can make out. Also remove the .github/workflow files that are being shown as modified and being committed as well.

Image

Comment thread package-lock.json

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I dont think any of the changes that were made required updates to the dependencies so this should not be pushed to the repo.

Comment thread yarn.lock

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I dont think any of the changes that were made required updates to the dependencies so this should not be pushed to the repo.

@sonarqubecloud

Copy link
Copy Markdown

@DeepighaJ DeepighaJ 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.

Tested the Blue Square Stats section on the Total Org Summary page. The chart callout and legend percentages match and are displayed to one decimal place (e.g., 100.0%). Verified the percentages remain readable in dark mode. No issues observed.

Image

@DeMoliT1on DeMoliT1on 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.

Hi @sawantgayatri19,
Thanks for the clarification for the Unit test cases. I re-confirmed the changes and everything seems to be working correctly. The chart labels and legend values are consistent with each other.
Approving!

@iAbhi001 iAbhi001 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.

Hello @sawantgayatri19,

Re-tested the latest updates locally on the Gayatri-Fix-BlueSquare-Rounding branch alongside the backend development branch.

Verification Details:

  • Navigation: Navigated to Dashboard → Total Org Summary → Teams and Blue Squares → Blue Square Stats.
  • Precision & Alignment: Verified that the percentage callouts on the donut chart and the corresponding legend values consistently match and format to one decimal place (e.g., 100.0%).
  • Theme Compatibility: Confirmed that the callout labels and legend remain clear, legible, and properly styled in Dark Mode.
  • No visual or rounding issues observed.

Everything looks great and works as expected. Approving the PR! 👍

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants