Skip to content

chore(demo): Rebuild the playground as a responsive capability gallery#273

Open
untemps wants to merge 2 commits into
feat/interim-resultsfrom
feat/demo-revamp
Open

chore(demo): Rebuild the playground as a responsive capability gallery#273
untemps wants to merge 2 commits into
feat/interim-resultsfrom
feat/demo-revamp

Conversation

@untemps

@untemps untemps commented Jul 1, 2026

Copy link
Copy Markdown
Owner

What

Replace the single-button test harness in dev/ with a modern, responsive capability gallery — one self-contained card per feature (live preview + copyable "View source").

Cards: drop-in <Vocal> button · voice commands (with alternatives) · live dictation (continuous + interimResults) · bring-your-own-button (render-prop) · the useVocal hook with a live event log · useCommands typed matching · classifyError typed error handling (all 7 types).

Design system (aligned with the brand — black / white / red, red = the recording dot):

  • System-aware dark mode + persistent manual toggle, applied pre-paint (no flash).
  • Fluid clamp() type, CSS-variable tokens, listening pulse rings, prefers-reduced-motion, env(safe-area-inset-*), 100svh.

Cross-browser & responsive:

  • Driven by the library's own isSupported() — mic cards disable cleanly while the typed cards (useCommands, classifyError) keep working where SpeechRecognition is unavailable (Firefox, insecure contexts). Honest support banner, never hides the demo.
  • repeat(auto-fit, minmax(min(100%, 340px), 1fr)) grid reflows mobile → desktop with no media queries. Zero runtime dependencies added.

Stacking

This PR is stacked on #272 (interimResults) — its base is feat/interim-results so the diff shows only the demo changes. GitHub will retarget it to beta automatically once #272 merges. The dictation card's live captions depend on #272.

Verification

Build ✅ · lint (incl. dev/src) ✅ · a jsdom mount smoke test confirmed the whole tree (7 cards + hooks + classifyError + theme toggle) mounts without errors. Note: the actual microphone/voice flow needs a real browser + mic to exercise.

🤖 Generated with Claude Code

vincent-zelty and others added 2 commits July 1, 2026 08:52
Replace the single-button test harness with a gallery of self-contained cards
— one capability each — that exercises far more of the API and works across
browsers and screen sizes.

- Cards: drop-in button, voice commands (with alternatives), live dictation
  (continuous + interimResults), render-prop button, the useVocal hook with a
  live event log, useCommands typed matching, and classifyError handling.
- Design system: brand black/white/red tokens, system-aware dark mode with a
  manual toggle, fluid clamp() type, reduced-motion and safe-area support.
- Cross-browser: drives the library's isSupported() for graceful degradation —
  mic cards disable cleanly while the typed cards keep working where
  SpeechRecognition is unavailable (Firefox, insecure contexts).
- Responsive auto-fit grid; no runtime dependencies added.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Drop the ambiguous "API supported" pill from the header and add a dedicated
  "Feature detection" card that demonstrates isSupported() (now eight cards).
- Enlarge the header install command and switch it from npm to yarn.
- Move the theme toggle to the far right of the header.

Co-Authored-By: Claude Opus 4.8 (1M context) <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.

2 participants