fix(examples/chat): hero walkthrough keeps reading pauses under reduced motion - #979
Merged
Conversation
… reduced motion prefers-reduced-motion previously zeroed every scripted pause, so the first prompt was typed and sent in the same tick and a reduced-motion visitor never got to read it. Reduced motion should remove animation, not reading time. typeInto now waits READ_PAUSE_MS (1200ms) after the instant set; moveCursor holds for READ_PAUSE_MS / 2 (600ms) instead of 0. press stays instant.
blove
enabled auto-merge (squash)
September 3, 2026 05:02
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
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.
Problem (verified on production)
Under
prefers-reduced-motion: reduce,HeroModezeroed every scripted pause:moveCursorslept 0,pressslept 0, andtypeIntowrote the whole prompt in one shot — so the first prompt was typed and sent in the same tick, and a reduced-motion visitor never got a chance to read it. The spec intent for reduced motion is "typing is instant and the cursor jumps," not "no pacing at all."Fix
In
hero-mode.component.ts:READ_PAUSE_MS = 1200("reduced motion removes animation, not reading time").typeInto: under reduced motion, after the instant set, waitsREAD_PAUSE_MSso the prompt is visible before the cursor moves on.moveCursor: under reduced motion, waitsREAD_PAUSE_MS / 2(600ms) instead of 0 — the cursor jumps, then holds briefly so the target is readable.pressstays instant (0ms) under reduced motion.reducedMotionan overridable public field (test seam, same pattern asbridge) instead of a readonly value computed once frommatchMedia, so specs can flip it without mockingmatchMediaglobally.The pauses run inside the existing
driving()wrapper, soscriptDrivingwindow semantics are unchanged.Test evidence
Two new specs in
hero-mode.component.spec.ts(real timers, timestamped):typeInto('abc')sets the textarea value synchronously but the returned promise takes ≥1200ms to resolve.moveCursor('composer')takes ≥600ms to resolve (not 0).npx nx test examples-chat-angular: 177 passed (23 files), 0 failed.npx nx lint examples-chat-angular: 0 errors (47 pre-existing warnings, unrelated to this change).🤖 Generated with Claude Code