Skip to content

ux(recommendations): inline Plan button deep-links into Create Plan modal (closes #120)#845

Open
cristim wants to merge 1 commit into
feat/multicloud-web-frontendfrom
fix/120-wave14
Open

ux(recommendations): inline Plan button deep-links into Create Plan modal (closes #120)#845
cristim wants to merge 1 commit into
feat/multicloud-web-frontendfrom
fix/120-wave14

Conversation

@cristim
Copy link
Copy Markdown
Member

@cristim cristim commented May 28, 2026

Summary

  • Adds an inline Plan button to each recommendation row in the Opportunities table
  • Clicking the button opens the Create Purchase Plan modal pre-seeded with that row's recommendation, eliminating the select-then-scroll-then-click flow
  • Permission gate mirrors the bulk Create Plan button: only visible when the session has create:plans (admin and user roles; hidden for readonly)

Implementation

  • buildVariantRowMarkup emits a <button class="rec-plan-btn" data-rec-id="..." data-action="plan">Plan</button> inside the checkbox cell when canAccess('create', 'plans') is true; empty string otherwise (fail-closed)
  • renderRecommendationsList wires a click handler on .rec-plan-btn buttons that calls openCreatePlanFromBottomBox([rec]) - the same function used by the bulk Create Plan button, scoped to one rec
  • data-action="plan" attribute ensures the row-click selection handler skips button clicks (existing target.closest('[data-action]') guard)
  • e.stopPropagation() prevents the click from bubbling to the row handler

Test plan

  • tsc --noEmit clean
  • 8/8 tests pass in recommendations-permissions.test.ts (5 existing + 3 new)
  • 332/332 total tests pass across all three recommendations test files
  • New tests added:
    • admin role sees a rec-plan-btn when rows are rendered
    • readonly role has no rec-plan-btn buttons (gated)
    • clicking the button calls openCreatePlanModal with the correct rec pre-seeded

@cristim cristim added triaged Item has been triaged priority/p3 Polish / idea / may never ship severity/low Minor harm urgency/eventually No deadline impact/few Limited audience effort/m Days type/feat New capability labels May 28, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

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 23 minutes and 31 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: a78ef1d8-dd49-4dc0-bb9e-b72585e0c24a

📥 Commits

Reviewing files that changed from the base of the PR and between 80c20d2 and 055dded.

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

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

@cristim
Copy link
Copy Markdown
Member Author

cristim commented May 28, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

✅ 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
Copy link
Copy Markdown
Member Author

cristim commented May 30, 2026

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

✅ Actions performed

Full review triggered.

…odal (closes #120)

Add a per-row "Plan" button in the checkbox column of each recommendation
row. Clicking it calls openCreatePlanFromBottomBox([rec]) so the Create
Purchase Plan modal opens pre-seeded with that single recommendation.
Permission gate mirrors the bulk Create Plan button (create:plans). The
button carries data-action="plan" so the row-click selection handler
skips it. Tests: button visible for admin, absent for readonly, click
pre-seeds the modal.
@cristim
Copy link
Copy Markdown
Member Author

cristim commented Jun 1, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

✅ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/m Days impact/few Limited audience priority/p3 Polish / idea / may never ship severity/low Minor harm triaged Item has been triaged type/feat New capability urgency/eventually No deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant