Skip to content

feat(status): add stale transaction state with explicit refresh control - #988

Open
Sheebazz wants to merge 1 commit into
Creditra:mainfrom
Sheebazz:feat/stale-tx-refresh
Open

Sheebazz wants to merge 1 commit into
Creditra:mainfrom
Sheebazz:feat/stale-tx-refresh

Conversation

@Sheebazz

Copy link
Copy Markdown

Summary

Closes #936

This PR introduces a deterministic stale transaction state and an explicit user-driven refresh control for the draw-credit flow. It ensures that when network conditions or delays render a transaction status ambiguous, users receive clear feedback and a safe recovery path rather than facing silent data loss or an unrecoverable UI state.

Implementation Details

  • State Model: Expanded the Transaction type union in draw-credit.types.ts and creditLine.ts to include the "stale" status.
  • Design Tokens: Mapped "stale" to the existing accent color modifier and pending geometric pattern in TransactionStatus.tsx, adhering strictly to DESIGN_SYSTEM.md constraints against new inline hex values.
  • Backward Compatibility: Introduced onRefresh as an optional prop (onRefresh?: () => void), ensuring the 17 existing E2E callers (e.g., RepayPage) remain completely unbroken.
  • Consumer Wiring: Updated DrawCreditPage.tsx to handle the onRefresh callback, triggering a loading state and re-polling the ledger status deterministically. This explicitly locks the UI (setIsLoading(true)) to prevent concurrent state mutation loops.

Test Plan

  • Maintained all 20 existing WCAG (1.4.1 / 4.1.3) accessibility pattern tests without degradation.
  • Extended TransactionStatus.patterns.test.tsx (now 28 tests passing) to verify "stale" renders the correct accessible pattern and text ("Status Unknown").
  • Verified the "Refresh Status" button appears only when both status === "stale" and the onRefresh prop are provided.
  • Verified full TypeScript compilation passes cleanly (npm run build).

@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@Sheebazz 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! 🚀

Learn more about application limits

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.

[Quality-2][High] Display stale transaction status with explicit refresh controls

1 participant