a11y: keyboard-operable editor chrome + topbar aria-labels

Clickable <div> rows/tiles (page list, layer tree, template cards, asset
picker grid) now expose role="button", a tab stop, and Enter/Space
activation via a shared clickableProps() helper, matching their existing
onClick behavior. TopBar icon-only controls (device switcher, undo/redo,
save, publish, templates, code, preview, back) gain aria-label alongside
their existing title tooltips.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-12 14:50:50 -07:00
parent a036843728
commit 46ebd253f3
7 changed files with 100 additions and 12 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import React, { useState, useCallback, useRef, useEffect, CSSProperties } from 'react';
import { uploadAsset, listAssets, Asset } from '../utils/assets';
import { clickableProps } from '../utils/a11y';
export interface AssetPickerProps {
value: string;
@@ -192,7 +193,7 @@ export const AssetPicker: React.FC<AssetPickerProps> = ({
{browserAssets.map((asset) => (
<div
key={asset.name}
onClick={() => handleSelectAsset(asset)}
{...clickableProps(() => handleSelectAsset(asset))}
data-testid={`asset-picker-thumb-${asset.name}`}
style={{ cursor: 'pointer', borderRadius: 4, overflow: 'hidden', border: '2px solid transparent', aspectRatio: '1' }}
>