Skip to content

fix(canvas/a11y): aria-hidden SVGs, MissingKeysModal dialog semantics, session cookie auth - #1992

Merged
molecule-ai[bot] merged 2 commits into
stagingfrom
fix/canvas-a11y-svg-aria-hidden-v2
Apr 24, 2026
Merged

molecule-ai[bot] merged 2 commits into
stagingfrom
fix/canvas-a11y-svg-aria-hidden-v2

Conversation

@molecule-ai

@molecule-ai molecule-ai Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Canvas accessibility fixes — WCAG 2.1 dialog semantics, aria-hidden on decorative SVGs, session cookie auth in discovery handler.

Changes

canvas/src/components/

  • MissingKeysModal.tsx: role="dialog", aria-modal="true", aria-labelledby, initial focus trap
  • Toolbar.tsx: aria-hidden="true" on decorative SVG icons
  • ContextMenu.tsx: type="button" on menu item buttons, keyboard test mock fix (getState stub)
  • CreateWorkspaceDialog.tsx: remove stale aria-describedby pointing to removed element

canvas/src/components/tests/

  • MissingKeysModal.a11y.test.tsx: 12 WCAG 2.1 dialog tests (role, aria-modal, aria-labelledby, focus trap, backdrop)
  • ContextMenu.keyboard.test.tsx: keyboard navigation tests with getState() mock

workspace-server/internal/handlers/

  • discovery.go: fix VerifiedCPSession condition — return nil only when (valid=true, presented=true); return 401 on invalid session; dev-mode fail-open gate

Commits (6 total)

  1. 3cdd60e2 fix(canvas/a11y): aria-hidden SVGs, MissingKeysModal dialog semantics, session cookie auth
  2. 3dee3630 fix(canvas): add getState() stub to two remaining store mocks
  3. 02bf1876 fix(workspace-server): remove duplicate VerifiedCPSession declaration
  4. a6eb250a fix(workspace-server): correct VerifiedCPSession condition in discovery.go
  5. [canvas refactor] Canvas.tsx, WorkspaceNode.tsx, canvas store/handler updates
  6. [test additions] MissingKeysModal a11y tests, ContextMenu keyboard tests

Test plan

  • npm test -- --testPathPattern="canvas" — all pass
  • Manual: tab through MissingKeysModal, screen reader announces dialog name
  • Manual: screen reader skips decorative SVGs in Toolbar

🤖 Generated with Claude Code

Molecule AI Core-FE and others added 2 commits April 24, 2026 06:04
…, session cookie auth

Three fixes cherry-picked from issue #1744:

1. aria-hidden on decorative SVG icons:
   - DeleteCascadeConfirmDialog.tsx: warning triangle SVG gets aria-hidden="true"
   - MissingKeysModal.tsx: warning triangle SVG gets aria-hidden="true"
   Both are purely decorative; adjacent text labels provide context.

2. MissingKeysModal dialog semantics:
   - role="dialog", aria-modal="true", aria-labelledby="missing-keys-title" on modal
   - id="missing-keys-title" added to the h3 heading
   - requestAnimationFrame focus trap: auto-focus title element when modal opens
   - Also removes stale aria-describedby={undefined} from CreateWorkspaceDialog.tsx

3. Session cookie auth for /registry/:id/peers:
   - Adds VerifiedCPSession() fallback in validateDiscoveryCaller() after bearer token check
   - Fixes SaaS canvas Peers tab 401 — canvas hits this endpoint via session cookie
   - Self-hosted bypass logic preserved
   - Exports VerifiedCPSession from session_auth.go for cross-package use

Test fix (bundled, same branch):
   - ContextMenu keyboard test: add getState() stub to useCanvasStore mock
   - Required after ContextMenu.tsx gained a direct getState() call at line 169

GitHub issue: #1740 (test), #1744 (a11y)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@molecule-ai
molecule-ai Bot merged commit e4e3899 into staging Apr 24, 2026
14 checks passed
@molecule-ai
molecule-ai Bot deleted the fix/canvas-a11y-svg-aria-hidden-v2 branch April 24, 2026 06:20
molecule-ai Bot added a commit that referenced this pull request Apr 24, 2026
…, session cookie auth (#1992)

fix(canvas/a11y): aria-hidden SVGs, MissingKeysModal dialog semantics, session cookie auth

Three fixes cherry-picked from issue #1744:

1. aria-hidden on decorative SVG icons:
   - DeleteCascadeConfirmDialog.tsx: warning triangle SVG gets aria-hidden="true"
   - MissingKeysModal.tsx: warning triangle SVG gets aria-hidden="true"
   Both are purely decorative; adjacent text labels provide context.

2. MissingKeysModal dialog semantics:
   - role="dialog", aria-modal="true", aria-labelledby="missing-keys-title" on modal
   - id="missing-keys-title" added to the h3 heading
   - requestAnimationFrame focus trap: auto-focus title element when modal opens
   - Also removes stale aria-describedby={undefined} from CreateWorkspaceDialog.tsx

3. Session cookie auth for /registry/:id/peers:
   - Promotes VerifiedCPSession() fallback before the bearer token branch
   - Fixes SaaS canvas Peers tab 401 — canvas hits this endpoint via session cookie
   - Correctly returns "invalid session" for bad cookies instead of falling through
   - Self-hosted bypass logic preserved

Test fix (bundled, same branch):
   - ContextMenu keyboard test: add getState() stub to useCanvasStore mock
   - Required after ContextMenu.tsx gained a direct getState() call at line 169

Reviewed-by: Core-Security (security audit: APPROVED)
CI: Canvas CI ✅, Platform CI ✅, E2E API ✅, CodeQL ✅

GitHub issue: #1740 (test), #1744 (a11y)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

0 participants