chore(demo): Rebuild the playground as a responsive capability gallery#273
Open
untemps wants to merge 2 commits into
Open
chore(demo): Rebuild the playground as a responsive capability gallery#273untemps wants to merge 2 commits into
untemps wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) · theuseVocalhook with a live event log ·useCommandstyped matching ·classifyErrortyped error handling (all 7 types).Design system (aligned with the brand — black / white / red, red = the recording dot):
clamp()type, CSS-variable tokens, listening pulse rings,prefers-reduced-motion,env(safe-area-inset-*),100svh.Cross-browser & responsive:
isSupported()— mic cards disable cleanly while the typed cards (useCommands,classifyError) keep working whereSpeechRecognitionis 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
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