@remotion/studio: Scroll selected asset and composition into view in sidebar#6995
@remotion/studio: Scroll selected asset and composition into view in sidebar#6995JonnyBurger wants to merge 1 commit intomainfrom
@remotion/studio: Scroll selected asset and composition into view in sidebar#6995Conversation
…n sidebar Made-with: Cursor
|
Reviewed PR #6995 — no actionable issues found. The Task list (4/4 completed)
|
There was a problem hiding this comment.
Clean, well-scoped change. The useLayoutEffect + scrollIntoView({ block: 'center' }) pattern fires at the right time (post-DOM, pre-paint) to avoid visual flicker. The useCallback wrap on useSelectAsset is correct and necessary to keep the popstate effect stable. The fix to call selectAsset instead of bare setCanvasContent on popstate for asset URLs correctly expands parent folders and switches tabs — matching the initial-load path. No issues found.
Big Pickle (free) | 𝕏

When navigating to an asset or composition URL, scroll the sidebar tree so the selected item is centered in the viewport without animation.
scrollIntoView({ block: 'center', behavior: 'auto', })inuseLayoutEffecton selected asset and composition rows.popstatefor asset URLs, callselectAssetso folders expand and the Assets tab is shown.useSelectAssetwithuseCallback.