fix(terminal): resolve colors without reduced-motion transitions - #542
Merged
Merged
Conversation
Model: gpt-6-astra
nzhl
marked this pull request as ready for review
September 9, 2026 15:58
Contributor
|
Thanks! |
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.
Related issue
Closes #541
Problem / pressure
With Reduce motion enabled, the embedded terminal can appear blank because its
foreground, cursor, and ANSI colors resolve to its background color. The global
0.01mstransition duration affects the hidden span used bybuildTerminalTheme,so immediate computed-style reads can return the start of a color transition.
Summary
Disable transitions on the disposable color probe before appending it. This
keeps terminal creation and theme updates synchronous and leaves the global
reduced-motion behavior intact. Add a Chromium regression using the real
stylesheet and resolver, plus a short decision note.
Visual explanation
const probe = document.createElement('span'); // Existing positioning, visibility, and pointer-event styles. +probe.style.transitionProperty = 'none'; host.appendChild(probe); // Assign each color token, then read getComputedStyle(probe).color immediately.Before / after
Test plan
VITE_PREVIEW_PUBLIC_BASE_DOMAIN=example.invalid pnpm --filter @lody/components exec playwright test tests/e2e/terminal-theme.spec.ts --workers=1 --reporter=line.pnpm checkpassed with Node 22.22.2, including typechecks, lint, existing tests, and boundary guards; the component suite passed 445 files / 3306 tests.pnpm format, formatting checks for the new test and note,pnpm run docs check, andgit diff --checkpassed. Unrelated formatter output was excluded, preserving the resolver's existing formatting.Context handoff
Instructions for reviewing agents
terminal-theme.tsand the browser regression's use of the real reduced-motion stylesheet, since both initial and later terminal themes use this resolver.test:e2esuite rather than root Vitest CI.Authoring context