flowfi icon indicating copy to clipboard operation
flowfi copied to clipboard

[Frontend] Give ShareAddressModal dialog semantics and an accessible close button

Open blurbeast opened this issue 2 weeks ago • 5 comments

Overview & Background

ShareAddressModal is a bare <div className="fixed inset-0 ..."> with no role="dialog", aria-modal, or aria-labelledby. Its close button is an icon-only <X /> with no accessible name. There is no Escape handling, focus trap, or focus restoration — screen readers announce nothing when it opens, and keyboard users can tab straight through the modal into the background page. Every other modal in the codebase (TopUpModal, WalletModal, StreamDetailsModal, etc.) at minimum carries role="dialog" aria-modal="true" aria-labelledby.


Technical Specification & Architecture

  1. Rework frontend/src/components/dashboard/ShareAddressModal.tsx onto the shared useModalDialog hook (src/hooks/useModalDialog.ts, which already implements Escape, Tab-cycling, and focus restore — with tests).
  2. Add role="dialog", aria-modal="true", aria-labelledby pointing at the heading, and aria-label="Close" on the close button.

Target Files

  • frontend/src/components/dashboard/ShareAddressModal.tsx
  • frontend/src/hooks/useModalDialog.ts

Acceptance Criteria

  • [ ] Modal is announced by screen readers on open.
  • [ ] Escape closes it; Tab cycles within it; focus returns to the trigger on close.
  • [ ] The close button has an accessible name.
  • [ ] An axe-based a11y test covers the modal.

blurbeast avatar Nov 18 '26 19:11 blurbeast

@toyosi-14 has applied to work on this issue as part of the Stellar Wave Program's 11th wave.

Hi Maintainer,

I’m a full-stack developer, and I’d like to contribute to the task. I’ll implement it carefully and efficiently thoroughly understand requirements and edge cases Communicate promptly about suggestions or improvements. And I will provide regular progress updates and address blockers Align with project goals through feedback and clarification.

Thank you,

ℹ️ Repo Maintainers: To accept this application, review their application or assign @toyosi-14 to this issue.

toyosi-14 avatar Nov 20 '26 12:11 toyosi-14

@Thobadd has applied to work on this issue as part of the Stellar Wave Program's 11th wave.

Hi maintainer,

I'd like to take a shot at this issue. I went through the checkout flow and looked at the XLM checkout modal component. I can see exactly what's happening when a user rejects the transaction in Freighter — the promise gets rejected, but there's no catch around it. The modal just sits there in its loading state, leaving the user staring at a spinner with no feedback. Since rejecting a transaction is a normal thing to do, the app shouldn't freeze.

My plan is to wrap the Freighter signing call in a try/catch and specifically detect the rejection case. From what I've seen with the Freighter API, user rejection usually comes back as an error containing something like "User declined" or "User rejected the request." I'll check for that pattern to distinguish an intentional rejection from a real failure like a network issue. On rejection, I'll reset the modal's loading state so the UI doesn't freeze and surface a friendly toast like "Transaction rejected in Freighter. No funds were sent." For genuine errors, I'll keep a separate message so we don't conflate the two.

A couple of things I want to get right: first, the loading state needs to be reset in a finally block so we never leave the button disabled if something unexpected throws. Second, I'll make sure the toast component matches the pattern already used in the codebase rather than introducing a new one. I'll also manually verify the flow by rejecting in the Freighter extension to confirm the modal returns to a usable state.

I've contributed to a few React/TypeScript projects before and I'm comfortable with error-handling patterns like this. I'll keep the PR scoped to just this component, and the PR description will include the required closing tag as requested. Happy to adjust the message copy if you have a preferred tone. Let me know if you'd like me to proceed or if there's anything else you want covered in scope.

Thanks

ℹ️ Repo Maintainers: To accept this application, review their application or assign @Thobadd to this issue.

Thobadd avatar Nov 20 '26 16:11 Thobadd

@ademola-star has applied to work on this issue as part of the Stellar Wave Program's 11th wave.

i can drive

ℹ️ Repo Maintainers: To accept this application, review their application or assign @ademola-star to this issue.

ademola-star avatar Nov 21 '26 07:11 ademola-star

Congratulations, @ademola-star! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on November 25, 2026.

🧑‍💻 @ademola-star: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

🌊 Happy Wave 🌊

drips-wave[bot] avatar Nov 21 '26 07:11 drips-wave[bot]

This issue has been completed by @ademola-star as part of the Stellar Wave Program's 11th Wave 🥳

😎 @ademola-star: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

drips-wave[bot] avatar Nov 24 '26 17:11 drips-wave[bot]