Skip to content

fix(docs): restore the code-block expand view transition - #701

Open
mehdibha wants to merge 1 commit into
mainfrom
fix/docs-code-block-view-transition
Open

fix(docs): restore the code-block expand view transition#701
mehdibha wants to merge 1 commit into
mainfrom
fix/docs-code-block-view-transition

Conversation

@mehdibha

@mehdibha mehdibha commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • fix(www): keep the page interactive during view transitions #438 set out to keep the page interactive during view transitions, but its second commit replaced the docs code-block expand/collapse morph with a height-only tween. The crossfade was gone: the new code appears at full opacity on the first frame and only the container height animates, which reads as an instant swap. This regression was noticed in the docs demos.
  • Restore the scoped view transition from that PR's first commit: toggleCodeBlock names the figure for the transition's duration and runs flushSync(update) inside startViewTransition. The global fixes from fix(www): keep the page interactive during view transitions #438 stay in place (:root { view-transition-name: none } and ::view-transition { pointer-events: none } in styles.css), so only the block morphs and the rest of the page keeps its hit-testing.
  • Reduced motion skips the transition (the global CSS also kills the pseudo animations).

Verification

Headless Chrome on /docs/components/button (InteractiveDemo, DynamicPre deferred highlighting) and /docs/components/text-field (Demo), expand and collapse, sampling every frame:

  • The view-transition pseudo animations run for ~250ms and the block's transition name clears when they finish.
  • document.elementFromPoint over a sidebar link returns the link on every frame of the transition, except the single snapshot frame.
  • pnpm check and pnpm typecheck pass. No registry files touched.

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
dotui Ready Ready Preview Sep 1, 2026 9:42pm UTC

@github-actions github-actions Bot added the area: www The dotui.org app: site, landing, docs pages label Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: www The dotui.org app: site, landing, docs pages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant