ADR β PR #1030
This document captures decisions made in response to CodeRabbit feedback on PR #1030.
2026-05-20 β Fetch timeout already implemented
Section titled β2026-05-20 β Fetch timeout already implementedβ- Comment: CodeRabbit feedback on fetch calls around line 62-64
- Priority: skip
- Decision: skip
- Rationale: All fetch calls in
OrgBilling.tsxalready implement AbortController with 30-second timeout. The pattern (create controller, pass signal, set timeout, clear timeout) is correctly applied inloadBilling,OverrideModal.handleSave, andFreeTrialModal.handleSave.
2026-05-20 β Modal dialog semantics already implemented
Section titled β2026-05-20 β Modal dialog semantics already implementedβ- Comment: CodeRabbit feedback on modal around line 718-736
- Priority: skip
- Decision: skip
- Rationale: The
ModalShellcomponent already implements all required accessibility features:role="dialog",aria-modal="true",aria-labelledby="modal-title",aria-describedby="modal-desc", explicit ids on title/subtitle elements, Escape key handler to callonClose, focus trap via useRef with tabindex, and restore focus on close.
2026-05-20 β currentPeriod logic already correct
Section titled β2026-05-20 β currentPeriod logic already correctβ- Comment: CodeRabbit feedback on currentPeriod calculation
- Priority: skip
- Decision: skip
- Rationale: The
currentPeriodcalculation inorg-billing-data.tsline 193-200 usesmonthlyData.find(...) ?? nullwhich correctly returns null when no current-month row exists. There is no fallback tomonthlyData[0]in the current code.
2026-05-20 β grantFreeTrialSchema already requires integer
Section titled β2026-05-20 β grantFreeTrialSchema already requires integerβ- Comment: CodeRabbit feedback on free-trial.ts schema
- Priority: skip
- Decision: skip
- Rationale: The
grantFreeTrialSchemainfree-trial.tsusesz.number().int().positive()for the amount field, already enforcing that only positive integers are accepted.
2026-05-20 β updateOverrideSchema already enforces non-negative values
Section titled β2026-05-20 β updateOverrideSchema already enforces non-negative valuesβ- Comment: CodeRabbit feedback on override.ts schema
- Priority: skip
- Decision: skip
- Rationale: The
updateOverrideSchemainoverride.tsalready enforces the correct constraints:minOrderCharge,perLineItemRate, andaccountCredituse.min(0);freeTrialLineItemsuses.int().min(0).optional(). Negative and fractional values are rejected.
2026-05-20 β Add useEffect dependency array for modal keyboard handler
Section titled β2026-05-20 β Add useEffect dependency array for modal keyboard handlerβ- Comment: CodeRabbit feedback on modal keyboard handler
- Priority: nice-to-have
- Decision: accept
- Rationale: The
ModalShellcomponentβsuseEffectwas missingonClosein its dependency array. Without this, the keyboard handler might reference a staleonClosefunction. Added[onClose]dependency to ensure the handler always calls the latest close function.