Skip to content

fix(opportunities): KPI counts variants to match 'Showing X of X' - #756

Merged
cristim merged 1 commit into
feat/multicloud-web-frontendfrom
fix/748-rec-count-consistency
May 27, 2026
Merged

cristim merged 1 commit into
feat/multicloud-web-frontendfrom
fix/748-rec-count-consistency

Conversation

@cristim

@cristim cristim commented May 27, 2026

Copy link
Copy Markdown
Member

Summary

Opportunities page showed two recommendation counts that disagreed:

  • KPI: Total Recommendations: 6
  • Filter row: Showing 23 of 23 recommendations

Same dataset, no filter. Users saw 6 and 23 of 23 two lines apart and assumed something was off.

Root cause

The KPI used plr.cellCount -- the number of unique service/region/resource-type groups -- while the "Showing of" used the raw recommendations.length (variants).

Decision: count variants, not parent cells

Each variant is one purchasable option, which is what users act on. The financial cards (savings range, upfront, payback) correctly remain cell-aggregated (they are per-cell decisions).

Fix

renderRecommendationsSummary:

  • KPI value: plr.cellCount -> target.length
  • Empty guards: plr.cellCount > 0 -> target.length > 0 (renamed to hasRecs)

Files changed

  • frontend/src/recommendations.ts
  • frontend/src/__tests__/recommendations.test.ts

Test plan

  • Updated existing selection-cards test assertion from '2' (cells) to '4' (variants) on the 2-cell/4-variant fixture.
  • Added parity test asserting kpiValue === showingLoaded on a 2-cell/4-variant dataset.
  • Manual: open Opportunities, confirm KPI matches "Showing X of X" with various filters applied.

Closes #748.

…ount

The KPI counted parent-row services (6) while the "Showing of" line
counted variants (23) on the same dataset. Users see big mismatched
numbers and assume something is wrong. Both now count variants.

Closes #748.
@cristim cristim added triaged Item has been triaged priority/p2 Backlog-worthy severity/medium Moderate harm urgency/this-sprint Within the current sprint impact/many Affects most users effort/s Hours type/bug Defect labels May 27, 2026
@coderabbitai

coderabbitai Bot commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@cristim, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 22 minutes and 51 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 583cc8ea-190a-4e40-8e69-e11ad2a1f801

📥 Commits

Reviewing files that changed from the base of the PR and between f5b76eb and 096713c.

📒 Files selected for processing (2)
  • frontend/src/__tests__/recommendations.test.ts
  • frontend/src/recommendations.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/748-rec-count-consistency

Comment @coderabbitai help to get the list of available commands and usage tips.

@cristim

cristim commented May 27, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 27, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 27, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Full review triggered.

@cristim
cristim merged commit c5d0ff6 into feat/multicloud-web-frontend May 27, 2026
5 checks passed
@cristim
cristim deleted the fix/748-rec-count-consistency branch June 3, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/s Hours impact/many Affects most users priority/p2 Backlog-worthy severity/medium Moderate harm triaged Item has been triaged type/bug Defect urgency/this-sprint Within the current sprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant