fix(a11y): keyboard-accessible block reordering + tighter focus order#60
Merged
Conversation
Contributor
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
block-kitchen | f2c24bb | Commit Preview URL Branch Preview URL |
May 16 2026, 05:31 PM |
…s order Adds keyboard-reachable Move up / Move down buttons on each block row, a proper menu/menuitemradio pattern for the toolbar surface + theme pickers (now closes on selection and returns focus to the trigger), removes fake focusable chrome from the Modal preview, fixes Space-scroll on the row Popover trigger, reveals the per-row toolbar on focus-within so Tab-stops aren't invisible, adds an aria-label to the JSON drawer textarea, and wraps the preview surface in a <main> landmark. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cc1cbde to
f2c24bb
Compare
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
Makes the builder usable with the keyboard alone. The biggest gap was that block reordering required a mouse drag with no keyboard alternative; this also cleans up a handful of focus-order, ARIA, and landmark issues found during the audit.
Why
Block reordering via
@dnd-kit'sPointerSensorhad no keyboard counterpart, and there were no Move Up / Move Down affordances either, so keyboard-only users literally could not change the order of blocks once they were on the surface. Several smaller issues compounded the problem:<button>s with noonClick, polluting the Tab order.<div role="button">; Space scrolled the page instead of opening the editor.<button>s — no menu semantics, no arrow-key nav, didn't close on selection.<textarea>had no accessible name.<main>landmark around the preview area.What changed
block-row.tsx— Adds Move up / Move down buttons to the per-row floating toolbar (with edge-disabled states) and reveals the toolbar ongroup-focus-withinso focused-but-invisible Tab stops can't happen. Adds an explicit Enter/Space handler on the row'srole="button"div trigger that opens the popover without scrolling.surface.tsx— Plumbsindex/total/onReorderthrough to BlockRow. Demotes the fake Modal chrome (Close, Cancel, Submit) from<button>to styled<span aria-hidden>so they're invisible to assistive tech and not in the Tab order. Wraps the preview area in<main aria-label="Block preview">.block-kitchen.tsx— PassesreorderBlockinto Surface asonReorder.toolbar.tsx— Replaces the ad-hoc Popover dropdowns with a smallMenuhelper that usesrole="menu"+role="menuitemradio"+aria-checkedand handles ArrowUp / ArrowDown / Home / End. Makes the Popovers controlled so they auto-close on selection (matchingmenuitemradiosemantics) and return focus to the trigger.json-drawer.tsx— Addsaria-label="Block Kit JSON"to the textarea.Test plan
pnpm typecheckpnpm lintpnpm test— 211 / 211<main aria-label="Block preview">landmark exists🤖 Generated with Claude Code