Repository navigation
fix(wallet): reset failed kit init cache; feat(a11y): accessible trading components - #159
Merged
Merged
Conversation
getKit() cached the kit initialization promise unconditionally, so one failed init (wallet module load, init() throw) poisoned every later call with the same rejection until a page reload. Now the failed promise resets the module-level cache before rejecting (the next call retries from scratch), initialization runs with exponential backoff via the exported retryWithBackoff helper, and terminal failures surface as WalletInitializationError carrying the underlying cause and attempt count. Tests: src/lib/stellar/__tests__/wallet.test.ts covers success caching, failed-promise cache reset (retry after failure succeeds), the attempts and the underlying cause on terminal failure, backoff delay growth, and option clamping. Kit modules are virtual mocks; no real wallet is loaded. Closes Chulilee#64
…r trading components TradePanel: sr-only heading, aria-labelled form, order-side toggle group with aria-pressed and arrow-key navigation (focus follows selection), explicit label/input association, aria-describedby on the amount input, aria-live estimated-total row, role=status/role=alert for order feedback. OrderEntry: section header as h2 with an aria-labelled form, order-type and order-side toggle groups with aria-pressed and roving-tabindex arrow-key navigation shared by both groups, aria-labels on the 25/50/75/100% shortcut buttons, aria-live regions for available balance and order value. OrderBook: section as role=region with aria-label, h2 heading, bids/asks as role=list with per-row aria-labels, role=status/aria-live on the mid-market price so updates are announced. Existing getByRole/getByTestId tests and e2e selectors are unchanged. Closes Chulilee#63
|
@akargi is attempting to deploy a commit to the Akargi Team on Vercel. A member of the Team first needs to authorize it. |
aria-label on the 25/50/75/100% buttons replaced their visible accessible name and broke the existing queries; use a shared aria-describedby description instead so the name stays "25%" .. "100%" and screen readers still get the context. Closes Chulilee#63
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Summary
Bundles the two issues assigned to @akargi.
1. Wallet kit initialization caches failed promises — closes #64
getKit()cached the kit initialization promise unconditionally, so one failed init poisoned every later call with the same rejection (no recovery without a page reload).getKit()retries from scratch.retryWithBackoff, exported, default 3 attempts, doubling delay from 250 ms).WalletInitializationErrorcarrying the underlying cause and the attempt count, and the message names the stage and count.src/lib/stellar/__tests__/wallet.test.tscovers: success caching (init called once), failed-promise cache reset (a later call succeeds after a fully failed one), the attempt count/cause on terminal failure, backoff delay growth, and option clamping. Kit modules are virtual mocks.2. Trading components lack accessibility attributes — closes #63
aria-labelled form, order-side toggle group witharia-pressed+ arrow-key navigation (focus follows selection), explicit label/input association,aria-describedbyon the amount input,aria-live="polite"estimated-total row,role="status"for the success message androle="alert"for errors.aria-labelled form,role="group"wrappers for the order-type and order-side toggles witharia-pressedand a sharedrovingKeyDownhelper (ArrowLeft/Right move selection and focus, roving tabIndex),aria-labels on the 25/50/75/100% shortcut buttons ("Set size to X% of available balance"),aria-live="polite"regions for available balance and order value.role="region"witharia-label, h2 heading, bids/asks asrole="list"with one aria-label per row ("Bid 0.5000 at 40000.00, total depth 0.5000"style),role="status"/aria-live="polite"on the mid-market price so updates are announced.getByRole/getByTestId) and the Playwright e2e selectors are untouched and should keep passing.Notes for reviewers
role="tablist"/tabsemantics were deliberately avoided for the toggle groups: the repo tests query these controls asbuttons, and a single-panel toggle is equally well served byaria-pressed+ roving tabindex. Accessible names and state are still announced.npm ci/npm test/buildwere not run locally by the submitting agent; CI is expected to verify lint, type-check, tests and build.Closes #64
Closes #63