Skip to content

Studio: Add "Copy context for agents" to folder menus - #11277

Merged
JonnyBurger merged 3 commits into
remotion-dev:mainfrom
sjkim1127:fix/folder-copy-agent-context
Sep 14, 2026
Merged

JonnyBurger merged 3 commits into
remotion-dev:mainfrom
sjkim1127:fix/folder-copy-agent-context

Conversation

@sjkim1127

Copy link
Copy Markdown
Contributor

Summary

Adds "Copy context for agents" to the context menu for <Folder> entries in Remotion Studio.

The implementation follows the existing composition behavior and reuses formatContextForAgents() so folders produce the same context format, for example:

Nested in src/Root.tsx:10

Fixes #11263

Changes

  • Add a Copy context for agents action to folder context menus.
  • Use the existing folder ID as the context name, including the parent path for nested folders.
  • Reuse the existing formatContextForAgents() helper for consistency with compositions and timeline items.
  • Keep the copy action available in read-only Studio, consistent with other non-mutating copy actions.
  • Extend the existing folder menu test to cover the new action.

Testing

Updated packages/studio/src/test/folder-menu-items.test.ts to verify that the new copy-context-for-agents action is available for folders.

I was not able to run the full test suite in my current environment because the repository could not be checked out due to network restrictions.

Documentation

No documentation changes were added because this only fills in a missing Studio context-menu action and does not introduce a new public API or user-facing configuration option.

The behavior follows the already existing Copy context for agents action for compositions.

Tradeoffs

This adds another item to the folder context menu, making it slightly longer.

Rather than introducing folder-specific formatting, the implementation deliberately reuses formatContextForAgents() and the existing folder ID. This keeps the generated context consistent with other Studio elements and avoids maintaining a separate formatting path.

@vercel

vercel Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
bugs Building Building Preview Sep 14, 2026 1:42am UTC
remotion Ready Ready Preview Sep 14, 2026 1:42am UTC

Request Review

@sjkim1127 sjkim1127 changed the title Fix/folder copy agent context Studio: Add "Copy context for agents" to folder menus Sep 14, 2026

@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

  • Add Copy context for agents to folder menus — getFolderMenuItems() now builds the agent context via the existing formatContextForAgents() helper with name: folderId (so nested folders yield Parent/Nested) and inserts the item ahead of Copy file location.
  • Mirror the composition action — the new item matches composition-menu-items.ts exactly (label, null quickSwitcherLabel, disabled: !contextForAgents, clipboard error notification, enabled in read-only Studio).
  • Extend the folder menu test — mocks navigator.clipboard.writeText, restores the navigator descriptor in afterEach, and asserts the exact copied string for a nested folder.

I verified the test locally (bun test src/test/folder-menu-items.test.ts → 1 pass) and confirmed that no other suite or E2E selector depends on the folder menu's item set. The onClick shape and assertion style match the existing sequence-context-menu-items test.

Pullfrog  | View workflow run | Using DeepSeek Flash | 𝕏

@JonnyBurger
JonnyBurger merged commit 4dad229 into remotion-dev:main Sep 14, 2026
33 of 35 checks passed
@sjkim1127
sjkim1127 deleted the fix/folder-copy-agent-context branch September 14, 2026 09:56

This branch was successfully deployed

2 active deployments
Preview – remotion — 828d24c5 Deployed Sep 14, 2026 by vercel[bot]
Preview – bugs — 828d24c5 Deployed Sep 14, 2026 by vercel[bot]
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.

Studio: "Copy context for agents" for <Folder>

2 participants