[PR #1193] [MERGED] feat: copy and paste fields #1460

Closed
opened 2026-02-26 19:33:21 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1193
Author: @ephraimduncan
Created: 6/22/2024
Status: Merged
Merged: 8/20/2024
Merged by: @Mythie

Base: mainHead: feat/copy-fields


📝 Commits (10+)

  • 464cd64 feat: copy and paste fields
  • 22d513a feat: duplicate fields with cmd + d
  • 57bbff3 fix: set field as last active immediately
  • 68d5cf4 chore: cleanup
  • 074c848 fix: fields conflicts
  • 9b63afb Merge branch 'main' into feat/copy-fields
  • a1d573c Merge branch 'main' into feat/copy-fields
  • 31640ad Merge branch 'main' into feat/copy-fields
  • 2c7cd46 Merge branch 'main' into feat/copy-fields
  • f402351 feat: add duplicate button

📊 Changes

12 files changed (+157 additions, -64 deletions)

View changed files

📝 .vscode/settings.json (+5 -7)
📝 apps/marketing/content/blog/announcing-vial-21-cfr-part-11.mdx (+10 -20)
📝 apps/web/src/app/(signing)/sign/[token]/number-field.tsx (+5 -2)
📝 apps/web/src/app/(signing)/sign/[token]/radio-field.tsx (+9 -9)
📝 apps/web/src/app/(signing)/sign/[token]/signature-field.tsx (+1 -1)
📝 apps/web/src/app/(signing)/sign/[token]/text-field.tsx (+7 -5)
📝 packages/ui/components/field/field.tsx (+1 -1)
📝 packages/ui/primitives/document-flow/add-fields.tsx (+74 -2)
📝 packages/ui/primitives/document-flow/advanced-fields/checkbox.tsx (+2 -2)
📝 packages/ui/primitives/document-flow/advanced-fields/radio.tsx (+1 -1)
📝 packages/ui/primitives/document-flow/field-item.tsx (+38 -11)
📝 packages/ui/primitives/document-flow/single-player-mode-fields.tsx (+4 -3)

📄 Description

Description

Allow users to copy and paste fields using keyboard shortcuts.

CleanShot 2024-06-22 at 15 56 04

Changes Made

  • Implemented the onFieldCopy and onFieldPaste callback functions to handle copy and paste operations.
  • Added event listeners for keyboard shortcuts (Ctrl+C, Ctrl+V, Ctrl+D) to copy, paste, and duplicate fields.

Testing Performed

  • Tested the copy and paste functionality with various field types in different scenarios.
  • Ran unit tests for the add-fields component to ensure no regressions.
  • Manually tested on browsers Chrome, Firefox, and Safari to ensure compatibility.

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.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Implemented copy and paste functionality for form fields.
    • Added keyboard shortcuts for copying (Ctrl+C), pasting (Ctrl+V), and duplicating (Ctrl+D) fields.
    • Introduced a duplicate action for individual field items.
  • Enhancements

    • Improved state management for tracking the last active field in forms.
    • Enhanced user interface with consistent styling and new duplicate buttons for field items.
    • Updated code formatting experience for TypeScript React files with Prettier as the default formatter.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/1193 **Author:** [@ephraimduncan](https://github.com/ephraimduncan) **Created:** 6/22/2024 **Status:** ✅ Merged **Merged:** 8/20/2024 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `main` ← **Head:** `feat/copy-fields` --- ### 📝 Commits (10+) - [`464cd64`](https://github.com/documenso/documenso/commit/464cd646e30837ce02670364bf16b34a8a8aa148) feat: copy and paste fields - [`22d513a`](https://github.com/documenso/documenso/commit/22d513a0d6aeb63d31c6681215b66b5a0fe5cfae) feat: duplicate fields with cmd + d - [`57bbff3`](https://github.com/documenso/documenso/commit/57bbff3b01302b6a14b66a038ad08ed63136cf6e) fix: set field as last active immediately - [`68d5cf4`](https://github.com/documenso/documenso/commit/68d5cf47749dd2e91aa88128b77a683fe78e5fe8) chore: cleanup - [`074c848`](https://github.com/documenso/documenso/commit/074c848360dd0c1df194572664afbe92118f0b8b) fix: fields conflicts - [`9b63afb`](https://github.com/documenso/documenso/commit/9b63afb4aec7ec99e344f542855f80d20dbd5a8e) Merge branch 'main' into feat/copy-fields - [`a1d573c`](https://github.com/documenso/documenso/commit/a1d573c708a45b86bc4fe2b52e44c7a8ee0634f9) Merge branch 'main' into feat/copy-fields - [`31640ad`](https://github.com/documenso/documenso/commit/31640ad2324c407960f014779f5a620b0708f386) Merge branch 'main' into feat/copy-fields - [`2c7cd46`](https://github.com/documenso/documenso/commit/2c7cd46b2ac1222151014bba46ca69c9fbdc42d8) Merge branch 'main' into feat/copy-fields - [`f402351`](https://github.com/documenso/documenso/commit/f40235137e4aa59818a294c12b74a47638d50611) feat: add duplicate button ### 📊 Changes **12 files changed** (+157 additions, -64 deletions) <details> <summary>View changed files</summary> 📝 `.vscode/settings.json` (+5 -7) 📝 `apps/marketing/content/blog/announcing-vial-21-cfr-part-11.mdx` (+10 -20) 📝 `apps/web/src/app/(signing)/sign/[token]/number-field.tsx` (+5 -2) 📝 `apps/web/src/app/(signing)/sign/[token]/radio-field.tsx` (+9 -9) 📝 `apps/web/src/app/(signing)/sign/[token]/signature-field.tsx` (+1 -1) 📝 `apps/web/src/app/(signing)/sign/[token]/text-field.tsx` (+7 -5) 📝 `packages/ui/components/field/field.tsx` (+1 -1) 📝 `packages/ui/primitives/document-flow/add-fields.tsx` (+74 -2) 📝 `packages/ui/primitives/document-flow/advanced-fields/checkbox.tsx` (+2 -2) 📝 `packages/ui/primitives/document-flow/advanced-fields/radio.tsx` (+1 -1) 📝 `packages/ui/primitives/document-flow/field-item.tsx` (+38 -11) 📝 `packages/ui/primitives/document-flow/single-player-mode-fields.tsx` (+4 -3) </details> ### 📄 Description ## Description Allow users to copy and paste fields using keyboard shortcuts. ![CleanShot 2024-06-22 at 15 56 04](https://github.com/documenso/documenso/assets/55143799/83c3e14d-3791-49a7-ad2f-bbceb2ef4d25) ## Changes Made - Implemented the `onFieldCopy` and `onFieldPaste` callback functions to handle copy and paste operations. - Added event listeners for keyboard shortcuts (Ctrl+C, Ctrl+V, Ctrl+D) to copy, paste, and duplicate fields. ## Testing Performed - Tested the copy and paste functionality with various field types in different scenarios. - Ran unit tests for the `add-fields` component to ensure no regressions. - Manually tested on browsers Chrome, Firefox, and Safari to ensure compatibility. ## Checklist - [x] I have tested these changes locally and they work as expected. - [x] I have added/updated tests that prove the effectiveness of these changes. - [x] I have updated the documentation to reflect these changes, if applicable. - [x] I have followed the project's coding style guidelines. - [x] I have addressed the code review feedback from the previous submission, if applicable. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **New Features** - Implemented copy and paste functionality for form fields. - Added keyboard shortcuts for copying (Ctrl+C), pasting (Ctrl+V), and duplicating (Ctrl+D) fields. - Introduced a duplicate action for individual field items. - **Enhancements** - Improved state management for tracking the last active field in forms. - Enhanced user interface with consistent styling and new duplicate buttons for field items. - Updated code formatting experience for TypeScript React files with Prettier as the default formatter. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:33:21 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1460
No description provided.