feat(settings): per-account overrides modal — fixes panel-stacking (closes #122, #116)#124
Conversation
closes #122, #116) The Overrides UX from #72 (inline payment edit) and #106 (create modal) rendered each account's overrides into an inline expandable panel appended below the entire accounts table. Two open panels stacked without per-row attachment, so an override row created for one account appeared visually adjacent to a different account's empty-state. From the user's screenshot: an aws/ec2 override created for AWS 540... was displayed under CUDly host (909...), with two unscoped "Add override" buttons and a confusing "No service overrides yet for this account." text in between. Rework: every Overrides operation now lives inside a per-account modal keyed by an explicit title. Clicking the row's Overrides button opens account-overrides-modal whose title reads "Service overrides for {account.name} ({external_id})". The modal body uses the same loadOverridesPanel rendering function as before, so all four CRUD operations carry forward unchanged: - LIST: the existing overrides-table with Service / Term / Payment / Coverage / Reset, including #72's inline payment <select> in the Payment column. - CREATE: the existing override-modal from #106 stacks on top of the account-overrides-modal when the user clicks "Add override". Saving reloads the parent table; cancelling leaves the parent open. - EDIT-PAYMENT: same inline <select> as #72, now scoped inside the modal body so its loadOverridesPanel reload target is unambiguous. - DELETE: Reset button + confirmDialog, identical to before. renderAccountsList no longer creates an inline panel per row, no longer collects them in a panels[] array, and no longer appends them after the table — that whole inline-panel scaffolding is gone. Empty-state UX is preserved: an AWS account with zero overrides still auto-opens the inner create modal so users land directly on the form in 1 click instead of 2. Defensive: closeAccountOverridesModal also closes the inner create modal so a programmatic close (or future ESC-to-close from #115) doesn't leave an orphan modal whose Save would target a hidden parent. Tests: existing #72 + #106 test helpers updated to look for #account-overrides-modal-body instead of .account-overrides-panel. Four new tests in a "Account overrides modal" describe block lock in the behaviour: title-binds-to-account, switching-accounts-swaps-title, close-clears-body, and a regression guard that .account-overrides-panel no longer renders. Full settings-accounts test count: 40/40 (was 36 + 4 new). Full frontend suite: 1273/1273 green; typecheck + production build clean.
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
…#125) PR #124 (issue #122) moved per-account overrides into a modal and deleted the inline `.account-overrides-panel` element from the accounts table. The cleanup selector at renderAccountsList top still listed it, which is dead — no such element ever exists now. Drop the class from the querySelectorAll list and explain in the comment that overrides moved to the modal so a future reader doesn't restore the reference. No behaviour change. Tests + typecheck + build still green.
Closes #122. Closes #116.
The bug, in one screenshot's worth
Two AWS accounts:
AWS 540659244915andCUDly host (909626172446). User clicks Overrides on540…→ empty-state auto-opens the create modal → creates anaws/ec2override with Partial Upfront / 34% coverage. Modal closes; the inline panel under the accounts table now shows[Add override]and the new row.User then clicks Overrides on
909…. That account's panel also opens, appended after540…'s panel. Result: two panels stacked under the table with no titles. Theaws/ec2row visually attaches to whichever account is closer on screen, two unscopedAdd overridebuttons appear, and "No service overrides yet for this account." text floats between them with no indication of which account.The rework
All four CRUD operations move into a per-account modal keyed by an explicit title (
Service overrides for {account.name} ({external_id})). The accounts table loses the inline expandable panel entirely.<select>from ux(settings): add payment option selector to AWS account overrides modal #72.Add override. Save reloads the parent's list; cancel leaves the parent open with the existing rows.renderAccountsListno longer creates per-row panels, no longer collects them in apanels[]array, and no longer appends them after the table. The whole inline-panel scaffolding is gone.Empty-state UX is preserved: an AWS account with zero overrides still auto-opens the inner create modal, so users land directly on the form in 1 click — no regression vs #106.
A defensive tweak:
closeAccountOverridesModalalso closes the inner create modal, so a programmatic close (or future ESC-to-close from #115) doesn't leave an orphan modal whose Save would target a hidden parent.What this closes / pairs with
switching accounts swaps the modal titlelocks it in.Test plan
npx jest src/__tests__/settings-accounts.test.ts— 36 existing tests (PR ux(settings): add payment option selector to AWS account overrides modal #72's "AWS payment selector" + PR feat(settings): create-override modal for AWS account overrides (closes #104) #106's "Create-override modal") rewritten to look for#account-overrides-modal-bodyinstead of.account-overrides-panel. Plus 4 new in an "Account overrides modal" block: title binds to account, switching accounts swaps the title (locks in ux(settings): override modal silently swaps account context when reopened #116's fix), Close clears body, regression guard that.account-overrides-panelno longer renders. 40/40 pass.npx jest— full frontend suite (1273 tests) green.npm run typecheckclean.npm run build(production webpack) clean.Add overridebutton works, no inline panel appears below the accounts table.🤖 Generated with claude-flow