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

Font Library: Make the delete confirm dialog close immediatly after clicking 'Delete' #58386

Closed
afercia opened this issue Jan 29, 2024 · 2 comments · Fixed by #59036
Closed
Labels
[Feature] Font Library [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Design Needs design efforts. [Type] Bug An existing feature does not function as intended [Type] Feedback Issues that relate purely to feedback on a feature that isn't necessarily actionable

Comments

@afercia
Copy link
Contributor

afercia commented Jan 29, 2024

Description

When deleting an installed fonr and clicking 'Delete' in the confirm dialog, the confirm dialog stays open untile the font is actually deleted and the fonr library is refreshed.

This seems to be less than ideal for a few reasons>

  • As the dialog stays open, users can click 'Delete' ultiple times, especially on a slow internet.
  • By clicking multiple times, a new delete request is triggered, which leads to errors like the one in the screenshot below:

Screenshot 2024-01-29 at 14 03 07

  • Whatever teherror is, for example no internet connection, the confirm dialog stays open and the error notice appears behind the confirm dialog overlay. The actual error message is partially hidden. Depending on the size of the screen in use, the error may even be completely hidden. I'm not sure hiding error messages is a good user experience. Screenshot:

Screenshot 2024-01-29 at 15 10 53

Step-by-step reproduction instructions

  • Go to Site editor > Styles > Typography > Manage fonts.
  • Install a Google font.
  • Go to the Library tab and click the font you installed.
  • Click 'Delete' at the bottom of the modal dialog. A confirm dialog opens.
  • Quickly click 'Delete' multiple times.
  • Observe an error message appears within the Fonts modal dialog, behind the confirm dialog overlay.
  • Observe that after the font is actually deleted, the confirm dialog and the notice with the error messsage disappear.
  • Note: for accessibility, when the confirm dialog closes, focus should be better handled. This is tracked in another issue.
  • Install a new Google font.
  • Go to the Library tab and click the font you installed.
  • In your browser dev tools > Network, set your browseer to 'offline'.
  • Click Delete and then Delete again in the confirm dialog.
  • Observe the confirm dialog stays open.
  • Observe an error message appears within the Fonts modal dialog, behind the confirm dialog overlay.
  • Click Delete again. Observe the confirm dialog stays always open.

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

@afercia afercia added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Feedback Issues that relate purely to feedback on a feature that isn't necessarily actionable [Feature] Font Library labels Jan 29, 2024
@afercia afercia changed the title FOnt Library: Make the delete confirm dialog close immediatly after clicking 'Delete' Font Library: Make the delete confirm dialog close immediatly after clicking 'Delete' Jan 29, 2024
@afercia
Copy link
Contributor Author

afercia commented Jan 29, 2024

In a first moment I was thinking the simplest fix would be to set aria-disabled on the Delete button and noop it after the first click. That would prevent users from clicking more than once but it's not ideal. The confirm dialog would still stay open, fora fraction of second or indefinitely depending on the error type.

Thinking bdtter at this, I think that it's not expected for a confirm dialog to stay open i the first place. The very nature of a confirm dialog is to ask for a Yes or No. Once that answer has been given by the user, the confirm dialog should close immediately. Any other feedback like progress of the pending action, success or error, should be provided in the main UI and certainly not by keeping the confirm dialog open.

@matiasbenedetto
Copy link
Contributor

Any other feedback like progress of the pending action, success or error, should be provided in the main UI and certainly not by keeping the confirm dialog open.

It seems in line with the changes added in #59036

2024-02-23.13-06-32.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Font Library [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Design Needs design efforts. [Type] Bug An existing feature does not function as intended [Type] Feedback Issues that relate purely to feedback on a feature that isn't necessarily actionable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants