Skip to content

fix: show totals in chart legend and days in Time Spent budgeted sub-text#204

Merged
BenGWeeks merged 1 commit into
mainfrom
fix/202-chart-legend-totals
May 5, 2026
Merged

fix: show totals in chart legend and days in Time Spent budgeted sub-text#204
BenGWeeks merged 1 commit into
mainfrom
fix/202-chart-legend-totals

Conversation

@EdiWeeks
Copy link
Copy Markdown
Contributor

@EdiWeeks EdiWeeks commented May 5, 2026

Summary

Two small project-details-page fixes on the same screen:

  • Hours per Week chart legend — shows the sum of Planned, Approved and Pending hours across the visible weeks (e.g. Planned (237.0h) Approved (158.5h) Pending (10.0h)). Totals re-compute when navigating weeks via the arrows / "This Week" button. Implemented via a legendTotals useMemo derived from the same displayData that drives the bars.
  • Time Spent card — the "X% of Yh budgeted" sub-text now uses the shared formatHoursWithDays helper, so it shows 71% of 237.0h (31.5d) budgeted instead of 71% of 237h budgeted. Matches the format already used on the neighbouring Time Budgeted card.
image

Test plan

  • Open project details for PR00010 — Cairn Homes – Support & Maintenance.
  • Hours per Week legend reads Planned (Xh) Approved (Yh) Pending (Zh) and the figures sum to the visible bars.
  • Click the previous-week / next-week arrows or "This Week" — the legend totals update to match the new visible window.
  • Time Spent card sub-text reads X% of <budget>h (<budgetdays>d) budgeted, matching the format on the Time Budgeted card next to it.
  • No regression on the Spend vs Budget chart (separate legend, untouched).

Fixes #202
Fixes #203

🤖 Generated with Claude Code

…text

Two small project-details-page fixes that share the same screen:

- ProjectCharts: the Hours per Week chart legend now shows the sum of
  Planned, Approved and Pending hours across the visible weeks
  (e.g. "Planned (237.0h)  Approved (158.5h)  Pending (10.0h)"), so
  users get the project's overall position at a glance without
  hovering individual bars. Totals re-compute when navigating weeks.
- ProjectKPICards: the Time Spent card's "X% of Yh budgeted" sub-text
  now uses the shared formatHoursWithDays helper, matching the days-
  in-brackets format used by the neighbouring Time Budgeted card
  (e.g. "71% of 237.0h (31.5d) budgeted").

Fixes #202
Fixes #203

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@EdiWeeks EdiWeeks requested review from BenGWeeks and Copilot May 5, 2026 16:56
@BenGWeeks BenGWeeks merged commit 8e6205a into main May 5, 2026
12 of 14 checks passed
@EdiWeeks EdiWeeks review requested due to automatic review settings May 5, 2026 17:36
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.

Time Spent card: budgeted sub-text missing days-in-brackets Show total hours next to Planned/Approved/Pending labels in project chart legend

2 participants