Skip to content

fix(platform): format org timeline tooltip values as percentages - #161

Merged
clickmatos merged 1 commit into
mainfrom
fix/org-timeline-tooltip-percentage
Aug 13, 2026
Merged

fix(platform): format org timeline tooltip values as percentages#161
clickmatos merged 1 commit into
mainfrom
fix/org-timeline-tooltip-percentage

Conversation

@clickmatos

Copy link
Copy Markdown
Contributor

Summary

The org dashboard's "Linha do tempo da organização" chart tooltip was
showing raw, unrounded decimals (e.g. 0.5860367647058823) for
Estabilização and Adoção de IA instead of a rounded percentage.

Root cause: the tooltip formatter matched its name argument against
dataKey strings ("commits", "stabilization", "aiPctNorm"), but each
Line/Bar sets an explicit name prop (the translated label, e.g.
"Estabilização") for the legend. Recharts passes that name prop
value to the formatter's name argument, not the dataKey — so the
comparison never matched and both series fell through to the raw,
unformatted value.

Fixed by matching on the payload entry's dataKey (the formatter's third
argument), which Recharts always populates regardless of any name
prop override.

Test plan

  • npx tsc --noEmit — clean
  • npm run lint — clean
  • npm run test — 267/267 passing (no behavior covered by existing
    unit tests here; chart components aren't unit-tested per
    platform/CLAUDE.md)
  • Manual check: hover a point on the org dashboard timeline chart and
    confirm Estabilização/Adoção de IA show as rounded percentages (e.g.
    59%) instead of raw decimals

🤖 Generated with Claude Code

The tooltip formatter matched on the series' `name` argument against
dataKey strings ("commits", "stabilization", "aiPctNorm"), but each
Line/Bar sets an explicit `name` prop (the translated label, e.g.
"Estabilização") — Recharts passes that prop value as `name`, not the
dataKey, so the match always missed and fell through to the raw,
unrounded 0..1 decimal (e.g. "0.5860367647058823" instead of "59%").

Match on the payload entry's `dataKey` instead, which Recharts always
populates regardless of the `name` prop override.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clickbus-iris Ready Ready Preview Aug 13, 2026 9:14pm

Request Review

@clickmatos
clickmatos merged commit 951b4f6 into main Aug 13, 2026
5 checks passed
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