Skip to content

feat(viewer): accessibility and responsive layout (M6-05) - #134

Merged
DrunkOnJava merged 1 commit into
mainfrom
cursor/viewer-a11y-67f9
Aug 29, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
cursor/viewer-a11y-67f9

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Aug 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

Viewer accessibility / responsiveness pass for M6-05 / #46:

  • Skip link, landmarks, ARIA labels on export/tree/status/demo controls
  • Keyboard tree navigation (Enter / Space / ArrowUp/Down / Escape)
  • :focus-visible styles + improved muted-text contrast
  • Mobile breakpoints (≤960px / ≤560px) so inspection works without horizontal overflow
  • Playwright smoke: landmarks + keyboard tree activation

Evidence

  • npm run typecheck clean (with viewer/pkg)
  • npm run build clean
  • Playwright: loads the viewer shell + accessibility shell — 2 passed

Test plan

  • typecheck / build
  • Playwright a11y smoke

Closes #46.


Note

Low Risk
UI-only HTML/CSS and client-side keyboard handlers; no changes to parsing, WASM, or export logic beyond labels and copy.

Overview
Implements M6-05 / #46: an accessibility and responsive-layout pass on the client viewer shell without changing decode or export behavior.

Accessibility: Adds a skip link to the viewport, semantic landmarks (banner, main, labeled asides), and ARIA on exports, status/live regions, file picker, scene tree (role="tree" / treeitem), demo list items, and diagnostics. New CSS covers :focus-visible rings, tree focus styling, slightly brighter muted text for contrast, and prefers-reduced-motion on the dropzone. Keyboard: scene tree rows are focusable; Enter/Space selects and shows element info (with visible selection); Arrow Up/Down moves focus; Escape clears selection and refocuses “Choose file” when the dropzone is open. Demo cards get descriptive aria-labels; copy mentions keyboard tree activation.

Responsive: At ≤960px the app stacks (viewport first, then sidebars) with scrollable layout; ≤560px tightens header and single-column status/info rows.

Tests: New Playwright smoke checks landmarks, skip link, tab focus, and (when the architectural demo is enabled) Enter on demo + tree and Escape clearing selection.

Reviewed by Cursor Bugbot for commit 7d1cb4c. Configure here.

Keyboard tree navigation (Enter/Space/arrows/Escape), skip link,
landmarks/ARIA labels, focus-visible styles, improved muted-text
contrast, and mobile breakpoints for the inspection layout.
Adds a Playwright a11y smoke covering landmarks and keyboard
activation. Addresses #46.

Co-authored-by: DrunkOnJava <[email protected]>
@cursor
cursor Bot force-pushed the cursor/viewer-a11y-67f9 branch from 53ebb0f to 7d1cb4c Compare August 29, 2026 11:42
@DrunkOnJava
DrunkOnJava merged commit 20300e6 into main Aug 29, 2026
24 checks passed
@DrunkOnJava
DrunkOnJava deleted the cursor/viewer-a11y-67f9 branch August 29, 2026 11:42
cursor Bot pushed a commit that referenced this pull request Aug 29, 2026
Update Lane Eleven triage log for thiserror (#132), criterion (#133),
three (#135), viewer a11y (#134), and remaining open majors TS7/cfb.

Co-authored-by: DrunkOnJava <[email protected]>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 4 potential issues.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 7d1cb4c. Configure here.

Comment thread viewer/index.html
min-height: 42vh;
}
#sidebar-right {
order: 4;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mobile grid rows ignore order

Medium Severity

grid-template-rows is written for DOM order, but order places #viewport in the second track and #sidebar-left in the third. Auto-placement therefore gives the minmax(42vh, 52vh) row to the scene tree, while the 3D view sits in an auto row. Combined with the tree’s max-height: 36vh, the stacked layout leaves a gap and does not size the viewport as the breakpoint intends.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7d1cb4c. Configure here.

Comment thread viewer/index.html
}
#demo-gallery {
width: min(100%, 560px);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropzone overflows short mobile viewport

Medium Severity

The new ≤960px layout shrinks #viewport to about 42vh, but #dropzone stays an absolutely positioned, unscrollable flex column with justify-content: center. #demo-list still uses max-height: min(42vh, 360px), so the picker and gallery are taller than the viewport. Centered overflow clips the top of the dropzone and paints over the stacked sidebars.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7d1cb4c. Configure here.

Comment thread viewer/src/main.ts
card.setAttribute(
'aria-label',
canOpen ? `Open demo ${demo.name}` : `Demo unavailable: ${demo.name}`,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Demo cards lose widget roles

Medium Severity

Setting role="listitem" on the demo <button> and <a> replaces their implicit button and link roles, so assistive tech no longer treats the cards as controls. The new aria-label also replaces the name computed from the card body, hiding format, version, quality, and availability text that fillDemoCard already renders.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7d1cb4c. Configure here.

Comment thread viewer/src/main.ts
if (node.children.length > 0) {
const ch = document.createElement('div');
ch.className = 'tree-children';
ch.setAttribute('role', 'group');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scene tree ARIA pattern is invalid

Medium Severity

Each .tree-node is a treeitem with tabIndex 0, while role="group" is a sibling under an un-roled wrapper rather than a child of the parent item. The tree therefore has no programmatic hierarchy, Tab stops on every node, and the new .selected state is never exposed via aria-selected.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7d1cb4c. Configure here.

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.

M6-05: Improve viewer accessibility and responsiveness

2 participants