Skip to content

fixed: web(WalletModal): enable focus trap inside wallet selection modal - #577

Open
GABRIELOFGOD wants to merge 2 commits into
Fundable-Protocol:mainfrom
GABRIELOFGOD:main
Open

fixed: web(WalletModal): enable focus trap inside wallet selection modal#577
GABRIELOFGOD wants to merge 2 commits into
Fundable-Protocol:mainfrom
GABRIELOFGOD:main

Conversation

@GABRIELOFGOD

@GABRIELOFGOD GABRIELOFGOD commented Jul 29, 2026

Copy link
Copy Markdown

close #392
close #394

Summary by CodeRabbit

  • Accessibility

    • Improved keyboard navigation within the wallet connection modal by keeping focus contained while using Tab and Shift+Tab.
    • Restored focus to the wallet trigger after closing the modal instead of moving focus to the page body.
    • Added clearer selection state announcements for wallet options and improved button behavior.
  • Tests

    • Added end-to-end coverage for modal focus trapping and Escape-key close behavior.

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@GABRIELOFGOD 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

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The wallet modal now traps keyboard focus, restores focus to its trigger on close, and exposes improved button semantics. Wallet triggers are marked for focus restoration, with end-to-end tests covering tab navigation and Escape dismissal.

Changes

Wallet modal accessibility

Layer / File(s) Summary
Trigger markers and focus behavior
apps/web/src/components/organisms/connect-button.tsx, apps/web/src/components/organisms/wallet-modal.tsx
Wallet triggers receive data-wallet-trigger; modal close restores focus to the mounted trigger, and wallet controls include explicit button types and selection state.
Keyboard focus validation
apps/web/e2e/wallet-connection.spec.ts, apps/web/test-results/.last-run.json
End-to-end tests verify focus remains within the modal during tab navigation and returns to a wallet trigger after Escape closes it; the recorded latest test status is failed.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: idrhas

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The updated apps/web/test-results/.last-run.json appears unrelated to the modal focus-trap fix. Remove the generated test-results artifact from the PR unless it is intentionally versioned as part of the feature.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The modal focus trap fix and accompanying tests address issue #392's acceptance criteria.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing focus trapping in the WalletModal wallet selection modal.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/web/e2e/wallet-connection.spec.ts (1)

87-106: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Cover focus restoration after a successful connection.

This test closes with Escape before connect() replaces the disconnected trigger. Add a mocked successful-connect flow that asserts focus lands on the newly mounted connected-wallet trigger after the modal auto-closes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/e2e/wallet-connection.spec.ts` around lines 87 - 106, Extend the
wallet connection focus test around the existing Escape scenario to mock a
successful connect flow, allowing connect() to replace the disconnected trigger
and auto-close the modal. Assert that focus is restored to the newly mounted
connected-wallet trigger after the successful connection, rather than only
validating the pre-connection Escape behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/web/test-results/.last-run.json`:
- Around line 1-4: Remove the generated test-results/.last-run.json artifact
from the change, and update the repository ignore configuration to exclude
generated test-result files such as .last-run.json.

---

Nitpick comments:
In `@apps/web/e2e/wallet-connection.spec.ts`:
- Around line 87-106: Extend the wallet connection focus test around the
existing Escape scenario to mock a successful connect flow, allowing connect()
to replace the disconnected trigger and auto-close the modal. Assert that focus
is restored to the newly mounted connected-wallet trigger after the successful
connection, rather than only validating the pre-connection Escape behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9c836ead-b344-47e6-aa92-6e18382050a3

📥 Commits

Reviewing files that changed from the base of the PR and between 375c936 and 0c7fdbb.

📒 Files selected for processing (4)
  • apps/web/e2e/wallet-connection.spec.ts
  • apps/web/src/components/organisms/connect-button.tsx
  • apps/web/src/components/organisms/wallet-modal.tsx
  • apps/web/test-results/.last-run.json

Comment thread apps/web/test-results/.last-run.json
@GABRIELOFGOD

Copy link
Copy Markdown
Author

New commit made
close #394

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.

web(StellarWalletProvider): normalize public keys to uppercase StrKey format web(WalletModal): enable focus trap inside wallet selection modal

1 participant