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 directory: Some error messages show the Try reloading the page. string twice #69048

Open
2 of 6 tasks
afercia opened this issue Feb 5, 2025 · 1 comment · May be fixed by #69056
Open
2 of 6 tasks

Block directory: Some error messages show the Try reloading the page. string twice #69048

afercia opened this issue Feb 5, 2025 · 1 comment · May be fixed by #69056
Assignees
Labels
[Feature] Block Directory Related to the Block Directory, a repository of block plugins [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 Feb 5, 2025

Description

When installing a block from the block directory, some error messages display the string Try reloading the page. twice.

It appears that for errors with type fatal, a string Try reloading the page. is appended to the error message. The initial string may already contain the sentence Try reloading the page. though.

Image

Repetita iuvant. but sometimes it's just too much repetition.

I would say that either the 'fatal' error message should not contain the string Try reloading the page. or the one that gets appended should not be appended

Though these errors an edge case, the main purpose of error messages is to provide users with clear, not confusing, feedback. Showing repeated sentences doesnt help clarity and makes the UI feel unpolished.

Screenshots of some error messages:

Image

Step-by-step reproduction instructions

Not sure how to provide instructions other than altering the code to trigger some errors.
The string concatenation in the code is pretty clear though.

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] Block Directory Related to the Block Directory, a repository of block plugins [Type] Bug An existing feature does not function as intended labels Feb 5, 2025
@afercia afercia changed the title Block directory: Some error messages show the Try reloading the page. striint twice Block directory: Some error messages show the Try reloading the page. string twice Feb 5, 2025
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Feb 5, 2025
@Mukulsingh27
Copy link

Mukulsingh27 commented Feb 5, 2025

Thanks, @afercia
I was successfully able to reproduce the issue

Image

Here are some approaches.

  1. In action.js, the message Try reloading the page. is used/present with most error messages( like at line no. 131 and line no. 156 ). If we change this here, we might need to manually add the change in multiple places, similar to what we did in the downloadable-block-notice.

  2. It may be better to remove the extra appended string from the downloadable-block-notice to maintain consistency throughout the application.
    So we might need to remove this from packages/block-directory/src/components/downloadable-block-notice/index.js

{ errorNotice.isFatal
	? ' ' + __( 'Try reloading the page.' )
	: null }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block Directory Related to the Block Directory, a repository of block plugins [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
2 participants