Skip to content

feat(editor): copy and paste all selected fields - #3390

Open
ephraimduncan wants to merge 7 commits into
fix/editor-field-copy-pastefrom
feat/editor-multi-field-copy
Open

ephraimduncan wants to merge 7 commits into
fix/editor-field-copy-pastefrom
feat/editor-multi-field-copy

Conversation

@ephraimduncan

@ephraimduncan ephraimduncan commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

Ctrl+C (Cmd+C on macOS) copies all the selected fields. Before this change, the shortcut copied a field only when one field was selected. For example, when the author uses a drag selection on a Signature field and a Name field, Ctrl+C shows "Copied 2 fields". Then Ctrl+V adds a copy of the two fields.

The editor keeps one selection for all pages. Before this change, each page kept its own selection. Fields on page 1 could stay selected, with their floating toolbar, after the author selected fields on page 2. With this change, a selection on one page clears the selection on the other pages. As a result, Ctrl+C copies only the fields that the author selected last.

Related Issue

Related: documenso/backlog-internal#840

Changes Made

  • useEditorFormArray keeps the ids of all selected items. useEditorFields adds selectedFields and setSelectedFields, and selectedField is set only when one field is selected.
  • The page renderer sends its full canvas selection to the editor. useEnvelopeCanvasSelection adds release(), which clears the selection of a page without a call to onChange. A page uses it when the editor selection moves to a different page.
  • Ctrl+C copies all the selected fields, and Ctrl+V pastes a copy of each field
  • The editor clears a selection that belongs to a different envelope item when the author opens another item
  • Browser tests for copy and paste of two selected fields in the document editor, the template editor, the embedded create editor and the embedded edit editor
  • One sentence in the user docs about how to duplicate more than one field

Testing Performed

  • The browser tests in packages/app-tests/e2e/envelope-editor-v2/envelope-fields.spec.ts pass in CI.

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 depends on #3389, which adds the copy and paste shortcuts for one field. Merge #3389 before this PR.

Copy and paste applies to fields only. It does not apply to the text, shapes and images of the Contents tab.

Ctrl+C copies all the fields in the selection. Before this change, it
copied a field only when one field was selected.

The editor keeps the ids of the selected fields. When the author selects
fields on one page, the editor clears the selection on the other pages.
@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:20am UTC
2 Skipped Deployments
Project Deployment Actions Updated
prd-docs Ignored Ignored Nov 18, 2026 9:20am UTC
prd-openpage-api Ignored Ignored Nov 18, 2026 9:20am 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: 5290ff43-ef54-4528-8794-0e94b5c1ab93

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
#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.
Before this change, each page kept its own canvas selection. The editor
state held a field only when one field was selected. Fields on page 1
stayed selected after the author selected fields on page 2.

`useEditorFormArray` keeps the ids of all selected items and returns
`selectedItems`. `selectedItem` is set only when one item is selected.
The page renderer sends the full canvas selection to
`editorFields.setSelectedFields`.

When the editor selection moves to a different page, the fields layer
calls `selection.release`. This function clears the canvas selection of
the page and does not call `onChange`, because `onChange` clears the new
selection.
Ctrl+C copies each field in the selection, and Ctrl+V adds a copy of
each field. Before this change, the shortcut copied a field only when
one field was selected.

The toast shows the number of copied fields.
The flow ran on the document editor and the template editor only. It
runs on embedded create and embedded edit also.

The flow makes sure that the toast shows the number of copied fields.

This branch was successfully deployed

1 active deployment
Preview – stg-docs — 98b59fcc 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 type: documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant