Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Remove "Copy Styles" from dropdown menu #55611

Closed
t-hamano opened this issue Oct 25, 2023 · 6 comments
Closed

Proposal: Remove "Copy Styles" from dropdown menu #55611

t-hamano opened this issue Oct 25, 2023 · 6 comments
Labels
[Package] Block editor /packages/block-editor [Type] Enhancement A suggestion for improvement.

Comments

@t-hamano
Copy link
Contributor

What problem does this address?

The "Copy Styles" menu shown in the dropdown menu is internally copying blocks. Therefore, "Copy" and "Copy Styles" have exactly the same behavior.

What is your proposed solution?

When copying, there is no need to be aware of whether you are copying the block itself or just the style.; I think it is something that should be determined when pasting.

copy-styles

@afercia
Copy link
Contributor

afercia commented Dec 20, 2023

Interesting, thanks @t-hamano
However, I'm not sure how it would be possible to communicate that they can copy (and paste) the styles. IMHO, the user interface must expose the functionality in some way otherwise it would be hardly discoverable.

@t-hamano
Copy link
Contributor Author

I once again looked into how the style copy and paste function was added.

Initially, only "Paste Styles" was implemented in #45477. After that, "Copy Styles" menu was added in #47430. This PR also mentions that "Copy Styless" and "Copy Block" have the same function.

Then it might be a good idea to improve the message as suggested by #57254.

@bacoords
Copy link
Contributor

bacoords commented Feb 2, 2024

However, I'm not sure how it would be possible to communicate that they can copy (and paste) the styles. IMHO, the user interface must expose the functionality in some way otherwise it would be hardly discoverable.

I think if the dropdown had

  • Copy
  • Paste
  • Paste Styles

that would be pretty clear/discoverable. It's a pretty standard pattern.

I just want to say that I support this original idea of cleaning up the dropdown menu. It's a pretty standard convention in tools to also allow you to copy/paste styles using the same commands:

  • cmd + c Copy
  • cmd + v Paste
  • cmd + shift + v Paste styles/attributes (I couldn't find an issue/PR this, but thought I had seen one f)

Currently the situation is a bit weird because "Copy" and "Copy Styles" are identical but if you use cmd + c to copy, it doesn't work with "Paste Styles", only "Paste". In any case would love to see this cleared up!

@t-hamano
Copy link
Contributor Author

t-hamano commented Feb 3, 2024

However, I'm not sure how it would be possible to communicate that they can copy (and paste) the styles.

I looked into this issue again and am wondering if it is necessary to be able to copy only block styles in the first place, and whether it is necessary to explicitly inform the user of this.

For example, in Google Sheets, there is only Copy, and when you Paste, you can choose whether to paste the values or just the format.

spreadsheet-right-click-menu

I think if the dropdown had

  • Copy
  • Paste
  • Paste Styles

That's why I think the dropdown menu above makes the most sense.

I would expect to see a menu like the one below.

If block data exists on the clipboard If there is no block data on the clipboard
image image

@bacoords
Copy link
Contributor

bacoords commented Feb 3, 2024

Agreed! With two caveats

  • the keyboard shortcut for "Copy" doesn't seem to copy full HTML of the block with the comment tag and attributes (to test, copy a block with your keyboard then try to "Paste Styles")
  • the keyboard shortcut for "Paste Styles" doesn't exist yet

Not sure if that's worth opening a separate issue but I agree with @t-hamano above about what the menu should ideally look like.

@t-hamano
Copy link
Contributor Author

t-hamano commented Feb 4, 2024

I submitted #58650 to discuss the bigger picture on this issue.

I would like to close this issue, but I would like to hear your feedback on #58650.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Block editor /packages/block-editor [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants