Skip to content

Conversation

@warrenbuckley
Copy link
Contributor

@warrenbuckley warrenbuckley commented Nov 6, 2025

Prerequisites

  • I have added steps to test this contribution in the description below

If there's an existing issue for this PR then this fixes #20597

Description

This adds back a clear all clipboard items that we had previously in Umbraco 13
For steps on how to test:

  • Copy items such as blocks to the clipboard
  • Open the clipboard to paste new items in
  • See the Clear Clipboard button top right of the uui-box header actions slot

Video demo

Pr-Adding-Clear-Clipboard_ENCODED.mp4

Notes

I have left some comments/notes in the code as I was not 100% certain on the approach.
Happy to get feedback and improve as needed.

Cheers,
Warren 😄

* Adds uui-box from outer components consuimg this into this component
* Adds a header to uui-box
* Adds a conditional uui-button when we have items in clipboard
* Adds confirm dialog/prompt to ask if user wants to clear all items
Copilot AI review requested due to automatic review settings November 6, 2025 14:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a "Clear Clipboard" button to the clipboard entry picker component, allowing users to delete all clipboard items at once. The changes improve the user experience by providing a convenient way to clear the entire clipboard with a single action.

Key changes:

  • Added a "Clear Clipboard" button with confirmation modal in the clipboard entry picker
  • Moved the uui-box wrapper from parent components into the picker element itself for consistent UI
  • Added localization keys for the clear clipboard feature

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
clipboard-entry-picker.element.ts Added clear clipboard functionality with confirmation modal, imported necessary dependencies, and integrated uui-box wrapper with header actions
clipboard-entry-picker-modal.element.ts Removed redundant uui-box wrapper since it's now handled within the picker element
block-catalogue-modal.element.ts Removed redundant uui-box wrapper since it's now handled within the picker element
en.ts Added localization keys for "Clipboard" and "confirmClearDescription"

@warrenbuckley
Copy link
Contributor Author

Will fix up some of these suggestions from Copilot - but will leave some of the comments behind so we can discuss to ensure solved with the right approach.

Make sure the promise for the modal is caught and we return out early if user explictiy cancels modal or presses ESC
@warrenbuckley
Copy link
Contributor Author

warrenbuckley commented Nov 6, 2025

From what I can tell the E2E PlayWright test failing is not related to the changes I made, but I may be wrong ?!
An update to this PR to merge the upstream has seemed to fix it

@warrenbuckley
Copy link
Contributor Author

Any chance this could make it for a 17.0.0 release @iOvergaard or is this potentially too late?

@iOvergaard
Copy link
Contributor

@warrenbuckley unfortunately too late for 17.0 as that is already a Release Candidate.

As for your TODO, I think it's fine to re-request the items. Would you clean up the PR a bit, then we can get it in, please?

@iOvergaard iOvergaard enabled auto-merge (squash) November 11, 2025 11:14
@iOvergaard iOvergaard merged commit 9ad4a7e into umbraco:main Nov 11, 2025
28 checks passed
@warrenbuckley warrenbuckley deleted the fix/clear-all-clipboard-items branch November 11, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to clear out all clipboard items from clipboard history

2 participants