Skip to content

@remotion/studio: Scroll selected asset and composition into view in sidebar#6995

Closed
JonnyBurger wants to merge 1 commit intomainfrom
studio/sidebar-scroll-into-view
Closed

@remotion/studio: Scroll selected asset and composition into view in sidebar#6995
JonnyBurger wants to merge 1 commit intomainfrom
studio/sidebar-scroll-into-view

Conversation

@JonnyBurger
Copy link
Copy Markdown
Member

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', }) in useLayoutEffect on selected asset and composition rows.
  • On popstate for asset URLs, call selectAsset so folders expand and the Assets tab is shown.
  • Memoize useSelectAsset with useCallback.

@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog bot commented Apr 4, 2026

Reviewed PR #6995 — no actionable issues found. The useLayoutEffect scroll-into-view pattern, useCallback memoization of useSelectAsset, and the popstate handler fix are all correct.

Task list (4/4 completed)
  • Read the full diff
  • Read full source files for context
  • Analyze correctness and edge cases
  • Submit review or report progress

Pullfrog  | View workflow run | Triggered by Pullfrog | Using Big Pickle (free) | 𝕏

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 4, 2026

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

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Apr 4, 2026 4:34pm
remotion Ready Ready Preview, Comment Apr 4, 2026 4:34pm

Request Review

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Pullfrog  | View workflow run | Using Big Pickle (free) | 𝕏

@JonnyBurger
Copy link
Copy Markdown
Member Author

Closing in favor of #6997, which includes scroll-into-view only when not fully visible (sidebar-scroll-into-view.ts), asset metadata errors in the canvas, and the InitialCompositionLoader URL/sync changes from this PR (merged in 368f189).

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