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

Block inserter toggle: avoid dynamic label #68536

Open
2 of 6 tasks
afercia opened this issue Jan 7, 2025 · 4 comments · May be fixed by #68539
Open
2 of 6 tasks

Block inserter toggle: avoid dynamic label #68536

afercia opened this issue Jan 7, 2025 · 4 comments · May be fixed by #68539
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Edit Widgets /packages/edit-widgets [Package] Editor /packages/editor [Type] Bug An existing feature does not function as intended

Comments

@afercia
Copy link
Contributor

afercia commented Jan 7, 2025

Description

Discovered while working on #68531

When the Show button text labels is enabled, the label of the block inserter toggle in the top bar is shortened from Block Inserter to Add.
However, when opening the block inserter, the label dynamically changes from Add to Close. Screenshots:

Image

While I do understand the intent to provide a visual indication, control labels should not be used for mere visual purposes. Their purpose is to unambiguously communicate what a control does or is about and should not change dynamically.

The pressed state of the button is already communicated by a color inversion and an appropriate aria-pressed attribute set on the button (although the usage of aria-pressed is slightly incorrect in this case). The button also uses an aria-expanded attribute. Semantically, there's no need to add anything else and the label should not change. I'd argue that also visually the label should not change.

Additionally, when Show button text labels is disabled, the label of the button is Block Inserter which is way too technical for users. Should a good UI communicate obscure technical terminology or rather provide users with a simple, understandable, label? I'd vote for the latter and use Add also when the preference is disabled.

Note:
in #68531 I'm implementing this 'dynamic' label in the Widgets editor only to not introduce a new inconsistency across the editors. If #68531 gets merged, this issue should be addressed also in the Widgets editor.

Step-by-step reproduction instructions

  • Go to the post or site editor.
  • Hover of focus the block inserter button.
  • Observe the tooltip text, which is also the label of the button, is Block Inserter.
  • Enable the preference Show button text labels from the top bar Options > Preferences > Accessibility.
  • Observe the button text is now Add.
  • Open the inserter.
    • Observe the button text is now Close.

Screenshots, screen recording, code snippet

No response

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@afercia afercia added [Feature] Inserter The main way to insert blocks using the + button in the editing interface [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Edit Widgets /packages/edit-widgets [Package] Editor /packages/editor [Type] Bug An existing feature does not function as intended labels Jan 7, 2025
@Mamaduka
Copy link
Member

Mamaduka commented Jan 8, 2025

I think that the label "Add" lacks context. What are we adding?

@afercia, why do you think "Block Inserter" is too technical for users? As much as I would like labels to be 100% intuitive and non-technical, I don't think it can be entirely avoided. You'll have to learn a few new terms with every software program.

@afercia
Copy link
Contributor Author

afercia commented Jan 8, 2025

@Mamaduka well, first of all in the main inserter is now possible to add Blocks, Patterns, and Media.
As such, 'Block inserter' feels obsolete and not accurate because it's not just about 'blocks'.

'Inserter' is way too technical for my taste and also difficult to translate. For example, in Italian it is translated to:

Pannello di inserimento dei blocchi

Image

Literally: Panel of insertion of the blocks, which is too long and noisy. It sill refers to 'blocks'. We can't blame translators for such a non-ideal translation. The original string isn't ideal in the first place. I'd be curious to check how it is translated in other languages. I guess it's non-ideal for many other languages as well, which would prove ths original name has a problem in the first place.

If Add isn't ideal, then why we would want to use it only for the case when Show button text labels is enabled? If there's agreement that it's not ideal, it should never be used.

The button icon is a plus. It hints to the concept of 'adding', so tha tI would think that's the concept that should be communicated: 'Add stuff', whether it's a block, pattern, media, or anything else.

Note: some previous considerations to take into account were also reported at #61483

@Mamaduka
Copy link
Member

Mamaduka commented Jan 8, 2025

first of all in the main inserter is now possible to add Blocks, Patterns, and Media.
As such, 'Block inserter' feels obsolete and not accurate because it's not just about 'blocks'.

Everything is a block at the end. Patterns and Media are just "sub-categories"; they are inserted as block(s) at the end.

I'd be curious to check how it is translated in other languages.

The old "toggle" version has the following translation in Georgian - ბლოკის ჩასმის ჩართვა. I'm pretty sure the localization team will use ბლოკის ჩასმა for the current label, which translates into "Add block". Georgian doesn't have a lot of modern words and has to get by what we have 😄

If Add isn't ideal, then why we would want to use it only for the case when Show button text labels is enabled? If there's agreement that it's not ideal, it should never be used

I didn't say that the current text version is ideal. Let's find a version of a label that works for both cases.

@afercia
Copy link
Contributor Author

afercia commented Jan 8, 2025

I'm all for finding a new name of the feature that is simpler and more understandable :)
My point about the translations is that they prove the English name isn't ideal in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Edit Widgets /packages/edit-widgets [Package] Editor /packages/editor [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants