Skip to content

Fix video flicker by using selective CSS transitions#2

Open
joshribakoff wants to merge 1 commit intomainfrom
fix-video-flicker
Open

Fix video flicker by using selective CSS transitions#2
joshribakoff wants to merge 1 commit intomainfrom
fix-video-flicker

Conversation

@joshribakoff
Copy link
Owner

Summary

  • Changed CSS from transition: all to specific properties only
  • Prevents flicker when clearState() removes classes before applying new ones
  • Background/border colors now change instantly, transform/box-shadow still animate

Root Cause

The clearState() function removes highlight classes, causing backgrounds to transition back to default before new state is applied.

Test plan

  • Added regression tests that verify no transition: all in templates
  • Visual review of video output

🤖 Generated with Claude Code

The animation was experiencing subtle flickering/dimming at step boundaries.

Root cause: The clearState() function removes all CSS classes before applying
new ones. With 'transition: all', backgrounds would visibly transition back
to default (#0f3460) before the new state colors were applied.

Fix: Change CSS transitions to only animate specific properties:
- .array-cell: transition transform and box-shadow only (not background/border)
- .pointer: transition opacity only
- .message-display: remove transition entirely

This allows background/border colors to change instantly while preserving
smooth scale and glow animations.

Also adds regression tests that verify templates don't use 'transition: all'
on elements that have clearState() applied to them.

Co-Authored-By: Claude Opus 4.5 <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.

1 participant