Skip to content

fix(invitations): keep focus on Accept and Decline while the answer is sent - #131

Merged
steveapo merged 2 commits into
mainfrom
fix/ux-invitation-answer-keeps-focus
Nov 22, 2026
Merged

steveapo merged 2 commits into
mainfrom
fix/ux-invitation-answer-keeps-focus

Conversation

@steveapo

@steveapo steveapo commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What

Accept and Decline on an invitation: the pressed button is pending, the other is disabled, and a second answer is refused while one is in flight.

Why

A disabled button that has the focus drops it (WCAG 2.4.3). The ownership offer page already does it this way. No text changes (no pendingLabel).

Audit finding UX-5. Class A, size XS.

Seen in the running app (local database, keyboard, 2.5 s of added latency)

  • Before (main): pressing Decline with Enter made the page body the active element; both buttons were disabled.
  • After (this branch): focus stays on Decline, which is aria-busy; Accept is disabled, not busy. When the answer arrives, the statement "Invitation declined." takes focus as before.
  • The first version of this branch made both buttons busy for one answer; that is corrected here.
  • Noticed on main and left alone (UX-43 in the audit): after Accept succeeds, the buttons come back to life until the move to the document finishes, so a slow connection shows a live Accept for a moment.
  • Not observed: a refusal on this page; a screen reader.

Checks (local, quick only)

  • typecheck, eslint, prettier on the changed files: clean
  • tests/unit/invitation-focus.test.ts (3) and deleted-account.test.ts: 21 passed

Gate: quick. The route and its authorisation are untouched.

🤖 Generated with Claude Code

steveapo and others added 2 commits November 22, 2026 22:31
…s sent (NFR-IC-19; WCAG 2.4.3)

Both buttons were disabled while the request ran, so a refusal left the
keyboard at the top of the page and no in-flight state showed. They now use
pending, as the ownership offer page does. No text changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…AG 2.4.3)

With pending on both, Accept and Decline both went busy for one answer. Only
the pressed one is pending now; the other waits, disabled, as on the offer
page, and a second answer is refused while one is in flight.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@steveapo
steveapo merged commit c890d67 into main Nov 22, 2026
6 checks passed
@steveapo
steveapo deleted the fix/ux-invitation-answer-keeps-focus branch November 22, 2026 21:20
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.

1 participant