feat: add refund UI, spend simulator, SLA nudges, and error boundaries - #673
Merged
Conversation
|
@Osuochasam Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 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 |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This release introduces core user-facing features for escrow refunds and spend simulation, alongside proactive SLA notifications and resilient UI error handling to prevent page-wide crashes.
Key Changes:
Refund Request UI: Built a complete refund surface for eligible escrows. Includes a RefundCTA form (with eligibility gating, reason code selection, and a double-submission guard) and a RefundTimeline component to track the status progression of requests. Data structures and read-only fetching logic are isolated in refund.ts and useRefundEligibility.ts.
Spend Simulator Panel: Added a read-only simulation tool to the delegation detail page. Users can test hypothetical spends, and the SpendSimulatorPanel returns whether the transaction would be allowed or denied. If denied, it displays the specific bounding constraint and provides a direct, actionable remediation link (e.g., to raise a cap or renew a limit).
Proactive SLA Nudges: Implemented a notification system to warn users before pending approvals breach their SLA threshold. The useSLANudge hook polls pending requests and issues both in-app and OS notifications. It features robust deduplication, a snooze function backed by localStorage, and focus-suppression to avoid nagging active users.
Granular Error Boundaries: Shipped a reusable class component with a Tailwind-styled fallback card (supporting dark mode). Instead of an entire page crashing due to one failing widget, the boundary catches the error locally, preserves the state of interactive sibling components, provides a localized "retry" button, and exports a hook point for future Sentry ingestion.
Closes #569
Closes #572
Closes #575
Closes #586