Skip to content

Conversation

@ivan-ottinger
Copy link
Contributor

@ivan-ottinger ivan-ottinger commented Nov 8, 2024

Fixes https://github.com/Automattic/dotcom-forge/issues/6623.

Proposed Changes

  • add new tooltip labels for the following buttons: Open settings, Start site, Starting & Stop site, "site screenshot" and "copy to clipboard" buttons
  • update aria-label for the following buttons: AccountOpen settings; Profile linkEdit profile & HelpGet help
Start site Stop site
Markup on 2024-11-08 at 16:42:40 Markup on 2024-11-08 at 16:42:11
Open settings Site screenshot
Markup on 2024-11-11 at 16:50:54 Markup on 2024-11-11 at 16:49:31
Toggle sidebar Copy to clipboard
Markup on 2024-11-11 at 16:52:33 Markup on 2024-11-11 at 16:52:04

Testing Instructions

  1. Check out the PR and build the Studio app.
  2. Navigate through the app and hover over the buttons where the tooltip labels have been added.
  3. Tooltip labels should display correctly.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@ivan-ottinger ivan-ottinger self-assigned this Nov 8, 2024
@ivan-ottinger ivan-ottinger requested a review from a team November 8, 2024 16:18
Copy link
Contributor

@katinthehatsite katinthehatsite left a 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?

Screenshot 2024-11-11 at 10 51 46 AM

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?

@wojtekn
Copy link
Contributor

wojtekn commented Nov 11, 2024

In addition to the sidebar toggle mentioned by Kat, I would propose to add a few more:

  • full WP Admin and site URLs when the user hovers over 'WP admin', 'Open site', or site screenshot
  • 'Copy' when a user hovers over links that can be copied to the clipboard in the Settings tab
  • settings link displayed for a user who is logged out

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.?

@ivan-ottinger
Copy link
Contributor Author

Thank you for your review and feedback, @katinthehatsite and @wojtekn! 🙂

One thing is that I am not sure whether we should also add a tooltip for toggling the sidebar? What do you think?

Good point! I have added tooltip there as well.

Markup on 2024-11-11 at 16:52:33

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?

Nice catch! I have added Starting tooltip when the site is starting.

  • full WP Admin and site URLs when the user hovers over 'WP admin', 'Open site', or site screenshot

Done:

Markup on 2024-11-11 at 16:49:52

Markup on 2024-11-11 at 16:50:21

  • 'Copy' when a user hovers over links that can be copied to the clipboard in the Settings tab

Done:

Markup on 2024-11-11 at 16:52:04
(example showing tooltip of one of the buttons)

  • settings link displayed for a user who is logged out

Are you referring to the following Log in button?

Markup on 2024-11-11 at 15:56:34

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 Log in label.

I would personally leave this button as-is for now - unless we come up with some specific tooltip text that fits there well. 🤔

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.?

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.

@wojtekn
Copy link
Contributor

wojtekn commented Nov 12, 2024

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 Log in label.

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'?

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.

Sounds fair, let's leave those as is for now.

Copy link
Contributor

@wojtekn wojtekn left a 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.

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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we reuse those labels for tooltip content? I've tried VoiceOver with this PR, and in those cases, when the item is active, it reads both labels one by one:

Screenshot 2024-11-12 at 09 20 14

Copy link
Contributor Author

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:

Markup on 2024-11-12 at 13:56:27

Markup on 2024-11-12 at 13:56:49

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@wojtekn
Copy link
Contributor

wojtekn commented Nov 13, 2024

Looks good. I've only notice small bug, where Studio displays tooltip for stopped site:

Screenshot 2024-11-13 at 08 38 35

@katinthehatsite
Copy link
Contributor

Everything looks good to me, nice work and congrats on your first Studio PR 😍

Just to note that it also happens for the Open site as well:

Screenshot 2024-11-13 at 9 32 49 AM

@ivan-ottinger
Copy link
Contributor Author

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: Open WP admin and Open site.

Copy link
Contributor

@katinthehatsite katinthehatsite left a 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!!

@wojtekn
Copy link
Contributor

wojtekn commented Nov 13, 2024

@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/

@ivan-ottinger
Copy link
Contributor Author

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!!

Thank you, Kat!

@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

Sounds good! I have applied the change in dbf2937. I have also kept the fallback tooltips there in case the site.url isn't available for some reason.

@wojtekn
Copy link
Contributor

wojtekn commented Nov 14, 2024

@ivan-ottinger I gave it a final test, and the labels look good now. However, I noticed the glitch with the help icon label:

  • it's misaligned vertically
  • when tooltip is shown, window gets scrollbar
  • when I move cursor right, it quickly changes between both states
Screen.Capture.on.2024-11-14.at.10-47-30.mp4

@ivan-ottinger
Copy link
Contributor Author

@ivan-ottinger I gave it a final test, and the labels look good now. However, I noticed the glitch with the help icon label:

  • it's misaligned vertically
  • when tooltip is shown, window gets scrollbar
  • when I move cursor right, it quickly changes between both states

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 Tooltip component is relying on an inline wrapper div that is causing styling conflicts in certain situations. I have now also noticed a related tiny misalignment on the Edit profile button in the Settings section.

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 Get help and Edit profile buttons as well, but rely on the title attribute there instead:

Markup on 2024-11-14 at 15:53:01

→ 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 title attribute until we create a tooltip solution that is compatible with all use cases.

Regardless, we can also remove tooltips from Get help and Edit profile buttons completely for now and leave only the tooltips that work well.

Do you have any preference here? 🤔

@wojtekn
Copy link
Contributor

wojtekn commented Nov 15, 2024

@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?

Screenshot 2024-11-15 at 09 45 00

@ivan-ottinger
Copy link
Contributor Author

@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?

Screenshot 2024-11-15 at 09 45 00

Thanks, Wojtek. Sounds good to me. 👍🏼 I have removed the tooltips that were causing issues and updated the PR description accordingly.

@ivan-ottinger ivan-ottinger merged commit a3be065 into trunk Nov 15, 2024
14 checks passed
@ivan-ottinger ivan-ottinger deleted the add/missing-button-labels branch November 15, 2024 12:52
@ivan-ottinger
Copy link
Contributor Author

Just noting that I have created a separate task to add the remaining tooltips: https://github.com/Automattic/dotcom-forge/issues/9841.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants