Skip to content

feat: frontend accessibility, ARIA, keyboard nav, empty/loading states#86

Open
tirth8205 wants to merge 23 commits intomainfrom
feat/accessibility-fixes
Open

feat: frontend accessibility, ARIA, keyboard nav, empty/loading states#86
tirth8205 wants to merge 23 commits intomainfrom
feat/accessibility-fixes

Conversation

@tirth8205
Copy link
Copy Markdown
Owner

@tirth8205 tirth8205 commented Mar 31, 2026

Summary

  • Accessibility (WCAG 2.1 AA): Distinct node shapes per kind (d3.symbol — circle, square, triangle, diamond, cross) for colorblind users. ARIA roles on all interactive elements (dialog, tooltip, listbox, button). Focus-visible outlines. Skip navigation link.
  • Keyboard navigation: / to focus search, ? for help overlay, Escape to close panels, Enter/Space on edge toggles, arrow keys between connected nodes.
  • ARIA semantics: aria-pressed on toggle buttons, aria-live="polite" on tooltip and node count, role="listbox" + role="option" on search results, aria-modal on dialogs.
  • Contrast fixes: .dp-close raised to #b0b8c4, placeholder to #6e7681, tooltip labels to #9eaab6 — all meeting WCAG AA 4.5:1.
  • Edge types: All 7 edge types (CALLS, IMPORTS_FROM, INHERITS, IMPLEMENTS, TESTED_BY, DEPENDS_ON, CONTAINS) rendered in standalone HTML with spec-correct dash patterns and legend entries.
  • Empty/loading states: Loading spinner during force simulation, empty state message when graph has zero nodes — both surfaces.
  • VS Code extension: Edge pill keyboard support, aria-pressed toggle, depth slider disabled when no node selected, empty state, tooltip uses CSS variables.
  • Help overlay: Keyboard shortcut reference accessible via ? key or button.

Test plan

  • 512 tests pass (13 visualization tests including 4 new ARIA/state assertions)
  • ruff check clean
  • tsc --noEmit clean
  • Manual: Tab through standalone HTML interactive elements — verify focus ring visible
  • Manual: Toggle edge types via keyboard in both surfaces
  • Manual: Open/close detail panel with Escape, verify focus returns
  • Manual: Generate HTML with 0-node graph — verify empty state

🤖 Generated with Claude Code

tirth8205 and others added 22 commits March 31, 2026 13:11
Covers all 23 WCAG 2.1 AA issues across standalone HTML visualization
and VS Code webview: distinct node shapes, contrast fixes, keyboard
navigation, ARIA roles, edge differentiation, and minor polish.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace Catppuccin Mocha colors (File=#cba6f7, Class=#f9e2af, Function=#a6e3a1)
with GitHub Dark palette (File=#58a6ff, Class=#f0883e, Function=#3fb950) across
NODE_COLOR, EDGE_COLOR, NODE_RADIUS, edge filter pills, tooltip CSS, and selection
highlight color (#f5e0dc → #e6edf3).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…imum

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…HTML

Brings standalone HTML visualization to feature parity with the VS Code extension
by adding 3 missing edge types: EDGE_COLOR entries, EDGE_CFG configurations,
SVG arrow markers, and legend items for IMPLEMENTS, TESTED_BY, and DEPENDS_ON.
Adds a regression test verifying all 7 edge types appear in generated HTML.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d users

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…er, escape)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…esults, communities button

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Includes VS Code webview path rendering (SVGCircleElement -> SVGPathElement),
unified color palette in graph.ts, and symbolCross test assertion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…lp overlay

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…alization

Expands the existing keyboard-shortcut overlay to include a full
interaction guide (click a file, shift-click, drag, scroll, etc.) and a
dismiss hint, so new users can discover the graph's interactions at a
glance. Adds a corresponding test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…bview

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… to VS Code webview

- Edge pills: role=button, tabindex, aria-pressed, aria-label, title
- Search input: aria-label
- Depth slider: title explaining behavior
- Empty state div in graph-area
- Tooltip: role=tooltip, aria-live=polite
- Node count: aria-live=polite
- Edge pill inactive opacity 0.45 -> 0.55

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eyboard support in VS Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…anels

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…alization tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e style override

The CSS rule used 0.35 while JS set 0.4 inline. Align CSS to 0.4 (matching spec)
and remove the JS inline opacity overrides since the CSS :disabled selector handles it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tirth8205 tirth8205 changed the title feat: WCAG 2.1 AA accessibility fixes for all frontend surfaces feat: frontend accessibility, ARIA, keyboard nav, empty/loading states Mar 31, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tirth8205
Copy link
Copy Markdown
Owner Author

Review: PR #86 — frontend accessibility, ARIA, keyboard nav, empty/loading states

Verdict: Approve — ready to merge with minor notes.

Strengths:

  • d3.symbol() distinct shapes per node kind correctly addresses colorblind accessibility
  • ARIA semantics are correct: role=tooltip, role=dialog, role=listbox, role=option, aria-live=polite, aria-pressed, aria-modal
  • Keyboard shortcuts (/, ?, Escape) follow ARIA authoring practices
  • detailTrigger pattern for focus return on panel close is correct modal behavior
  • 13 new visualization tests including ARIA, shape, loading/empty state assertions
  • ruff and tsc clean per PR description

Minor notes for follow-up (not blocking):

  1. Verify all .node-circle selectors in visualization.py were updated to .node-shape (highlightConnected and any others beyond the ones visible in the diff)
  2. Confirm updateDepthSliderState() is called in the node click handler (not just setData/buildGraph) so the depth slider enables after node selection
  3. aria-modal should be 'true' when the detail panel is open, not 'false' — the test asserting aria-modal=false may be testing the wrong state
  4. Confirm #edge-popover has click-outside-to-close logic in the VS Code extension

@tirth8205
Copy link
Copy Markdown
Owner Author

Merge conflict detected. This PR has merge conflicts with main (mergeStateStatus: DIRTY). Since this is the owner's PR, please rebase on the current main branch to resolve conflicts before merging. The visualization and VS Code extension files have likely had changes merged since this PR was opened.

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