Skip to content

fix(editor): add copy and paste shortcuts for fields - #3389

Open
ephraimduncan wants to merge 5 commits into
mainfrom
fix/editor-field-copy-paste
Open

ephraimduncan wants to merge 5 commits into
mainfrom
fix/editor-field-copy-paste

Conversation

@ephraimduncan

@ephraimduncan ephraimduncan commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

In the document and template editors, Ctrl+C and Ctrl+V did nothing when a field was selected. The documentation says that these shortcuts copy and paste a field. The legacy editor had the shortcuts, but the envelope editor did not.

With this change, Ctrl+C (Cmd+C on macOS) copies the selected field and shows a "Copied field" toast. Ctrl+V (Cmd+V) adds a copy of the field on the same page, a small distance down and to the right. Each paste starts from the last copy, so repeated pastes make a diagonal row and do not stack on one position.

The shortcuts do not operate when the focus is in a text input or when the user has selected text on the page. In these cases, the browser copy and paste operate as before.

Related Issue

Related: documenso/backlog-internal#840

Changes Made

  • Ctrl+C and Cmd+C copy the selected field in EnvelopeEditorFieldsPage
  • Ctrl+V and Cmd+V paste the copied field with the existing duplicateField operation
  • Browser tests for copy and paste in the document editor and the template editor

Testing Performed

  • Browser tests in packages/app-tests/e2e/envelope-editor-v2/envelope-fields.spec.ts for copy and paste in the document editor and the template editor
  • Manual checks in Chromium with the Ctrl and Cmd shortcuts, with the focus in a text input, and after a page reload

Checklist

  • I have tested these changes locally and they work as expected.
  • I have added/updated tests that prove the effectiveness of these changes.
  • I have updated the documentation to reflect these changes, if applicable.
  • I have followed the project's coding style guidelines.
  • I have addressed the code review feedback from the previous submission, if applicable.

Additional Notes

This PR copies one selected field at a time. The follow-up PR #3390 adds copy and paste for more than one selected field. Merge this PR before #3390.

The envelope editor had no handler for Ctrl+C and Ctrl+V. As a result,
the documented shortcuts did nothing in the document and template editors.
@vercel

vercel Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
stg-docs Ready Ready Preview Nov 18, 2026 9:13am UTC
2 Skipped Deployments
Project Deployment Actions Updated
prd-docs Ignored Ignored Nov 18, 2026 9:13am UTC
prd-openpage-api Ignored Ignored Nov 18, 2026 9:13am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 1

  • coderabbit

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 4bf6ad6c-9d2b-4504-986f-5e78cf654b82

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added apps: web Issues related to the webapp 🚨 e2e changes 🚨 Be advised: PR changes E2E tests - Auto-Generated by GitHub Actions on raising a PR labels Sep 24, 2026
# Conflicts:
#	apps/remix/app/components/general/envelope-editor/envelope-editor-fields-page.tsx
Each paste moves the copy by one offset from the last copy. After many pastes, the position was more than 100 and the server rejected the save. `duplicateField` stops the copy at the page edge, the same as `duplicateContent`.
The contents tab hides the fields. A paste on that tab, or while a different envelope item was open, added a field that the author could not see.
The flow ran on the document editor and the template editor only. It runs on embedded create and embedded edit also.
ephraimduncan added a commit that referenced this pull request Nov 18, 2026
#3395 moved the canvas selection out of the page renderer and into
`useEnvelopeCanvasSelection` and `useEditorFormArray`. The selection
changes of this branch applied to code that #3395 removed.

This merge keeps the page renderer and `useEditorFields` of branch main,
and keeps the shortcuts for one field from #3389. The next commit adds
the copy of all selected fields to the new canvas hooks.

This branch was successfully deployed

1 active deployment
Preview – stg-docs — b7590f3d Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apps: web Issues related to the webapp 🚨 e2e changes 🚨 Be advised: PR changes E2E tests - Auto-Generated by GitHub Actions on raising a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant