Skip to content

Conversation

@bohdansolovie
Copy link
Contributor

Summary

Fixes missing copy and delete buttons for blocks in the richtext editor.

Description

Blocks inserted in the richtext editor were missing the copy to clipboard and delete buttons that are available in other block editors (like block-list). This PR restores this functionality by:

  • Adding copy to clipboard functionality
  • Adding delete button
  • Following the same pattern used in block-list-entry for consistency

Testing

  • Insert a block in the richtext editor
  • Verify copy and delete buttons appear in the action bar
  • Test copying a block to clipboard
  • Test deleting a block

Fixes #21345

…r blocks

- Add copy to clipboard functionality for blocks in richtext editor
- Add delete button for blocks in richtext editor
- Implement clipboard copy method following block-list pattern
- Update action bar to include copy and delete actions

Fixes umbraco#21345
@github-actions
Copy link

Hi there @bohdansolovie, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

- Extract context retrieval into separate method
- Extract entry name building into separate method
- Extract property value building into separate method
- Replace complex conditional with individual checks
- Reduces cyclomatic complexity from 12 to ~4
- Simplify type annotation for buildEntryName parameter
- Use interface-based types instead of complex type inference
- Fixes TypeScript compilation errors
- Update type annotation to match actual return types
- getName() and getLabel() return string | undefined, not string
- Fixes TypeScript compilation error
@bohdansolovie
Copy link
Contributor Author

Hi, @AndyButland
can you check my updates and let me know what is needed more to update?

Thanks

@leekelleher
Copy link
Member

@bohdansolovie Thank you for your pull request. I have reviewed the code, which does add the copy and delete actions to RTE block items. However it isn't quite feature complete, whilst the copy does add to the clipboard feature, it doesn't handle the pasting of block items back into the RTE itself. Similar with the delete, it does remove the block item from the RTE's blocks data structure, it doesn't clean-up the <umb-rte-block> tags in the markup HTML.

With the copying RTE blocks, I had already been developing this feature, (see PR #21604 for history), which handles the pasting of block items back into the RTE as well as compatibility with pasting between other block editors (Block Grid, Block List).

With the delete block item feature, this is also on my to-do list, I'm aiming to look at during this week.

I'll close off this PR, thank you for your efforts, it's appreciated. 🙏

@leekelleher leekelleher closed this Feb 3, 2026
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.

Block in richtext editor missing copy and delete

2 participants