Skip to content

@remotion/studio: Preselect filename stem in rename dialog#8327

Merged
JonnyBurger merged 2 commits into
remotion-dev:mainfrom
Aditya07771:fix/8318-rename-dialog-preselect
Jun 12, 2026
Merged

@remotion/studio: Preselect filename stem in rename dialog#8327
JonnyBurger merged 2 commits into
remotion-dev:mainfrom
Aditya07771:fix/8318-rename-dialog-preselect

Conversation

@Aditya07771

Copy link
Copy Markdown
Contributor

What does this fix?

Fixes #8318

The rename dialog does not pre-select the filename correctly when it opens. The user has to manually position the cursor before editing.

What did I change?

  • RenameStaticFile: on mount, call setSelectionRange(0, stemEnd) where stemEnd is the index of the last dot (or the full length if there is no dot). This selects my-video and leaves .mp4 unselected.
  • RenameFolder / RenameComposition: call input.select() on mount since folder names and composition IDs carry no extension.

How to verify

  1. Right-click any asset in Remotion Studio → Rename.
  2. The dialog opens with my-video highlighted (not my-video.mp4).
  3. Start typing to replace only the stem.
  4. .mp4 is preserved unchanged.

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Jun 12, 2026 6:55am
remotion Ready Ready Preview, Comment Jun 12, 2026 6:55am

Request Review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes — this PR preselects the filename stem (or full input text) in Studio rename dialogs so users can immediately type to replace it, fixing #8318.

  • RenameStaticFile.tsx — on mount, selects the filename stem via setSelectionRange(0, stemEnd), leaving the extension (e.g., .mp4) unselected.
  • RenameComposition.tsx — on mount, selects all text via input.select() since composition IDs carry no extension.
  • RenameFolder.tsx — same input.select() treatment as composition rename, since folder names have no extension.

RemotionInput forwards its ref to an underlying <input> element (RemInput.tsx:119), so the DOM selection APIs work correctly.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@JonnyBurger JonnyBurger changed the title fix(studio): preselect filename stem in rename dialog @remotion/studio: Preselect filename stem in rename dialog Jun 12, 2026
@JonnyBurger JonnyBurger merged commit a03d286 into remotion-dev:main Jun 12, 2026
17 checks passed
@JonnyBurger

Copy link
Copy Markdown
Member

Thank you!

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.

Asset rename dialog should pre-select part before dot

2 participants