Skip to content

3D memory constellation usability, a11y & performance pass (reduced-motion, WebGL fallback, keyboard, mobile) #25

Description

@harrymove-ctrl

Context

NamespaceMemoryConstellation.tsx always autorotates (controls.autoRotate = true, line 345), runs a permanent requestAnimationFrame loop (line 362) with UnrealBloomPass/EffectComposer, and caps setPixelRatio(min(dpr, 2)) (line 333). It ignores prefers-reduced-motion, has no WebGL-unavailable fallback, no keyboard navigation, no Esc-to-deselect (DOM labels are aria-hidden, line 560), and is crowded on mobile. The landing hero already respects reduced-motion (main.tsx:953), so the pattern exists but isn't applied here.

Goal / user story

As a keyboard, low-power, reduced-motion, or mobile user, I can use the memory graph without motion sickness or a frozen/blank canvas — with a usable 2D fallback when WebGL is unavailable.

Acceptance criteria

  • Autorotate + bloom + the RAF loop are gated on prefers-reduced-motion (static/paused render when the user prefers reduced motion).
  • When WebGL is unavailable, a 2D/list fallback renders from facts-to-graph.ts (+ related-neighbors.ts) instead of a blank canvas.
  • Esc deselects the active node and exits fullscreen.
  • Search results and nodes are keyboard-navigable (focus + arrow/enter, aria-activedescendant), not mouse-only.
  • On small viewports (<~640px) pixelRatio and bloom strength are reduced, and the graph + detail panel are usable (verified at phone width).
  • Switching to the fallback disposes the renderer/composer (no leaked WebGL context).

Implementation notes

  • Reuse the window.matchMedia('(prefers-reduced-motion: reduce)') pattern from main.tsx:953; store it in a ref and branch the animate() loop / controls.autoRotate in NamespaceMemoryConstellation.tsx.
  • Add a WebGL capability check before new THREE.WebGLRenderer; fall back to a DOM graph using the already-imported facts-to-graph.ts and related-neighbors.ts.
  • Add a keydown handler for Escape; make MemorySearchBox results a keyboard listbox.
  • Mobile: lower UnrealBloomPass strength and setPixelRatio(1) under the breakpoint; consider a bottom-sheet detail panel.
  • Gotcha: dispose renderer/composer/geometries on fallback switch and on unmount to avoid context-loss leaks.

Sui Overflow angle

The 3D "memory constellation" is the signature visual for the Walrus-backed knowledge graph — the thing judges screenshot. Making it reduced-motion-safe (for clean screen recordings), WebGL-resilient, and mobile-friendly keeps the wow-factor working across judges' varied devices.

Dependencies

None — the 2D fallback uses the existing facts-to-graph.ts.

Part of the ContextMEM roadmap (#4) • Sui Overflow build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Important: hardens the demo and core productui-uxWeb app UI/UX, accessibility, and responsive design

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions