Skip to content

@remotion/studio: Scroll to composition or asset when selected but out of view#6997

Merged
JonnyBurger merged 2 commits intomainfrom
studio-sidebar-asset-preview
Apr 4, 2026
Merged

@remotion/studio: Scroll to composition or asset when selected but out of view#6997
JonnyBurger merged 2 commits intomainfrom
studio-sidebar-asset-preview

Conversation

@JonnyBurger
Copy link
Copy Markdown
Member

@JonnyBurger JonnyBurger commented Apr 4, 2026

Summary

Supersedes #6995 (closed).

Sidebar

  • Scroll the selected asset or composition into view only when the row is not already fully visible (scrollSidebarRowIntoViewIfNeeded in sidebar-scroll-into-view.ts).
  • Skip redundant scroll when the user just clicked the row (mark*SidebarScrollFromRowClick).
  • InitialCompositionLoader: useSelectAsset wrapped in useCallback; deep-linked asset loads use selectAsset so folders expand and sidebar selection stays in sync (from @remotion/studio: Scroll selected asset and composition into view in sidebar #6995).

Asset preview

  • When getVideoMetadata() fails (e.g. unsupported codec such as ProRes in the browser), return metadata-error from getAssetMetadata() instead of rejecting, so the global fullscreen error overlay is not triggered.
  • Show the error in the preview canvas with ErrorLoader and optional Retry (refetch metadata).

Related

@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 5:08pm
remotion Ready Ready Preview, Comment Apr 4, 2026 5:08pm

Request Review

@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog bot commented Apr 4, 2026

Reviewed PR #6997 — no actionable issues found. Approved with a summary comment.

Task list (8/8 completed)
  • Read and understand the full diff
  • Review sidebar-scroll-into-view.ts (new file, core logic)
  • Review AssetSelectorItem.tsx and CompositionSelectorItem.tsx changes
  • Review get-asset-metadata.ts error handling changes
  • Review Preview.tsx and Canvas.tsx changes
  • Review InitialCompositionLoader.tsx useCallback refactor
  • Check for stale references or impact issues
  • Draft and submit review

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

@JonnyBurger JonnyBurger changed the title @remotion/studio: Sidebar scroll-into-view; asset metadata errors in canvas only @remotion/studio: Scroll to composition or asset when selected but out of view Apr 4, 2026
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 PR. The scroll-into-view logic with one-shot skip flags is a nice pattern for avoiding redundant scrolls on click. The metadata-error variant in getAssetMetadata gracefully prevents the global error overlay for unsupported codecs, and the useCallback fix in useSelectAsset addresses a real referential instability. No issues found.

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

@JonnyBurger JonnyBurger merged commit 6443ba2 into main Apr 4, 2026
19 checks passed
@JonnyBurger JonnyBurger deleted the studio-sidebar-asset-preview branch April 4, 2026 18:57
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