feat(bond): add transaction-pending UX to create and withdraw actions#469
Open
samjay8 wants to merge 1 commit into
Open
feat(bond): add transaction-pending UX to create and withdraw actions#469samjay8 wants to merge 1 commit into
samjay8 wants to merge 1 commit into
Conversation
Buttons enter aria-busy loading, the confirm dialog locks during submit, and an
aria-live region announces progress, preventing duplicate submissions.
- Introduce isPendingCreate / isPendingWithdraw local state in Bond.tsx
- submitTransaction() mock wraps the async gap until the real Stellar API lands
- Create bond Button wires isLoading={isPendingCreate}; disabled during flight
- ConfirmDialog gains isSubmitting prop: confirm button enters isLoading, cancel
disabled, backdrop-click blocked to prevent inconsistent mid-submit dismissal
- aria-live="polite" sr-only region announces "Submitting transaction…" on start
and clears on success/failure so screen readers receive progress feedback
- Both handlers guard against double-submit via isPending checks
- Add RTL tests: aria-busy during flight, live-region text, double-submit
prevention, post-completion reset, and navigate-on-success
Closes CredenceOrg#443
|
@samjay8 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! 🚀 |
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.
Closes #443
Summary
Buttons enter
aria-busyloading, the confirm dialog locks during submit, and anaria-liveregion announces progress - preventing duplicate submissions and giving screen-reader users real-time feedback during the async Stellar transaction window.Changes
src/pages/Bond.tsxisPendingCreateandisPendingWithdrawlocal statesubmitTransaction()helper models the async gap (mock delay) until the real Stellar API landsButtonwiresisLoading={isPendingCreate}; button disabled during flighthandleCreateBondandconfirmWithdraware now async; both guard against double-submit viaisPendingflag checksaria-live="polite"sr-onlyregion announces"Submitting transaction."on start and clears on success/failuresrc/components/ConfirmDialog.tsxisSubmitting?: booleanpropisSubmitting: confirm button entersisLoadingstate, cancel button disabled, backdrop-click blocked to prevent inconsistent mid-submit dismissalsrc/pages/Bond.test.tsxvi.useFakeTimers()+advanceTimersto synchronously drive the mock delayTest plan
npm run lintpassesnpm run buildpassesnpm run testpasses (new Bond.test.tsx pending-state coverage)