Repository navigation
Conversation
Pass the plan-provider select value as the provider filter to api.listAccounts in handlePlanAccountSearch so only accounts matching the plan's provider appear in suggestions. This prevents a cross-provider assignment reaching the backend validator from issue #209 (plan provider mismatch). Also filter existing assignments by provider in setupPlanAccountsSection so stale cross-provider chips are dropped when the modal opens with a provider already selected. On provider change (setupRampScheduleHandlers), clear all selected accounts and re-render the chips to remove any chips whose provider no longer matches. Disable the account search input until a provider is picked so users cannot search before a provider is set. Closes #703
|
Warning Review limit reached
More reviews will be available in 25 minutes and 50 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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR implements provider-aware account search for plan target accounts. The account list fetch now includes the currently selected plan provider, existing accounts are filtered by provider on load, the search input is disabled until a provider is chosen, and clearing the provider resets all account selections and updates UI state accordingly. ChangesProvider-aware account search and filtering
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 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 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/src/plans.ts`:
- Around line 935-947: When the provider changes the code clears
planSelectedAccounts and updates inputs but doesn't clear the visible account
suggestions, so stale suggestions remain clickable; update the provider change
handler (the block that manipulates planSelectedAccounts, calls
renderPlanAccountChips and updatePlanAccountIdsField and reads providerSelect)
to also clear/hide the account suggestions UI and reset any suggestion state:
remove or empty the suggestions container (e.g., the element used to show
account suggestions such as "plan-account-suggestions"), hide it or set its
innerHTML to empty, and reset any related variables or selection state so no
previous-provider suggestions can be clicked after providerSelect changes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a2a6e1c8-6eb4-4b43-b85d-8eb5791fcac7
📒 Files selected for processing (2)
frontend/src/__tests__/plans.test.tsfrontend/src/plans.ts
When the user changes the plan provider, any open account-suggestion dropdown from a previous search was left visible and clickable, allowing a mismatched-provider account to be added. Clear the suggestion list, hide the dropdown, and reset the search input on every provider change. Adds a test asserting all three behaviours (contents cleared, hidden class present, search value empty) after a provider change event.
|
Addressed CR Major finding (comment #3299775023): stale account suggestions were not cleared on provider change. What was fixed (commit 4e3fbd5 on In
Test added in 94 tests, all passing. @coderabbitai review |
|
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Closes #703. Target Accounts search returned accounts from any provider regardless of the plan's selected provider; save then failed with 'plan provider mismatch' (the #209 validator).
Changes (frontend/src/plans.ts)
handlePlanAccountSearch(line 707): reads#plan-providerand passes{ search, provider }toapi.listAccounts(omits provider when not set).setupPlanAccountsSection(line 741): reads current plan provider before loading existing assignments; filterslistPlanAccountsresults to only keep matching-provider rows (drops stale assignments from a previous provider switch).setupPlanAccountsSection(line 762): disables the search input until a provider is picked.planSelectedAccounts, re-renders empty chips, updates the hidden field, toggles input disabled.Tests
5 new tests in
Target Accounts provider filter (issue #703):All 93 plans tests pass; full suite 1936/1936 pass.
Summary by CodeRabbit
Tests
Bug Fixes