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

Differentiate 'Copy' and 'Copy styles' snackbar confirmation messages #57254

Closed
afercia opened this issue Dec 20, 2023 · 6 comments · Fixed by #68167
Closed

Differentiate 'Copy' and 'Copy styles' snackbar confirmation messages #57254

afercia opened this issue Dec 20, 2023 · 6 comments · Fixed by #68167
Labels
[Package] Block editor /packages/block-editor [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@afercia
Copy link
Contributor

afercia commented Dec 20, 2023

Description

When copying a block and when copying a block styles, a snackbar notice appears with a confirmation message. The confirmation message text is the same in both cases:

`Copied {block name} to clipboard'

when copying styles of multiple blocks:

'Copied {n} blocks to clipboard'

For better clarity and better user experience, the copy styles operation should use its own confirmation message, something along the lines of:

`Copied block styles to clipboard' and 'Copied {n} blocks styles to clipboard'

Step-by-step reproduction instructions

  • Go to the post editor and select a paragraph.
  • From the block toolbar > Options dropdown menu, click 'Copy' and then click 'Copy styles'.
  • Observe two snackbar notices appear with the same text.

Screenshots, screen recording, code snippet

Snackbars notices with the same text after 'Copy' and then click 'Copy styles':

copy block styles

Copy styles with multiple block selected:

copy styles multiple

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@afercia afercia added [Type] Bug An existing feature does not function as intended [Package] Block editor /packages/block-editor labels Dec 20, 2023
@t-hamano
Copy link
Contributor

t-hamano commented Dec 20, 2023

Actually, copying styles is internally the same as copying the block itself 😅 Therefore, I proposed in #55611 to remove the "Copy Styles" action itself.

@richtabor
Copy link
Member

Actually, copying styles is internally the same as copying the block itself 😅 Therefore, I proposed in #55611 to remove the "Copy Styles" action itself.

If we remove copy styles from the menu, no one will know it's possible.

@richtabor
Copy link
Member

For better clarity and better user experience, the copy stiles operation should use its own confirmation message, something along the lines of:

`Copied block styles to clipboard' and 'Copied {n} blocks styles to clipboard'

You can't actually copy styles of more than one block. It's limited to one at a time.

CleanShot 2024-02-05 at 11 05 02

@richtabor
Copy link
Member

For better clarity and better user experience, the copy stiles operation should use its own confirmation message, something along the lines of:

I think it'll be nice having a more relevant message, even simpler and more direct: "Styles copied to clipboard."

@afercia
Copy link
Contributor Author

afercia commented Jan 8, 2025

You can't actually copy styles of more than one block. It's limited to one at a time.

Looking back into this, the 'Copy styles' button is available also when two or more blocks are selected. Screenshot with two paragraph selected anc the button available:

Image

As @t-hamano pointed out, internally it works like the normal 'Copy' so with multiple blocks selected, it will copy all the selected blocks markup. To my understanding, it's the paste operation that (of course) will paste the styles of only one of the copied blocks. As far as I can tell, it will paste the styles of the first selected block.

Since the paste operation is limited to one block style, I wonder whether the 'Copy styles' should be hidden when there is a multiple selection. As it is now, it's pretty confusing.

I will create a separate issue.

@richtabor
Copy link
Member

richtabor commented Jan 11, 2025

Looking back into this, the 'Copy styles' button is available also when two or more blocks are selected.

You can't copy styles of more than one block though. It results in unexpected style application.

I think it's fine to not have copy styles with multiple blocks selected. But how big of a deal is this?

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 [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants