Repository navigation
fix(frontend): Opportunities group rows, payback range and action bar wording - #1699
Conversation
… wording - Group summary rows span their columns again: the flex layout moves to an inner wrapper, since a flex <td> drops its colspan. - Expanded variant rows leave the columns the group shares (provider, account, service, resource type, region) blank and indent only the first data cell, so expanding no longer adds a horizontal scroll or shifts the header. - Group summaries skip a blank resource type or region (Azure savings plans read "2 variants", not "— — 2 variants") and print "$20/mo". - Payback Period reads "Up to X months" when the cheapest end has no upfront, instead of a "0.0" lower bound. - The Columns popover grows to the viewport height before it scrolls. - Disabled primary buttons drop the primary fill. - The action bar says rows instead of cells. Closes #1684 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 16 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
@coderabbitai review |
Action not completed
|
The Opportunities table at 1280px now overflows by about 41px, because variant rows no longer pad every cell, so a fixed 120px scroll never reached the strip. Scroll to half of the actual overflow instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Pushed 24ae940: |
Analysis chain
Action not completed
|
|
Independent review (claude-darling, cold): APPROVE 24ae940 All six #1684 findings plus the Azure SP comment are fixed as described. The spec fix keeps what the affordance test asserts. The notes below are non-blocking. Spec change (24ae940, table-scroll-affordance)
Fails on main
Payback maths
Grouping and wording
Probes
Evidence
Not merging. |
cristim
left a comment
There was a problem hiding this comment.
APPROVE @ 24ae940 by claude-nibblets
Cold review of 08e8d41...24ae940 (2 commits), done in my own scratch clone; 08e8d41 is the current main tip. This reviews the new head, not c3ef8d15. The PR body was treated as a claim. This is a comment review because GitHub does not let the PR author's account approve its own PR.
The spec fix (24ae940) doesn't weaken the test.
- At
c3ef8d15, Frontend E2E failed withExpected: 120, Received: 41. At 1280px the table's maximum horizontal scroll is now 41px, which is this PR's intended effect: variant rows no longer repeat the group columns. - The new step scrolls to
floor((scrollWidth - clientWidth) / 2), which is 20px here. It still requires real overflow (mid > 0) and still checks that the strip and table stay in step. - The edge hints switch on at more than 1px from each edge (
lib/table-scroll.ts:57-58), so asserting bothscroll-hint-leftandscroll-hint-rightat the midpoint remains a real check. - The 390px case, the far-end check and the other tests are unchanged. Frontend E2E passes at this head.
Grouping: blanking never hides a value that differs between variants.
- Variant rows blank provider, account, service, resource type and region.
- All five are parts of
cellKey(recommendations.ts:1066-1076: provider, account, service, region, resource type and engine, plus AZ, platform and tenancy when set), so every variant of a cell shares them, and the summary row shows the identity. - One row: a single-variant cell renders
flat, with nothing blanked. - Savings Plans: a single-variant child of an SP group renders
sp-child, which keeps its identity cells, because the SP bucket row is an aggregate. - Mixed services: different services never share a cell key, so their rows are never grouped together.
- Blank identity parts: they are filtered before the join, which fixes the Azure SP "— — 4 variants" case.
Payback maths against the data.
pageLevelRange(recommendations.ts:1332-1385) gives each cell its lowest-ratio variant and highest-ratio variant. A variant with zero savings counts as an infinite ratio.- The minimum is 0 exactly when every cell's best variant has zero upfront, that is no-upfront. A 0 from the clamp, where total best savings is 0 or less, implies the maximum is 0 too, and the card already shows "—" whenever the maximum is 0 (
:965-967). - So "Up to X months" appears only for a real no-upfront lower bound, and a positive minimum still prints "lo – hi months".
Wording.
- "rows" in the action bar is accurate. The count is
targetRange.cellCount, and radio selection allows one variant per cell (#224), so selected rows equal selected cells. periodUnitturnsperiodSuffix's "/ mo" into "/mo" for values only. Labels keep the spaced form.
Other checks.
- The
<td>keeps its colspan, now that flex moved to the inner wrapper. .btn-primary:disabledoverrides the fill app-wide, and hover is limited to:not(:disabled).- The popover height is now
calc(100vh - 2rem).
The new tests fail on main. With recommendations.ts and components.css reverted to main and the PR's tests kept:
- jest: 5 of the 6
Issue #1684tests fail. The sixth ("no-value dash when nothing is paid upfront") passes there, as the body says. - Playwright: after rebuilding main's bundle, all 4
opportunities-group-layout.spec.tstests fail.
Mutation probes (each run in a scratch copy and reverted, jest JSON results):
Mutation in recommendations.ts |
Result |
|---|---|
| A 0 lower bound printed as "0.0 – X" | killed |
| Region not blanked on variant rows | killed |
| Flat single-variant rows blanked | killed (7) |
| Blank identity parts joined | killed |
| Spaced period unit | killed |
| SP single-variant child rows blanked | survives (see 1) |
Local verification at this SHA (macOS, under the review lock):
npm cisucceeds;npm testgives 182 suites, 4720 passed and 1 skipped;npm run lintreports 0 errors and 141 warnings;npm run typecheckandnpm run buildsucceed;- Playwright on the production bundle with
CI=1(opportunities-group-layout,recommendations,table-scroll-affordance,page-overflow): 42 passed.
Not blocking
- SP child rows. Nothing pins that an
sp-childrow keeps its account, service and plan-type cells. Ifnesting === 'variant'widened tonesting !== 'flat', every SP child would lose its identity under the aggregate bucket row, and no test would fail. One assertion in the existing Azure SP group test (#658), that an expanded single-variant SP child still shows its service or account, would pin it. - Rounding. A positive minimum under 0.05 months still prints "0.0 – X months". That needs an upfront tiny relative to the savings, so it's cosmetic.
CI at this SHA: CI - Build & Test, Frontend E2E, Frontend build (PR) and pre-commit all succeed: 41 checks SUCCESS, with CodeRabbit NEUTRAL. The merge state is CLEAN.
Not merging.
|
Independent review (claude-qa-ui-4, cold): APPROVED 24ae940 Grouping edge cases. Variant rows blank exactly the columns in Payback maths against the data. Wording. "Select rows to act on", "Select at least one row to enable", "… across N rows" and "/mo" with no space all read correctly against what the action box counts (selected cells, one row each when collapsed). Evidence (scratch worktree at this head,
Non-blocking
Not merging. |
Summary
Fixes the Opportunities usability findings in #1684 and the Azure savings plan nit in its comment.
.rec-cell-summary-contentsetdisplay: flexon the<td>, so it stopped being a table cell and ignored itscolspan.rec-cell-summary-innerwrapper; the cell spans to the last column againpadding-left: 2remapplied to every data cellcellKey: provider, account, service, resource type, region) blank and indent only the first data cell. Checkbox labels keep the full identitymax-height: 360pxmax-height: calc(100vh - 2rem).btn-primarykeeps the blue fill at 0.55 opacity.btn-primary:disableduses the muted surface, strong border and subtle text; hover no longer applies to disabled buttonsThe disabled-button style applies to every
.btn-primaryin the app, not just Purchase.Tests
recommendations.test.ts, newIssue #1684block): 5 of 6 fail on main (variant identity cells,/mo, blank Azure identity, payback lower bound, row wording). The 6th guards the existing "—" for no upfront. Existing wording asserts updated.tests-e2e/opportunities-group-layout.spec.ts(1920x1080, multi-variant fixture): the summary cell is a table cell reaching the last header; expanding keeps header positions (main: 19px shift) with no horizontal overflow; the Columns popover does not scroll inside (main: 453 > 358); disabled Purchase differs from the enabled fill. All 4 fail on main's source and pass with the fix.Local verification (macOS, commit c3ef8d1)
npm ci && npm test: 182 suites, 4720 passed, 1 skippednpm run lint: 0 errors (141 warnings, all already on main)npm run build: OKCI=1): the new spec plusrecommendations.spec.tsandpage-overflow.spec.ts, 38 passedSKIP=cfn-lint) because its env does not install on the local Python, and no CloudFormation file changedNot verified against production data.
Closes #1684
🤖 Generated with Claude Code