-
Notifications
You must be signed in to change notification settings - Fork 54
Studio: Add missing tooltip labels to buttons #648
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
Conversation
katinthehatsite
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me and they worked as expected.
One thing is that I am not sure whether we should also add a tooltip for toggling the sidebar? What do you think?
Another small thing that I noticed is that when the site is starting (e.g. the green indicator is blinking), the tooltip still says Start site. Should we remove when this process is happening or display "Starting" instead?
|
In addition to the sidebar toggle mentioned by Kat, I would propose to add a few more:
Also, do you think we should add tooltips for items that are already somehow descriptive e.g. tabs, buttons like 'Add site' or 'Export entire site' etc.? |
|
Thank you for your review and feedback, @katinthehatsite and @wojtekn! 🙂
Good point! I have added tooltip there as well.
Nice catch! I have added
Done:
Done:
Are you referring to the following If so, do you have any suggestions of the specific tooltip we could use? All the ideas coming to my mind do not seem right there - since the button already has the I would personally leave this button as-is for now - unless we come up with some specific tooltip text that fits there well. 🤔
I would prefer if we keep the buttons that are descriptive enough without a tooltip. I think adding extra tooltips could make the interface too cluttered. But I am happy to discuss further. |
Currently, it says Log in, but it opens Settings window that let users log in. What if we added a tooltip for this one saying, 'Open settings' or 'Open settings to log in'?
Sounds fair, let's leave those as is for now. |
wojtekn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general looks good, I spot one issue related to double labels.
src/components/header.tsx
Outdated
| disabled={ ! site.running } | ||
| className="[&.is-link]:text-a8c-gray-70 [&.is-link]:hover:text-a8c-blueberry !px-0 h-0 leading-4" | ||
| onClick={ () => getIpcApi().openSiteURL( site.id, '', { autoLogin: false } ) } | ||
| label={ sprintf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great catch, Wojtek! Thanks.
Turns out the issue is present there with existing buttons as well, e.g. More options or Close:
The root cause is in the way the Button, DropdownMenu and WPModal components (defined in @wordpress/components) are built: As soon as the label property is passed to them (which is used to trigger the Tooltip), these components add aria-label automatically as well. Because of that, VoiceOver reads both labels instead of just one.
I have tried a couple different solutions how to address this issue. The one that seems to be the cleanest is to rely on our custom Tooltip component instead. In that case we wouldn't rely on label prop which will prevent duplicate announcements in VoiceOver and other assistive technology apps.
I have applied the changes in the latest commit (333b600) so you can take a closer look.
However, further workarounds would be needed to address similar existing issue with the DropdownMenu and WPModal components that handle More options and Close buttons.
Other option could be to leave things as they are for now and accept the duplication and the way the WordPress components are built.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting that I have made a couple more changes to the branch in the meantime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for explaining the root case. I think we can leave the rest of components as is for now.
|
Perfect! Thank you for catching that Wojtek and Kat! I have addressed the issue in 1fcd845. Now when the site URL is not available, the tooltips will have the following texts: |
katinthehatsite
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice the changes look good to me now, thanks for moving the logic for the URL to a separate constant. It makes it much easier to read 👍
Nice work!!
|
@ivan-ottinger, It seems that after we Start and Stop the site, those two links still show the URL in the tooltip. Could we remove tooltip for those two when site is stopped, so it would be consistent with thumbnail behavior? We will ultimately fix it when we implement https://github.com/Automattic/dotcom-forge/issues/9139/ |
Thank you, Kat!
Sounds good! I have applied the change in dbf2937. I have also kept the fallback tooltips there in case the |
|
@ivan-ottinger I gave it a final test, and the labels look good now. However, I noticed the glitch with the help icon label:
Screen.Capture.on.2024-11-14.at.10-47-30.mp4 |
Thanks for catching that, Wojtek. I did not run into the same issue in my tests before but can definitely reproduce it now after resizing the app window. Our custom In our 1:1 we were discussing the possibility of scaling down the scope of this PR and not adding the tooltip to buttons where there's some issue. Other option could be to add the tooltip to → I have made the change in the last commit (3114ccd) if you would like to try it out. It does not look that fancy as our custom tooltip (or the other tooltip component included in WordPress), but it is more compatible and works well with accessibility tools. I would be even willing to replace all tooltips we have with the Regardless, we can also remove tooltips from Do you have any preference here? 🤔 |
|
@ivan-ottinger thanks for exploring it more. I think it would be better to skip the problematic tooltip at this point instead of having two different types of tooltip. I noticed one more case. Should we delete those for now, too?
|
Thanks, Wojtek. Sounds good to me. 👍🏼 I have removed the tooltips that were causing issues and updated the PR description accordingly. |
|
Just noting that I have created a separate task to add the remaining tooltips: https://github.com/Automattic/dotcom-forge/issues/9841. |













Fixes https://github.com/Automattic/dotcom-forge/issues/6623.
Proposed Changes
Open settings,Start site,Starting&Stop site, "site screenshot" and "copy to clipboard" buttonsAccount→Open settings;Profile link→Edit profile&Help→Get helpTesting Instructions
Pre-merge Checklist