Skip to content

fix(organizations): save pending balance alert email#4636

Merged
jeanduplessis merged 1 commit into
mainfrom
fix/minimum-balance-alert-email
Jul 20, 2026
Merged

fix(organizations): save pending balance alert email#4636
jeanduplessis merged 1 commit into
mainfrom
fix/minimum-balance-alert-email

Conversation

@jeanduplessis

Copy link
Copy Markdown
Contributor

Summary

Allow organization owners to save a minimum balance alert with a valid email still in the notification input.

Why this change is needed

The modal previously required users to press the add button before Save became available. For the common single-recipient case, the populated email field looked complete even though the address had not been added to the internal recipient list.

How this is addressed

  • Treat a valid pending email as a recipient when determining whether Save is available.
  • Add the pending address automatically when saving while preserving multi-recipient support.
  • Reject invalid pending input instead of silently omitting it.
  • Trim and deduplicate pending addresses.
  • Improve email-field guidance and accessible labels.
  • Add focused coverage for first, additional, duplicate, invalid, and empty pending-address cases.

Human Verification

  • Evaluated recipient resolution directly for single-recipient, multi-recipient, duplicate, invalid, and empty-input behavior.

Reviewer Notes

Human Reviewer Flags

  • The add button remains available for multiple recipients, but it is no longer required for the single-recipient path.

Code Reviewer Agent

Code Reviewer Notes
  • Client-side email syntax validation remains consistent with the modal's existing behavior.
  • The server continues to enforce a positive threshold and at least one valid notification email.
  • The focused Jest suite could not run locally because PostgreSQL and Docker were unavailable; web typecheck and lint passed.

@kilo-code-bot

kilo-code-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the pending-email resolution logic, modal save-gating, and accessibility updates; found no correctness or security issues in the changed lines.

Files Reviewed (3 files)
  • apps/web/src/components/organizations/SpendingAlertsModal.tsx
  • apps/web/src/components/organizations/spending-alerts-form.ts
  • apps/web/src/components/organizations/SpendingAlertsModal.test.ts

Reviewed by claude-sonnet-5 · Input: 16 · Output: 4.5K · Cached: 297.9K

Review guidance: REVIEW.md from base branch main

@jeanduplessis
jeanduplessis merged commit 7c24f68 into main Jul 20, 2026
15 checks passed
@jeanduplessis
jeanduplessis deleted the fix/minimum-balance-alert-email branch July 20, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants