feat(home): 2x height + stack Current under Potential on savings-by-service chart - #925
Conversation
|
@coderabbitai review |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR reconfigures the "savings-by-service" bar chart to stack "Current (committed)" at the base of a unified dataset stack with potential-range datasets, updates tooltip detection logic, and adds CSS sizing for the updated layout. Test assertions and new coverage validate the stacking behavior and dataset ordering. ChangesSavings by Service Chart Stacking
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Verification note: PR #968 restacks the same savings-by-service chart into the single |
…ervice chart - Add #savings-by-service-chart CSS rule (600/560 px) scoped to that canvas only; the generic .chart-section canvas rule (300/280 px) is untouched so other charts are unaffected. - Merge all three datasets into a single "savings" stack so Current (committed) renders visually below the potential range (bottom-to-top = dataset order in Chart.js stacked bars). - Update tooltip discriminator from stack === 'current' to label match since all datasets now share the same stack name. - Extend dashboard tests: assert stacked axes, single-stack invariant, and dataset order (Current first, then Min potential, then Upside).
d0687f7 to
4604f33
Compare
|
Rebased on feat/multicloud-web-frontend. Resolved conflicts in frontend/src/dashboard.ts and frontend/src/tests/dashboard.test.ts: kept base dataset labels ('Current / Committed', 'Lowest option') aligned with #968, merged the tooltip improvement (dataset-specific single-line for the current layer), updated test label references to match. CR billing is blocked org-wide; no @coderabbitai review ping. |
|
Tip For best results, initiate chat on the files or code changes.
🧠 Learnings used |
Summary
#savings-by-service-chart { max-height: 600px; min-height: 560px; }immediately after the generic.chart-section canvasblock -- other charts remain at 300/280 px.Current (committed),Min potential,Upside) into a singlestack: 'savings'so the Current bar renders visually below the potential range (Chart.js renders bottom-to-top in dataset-array order).ctx.dataset.stack === 'current'toctx.dataset.label === 'Current (committed)'since all datasets now share one stack name.Currentfirst.Dependency note
The
Current (committed)bar still reads zeros until the parallel PRfix/current-savings-per-service(which populatesServiceSavings.CurrentSavingson the backend) lands. The UI change is self-contained and correct; stacked bars with a zero base segment are visually equivalent to the old grouped layout until real data flows in.Test plan
cd frontend && npm test -- --testPathPattern=dashboard-- all 85 tests pass (2 new: stacking invariant + dataset order).Canvas selector used
#savings-by-service-chart(confirmed fromfrontend/src/index.html:98andfrontend/src/dashboard.ts:739).Summary by CodeRabbit
Bug Fixes
Style
Tests
Merge-order dependency
The headline visual change (Current committed savings stacked below Potential) only renders once the backend PR
fix/current-savings-per-serviceis merged and deployed. Until that PR lands and populatesServiceSavings.CurrentSavings, the base segment of each stacked bar is zero and the chart looks identical to the previous grouped layout.