Skip to content

Conversation

@ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Dec 18, 2025

The CodeBlocks story was flaky because useAutoScroll's ResizeObserver fires when Shiki highlighting completes, causing scroll-to-bottom which shifts elements by a few pixels.

Fix:

  • Wait for all 3 .code-block-wrapper elements to have Shiki spans (ensures highlighting is done)
  • Scroll to top after highlighting and wait a frame for ResizeObserver to settle

Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high

@ethanndickson ethanndickson changed the title 🤖 fix: wait for all code blocks before snapshot in CodeBlocks story 🤖 fix: wait for fonts and all code blocks before snapshot in CodeBlocks story Dec 18, 2025
@ethanndickson ethanndickson changed the title 🤖 fix: wait for fonts and all code blocks before snapshot in CodeBlocks story 🤖 fix: stabilize scroll position in CodeBlocks story to prevent flaky snapshots Dec 18, 2025
… snapshots

The story was flaky because useAutoScroll's ResizeObserver fires when Shiki
highlighting completes, causing scroll-to-bottom which shifts elements by
a few pixels.

Fix:
- Wait for all 3 code-block-wrappers to have Shiki spans (ensures highlighting done)
- Scroll to top after highlighting and wait a frame for ResizeObserver to settle
@ethanndickson ethanndickson added this pull request to the merge queue Dec 18, 2025
Merged via the queue into main with commit f51ad35 Dec 18, 2025
20 checks passed
@ethanndickson ethanndickson deleted the markdown-view-cgh8 branch December 18, 2025 06:25
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