feat(ConnectButton): expose full address via aria-label for accessibi…#391
Merged
Jagadeeshftw merged 1 commit intoJul 23, 2026
Conversation
…lity
- Add aria-label=Disconnect - <full_address> to the connected-state button
so screen readers and assistive tech can access the complete 56-char
Stellar public key, not just the truncated GABC...WXYZ display text.
- Retain existing title=Disconnect mouse tooltip and visible truncated
text unchanged; click/disconnect behavior is unaffected.
- Add test: exposes the full wallet address in aria-label when connected
which asserts aria-label matches /^Disconnect - G[A-Z0-9]{55}$/.
3 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.
Closes #135
Problem
ConnectButton(src/components/ConnectButton.tsx) displayed the connected wallet address usingtruncateAddress()fromsrc/lib/wallet.ts, which shortens the full 56-character Stellar public key into a form likeGABC…WXYZ.The button carried only a static
title="Disconnect"attribute — a mouse-only tooltip that:This created an accessibility gap: users relying on assistive technology (and even sighted users who want to double-check their connected account) had no reliable way to discover the full address.
🔧 Solution
Added a single
aria-labelattribute to the connected-state<button>element that combines:The format is:
This satisfies WCAG 2.1 Success Criterion 1.3.1 (Info and Relationships) and 4.1.2 (Name, Role, Value) by providing a meaningful accessible name that goes beyond the truncated visible text.
📁 Files Changed
src/components/ConnectButton.tsx<button onClick={() => setConfirmOpen(true)} className="rounded-lg border border-zinc-700 px-3 py-1.5 text-xs font-medium text-zinc-200 hover:bg-zinc-800" title="Disconnect" + aria-label={`Disconnect – ${account.address}`} > {truncateAddress(account.address)} </button>What changed: One attribute added. Nothing else.
What did NOT change:
GABC…WXYZ) — still rendered viatruncateAddress()title="Disconnect"mouse tooltip — still presentonClickhandler andConfirmDialogdisconnect flow — completely untouchedsrc/components/ConnectButton.test.tsxAdded one new test case inside the existing
describe("ConnectButton")block:What this test asserts:
aria-label"Disconnect – "G+ 55 uppercase alphanumeric chars)^and$) ensure no extra content sneaks inAll 8 existing tests remain untouched — the
title="Disconnect"attribute used by those tests is still present on the element.✅ Acceptance Criteria
aria-label="Disconnect – <full 56-char address>"title)aria-labelis read by all screen readers;titlealone is nottruncateAddress()still rendersGABC…WXYZtitle="Disconnect"tooltip unchangedonClick,useWallet, orConfirmDialogConnectButton.tsxandConnectButton.test.tsxtouched🔒 Security
The wallet address is a Stellar public key (
G...) — public by design, already rendered in the DOM via the truncated text. Adding it toaria-labelintroduces zero new sensitive data exposure.🧪 How to Test
Manually: Connect the mock wallet in the UI, then inspect the button element in DevTools — the
aria-labelattribute should readDisconnect – G<full address>.