Make WordPress Core

Opened 11 years ago

Closed 3 years ago

#26562 closed enhancement (fixed)

Remove title attributes: class-wp-admin-bar.php

Reported by: joedolson's profile joedolson Owned by: joedolson's profile joedolson
Milestone: 5.8 Priority: normal
Severity: normal Version: 3.3
Component: Toolbar Keywords: title-attribute has-screenshots commit
Focuses: ui, accessibility Cc:

Description (last modified by SergeyBiryukov)

Related: #24766

// class-wp-admin-bar.php
_render_item()

Attachments (7)

26562.patch (1.0 KB) - added by Mte90 9 years ago.
replaced title with aria-label
26562.refresh.patch (575 bytes) - added by sabernhardt 4 years ago.
refresh: still using former title attribute as aria-label
26562.2.patch (2.7 KB) - added by sabernhardt 4 years ago.
replaces counts by type with total count; adds aria-hidden to ab-icon elements
toolbar-updates-dashboard-title.png (8.6 KB) - added by sabernhardt 3 years ago.
in WordPress 5.7, hovering mouse over link (on most screens) shows title attribute tooltip
toolbar-updates-dashboard-title-5.5.png (13.1 KB) - added by sabernhardt 3 years ago.
tooltip with four types of updates
toolbar-updates-updatecore-no-title.png (8.2 KB) - added by sabernhardt 3 years ago.
currently in 5.7, the Updates screen (also Themes and Plugins) removes the title attribute tooltip
toolbar-updates-dashboard-no-title-after-patch.png (7.5 KB) - added by sabernhardt 3 years ago.
26562.2.patch removes tooltip from toolbar's updates link on any screen

Download all attachments as: .zip

Change History (48)

#1 @SergeyBiryukov
11 years ago

  • Description modified (diff)

#2 follow-up: @joedolson
11 years ago

This function does not provide a title attribute by default, only if provided in arguments. That means there's a risk of people using it in a way which provides meaningless information, but also means that it provides added info, and should possibly be left as a dev decision when adding new menu items. Also, since this is an admin-side function, we can readily add JS to expose this information on keyboard focus, so it's my opinion that this should be dealt with by adding screen reader and keyboard support for the information via JS. 2nd Opinions welcome.

#3 @joedolson
11 years ago

  • Keywords 2nd-opinion added

#4 @nacin
11 years ago

  • Component changed from Accessibility to Toolbar
  • Focuses accessibility added

#5 @joedolson
9 years ago

Since this isn't used by core, I think we should close this and mark wontfix. In looking at usage of the attribute, it appears to be very low usage in plug-ins, as well.

What may be a good idea, instead of addressing the usage of the title attribute would be deprecating or removing support for title attributes in the admin bar.

#6 follow-up: @morganestes
9 years ago

  • Keywords dev-feedback added
  • Type changed from defect (bug) to enhancement
  • Version set to 3.3

After looking through core, I found that the title attribute is used by Comments and Updates for noting counts, but didn't find any other uses. Since there's not another clear way to indicate the number within the context of what it's counting (number of updates available, types of comments, etc.), I think our options are to leave it in, or find another way to include the information.

I'd prefer that we use aria-label instead of title, but understand we'd just be trading one potential abusive entry point for another. Even still, I vote for deprecating the title attribute and moving towards ARIA, especially since it's only two places in core to start with.

#7 @afercia
9 years ago

Related: #29022

#8 in reply to: ↑ 6 @afercia
9 years ago

Replying to morganestes:

I vote for deprecating the title attribute and moving towards ARIA, especially since it's only two places in core to start with.

I'd totally second this. Would recommend to consider to deprecate $args['meta']['title'] and encourage the use of ARIA. Worth remembering the HTML5 spec discourages the use of the title attribute: http://www.w3.org/TR/html/dom.html#the-title-attribute

About the "Updates" and "Comments" notifications, we should definitely avoid to provide the same information twice, see screenshot below:

https://cldup.com/rPbY93DaHy.png

where (part of) the link text and the title attribute say the same thing. This would be read out this way:

three one Plugin Update, one Theme Update, Translation Updates visited link one Plugin Update, one Theme Update, Translation Updates

About the visual part, we should find a new way to provide the expanded information, especially for touch-only users.

#9 in reply to: ↑ 2 @afercia
9 years ago

  • Focuses ui added

Replying to joedolson:

since this is an admin-side function, we can readily add JS to expose this information on keyboard focus

Seen on GitHub, pure CSS solution using content: attr(aria-label). That's not to suggest to use tooltips! :) Just to say it is possible to display content on hover, focus, and active states and at the same time providing that content in an accessible way. Any thoughts more than welcome.

https://cldup.com/ZtoXLevHHz.png

#10 @afercia
9 years ago

Some design/UI feedback here would be greatly appreciated. This would be a nice opportunity for designers to chime in with new ideas :) To recap:

  • we'd like to discourage the use of title attributes and remove them wherever possible
  • at the same time we need to display the info about updates and comments count

This ticket was mentioned in Slack in #design by afercia. View the logs.


9 years ago

@Mte90
9 years ago

replaced title with aria-label

#12 @afercia
9 years ago

  • Keywords ui-feedback added; 2nd-opinion dev-feedback removed

@Mte90 thanks for the patch, it's a start :) We should also find a way to display the Updates information. Wondering if splitting the current icon in 3 different icons could be a solution. Need some design feedback.

This ticket was mentioned in Slack in #accessibility by rianrietveld. View the logs.


8 years ago

#14 @joedolson
8 years ago

Related: #35566 for a proposed example of tooltip.

This ticket was mentioned in Slack in #accessibility by rianrietveld. View the logs.


8 years ago

#16 @afercia
8 years ago

  • Milestone changed from Awaiting Review to Future Release

This would need some UI feedback and decisions first, setting to future release for now.

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


8 years ago

#18 @afercia
8 years ago

Discussed a bit this ticket at today's accessibility weekly meeting. There's probably the need of a new idea and new approach here. Maybe, instead of trying to make the current content fit in a place where it is not available to all the different devices and assistive technologies, it would be better to simplify and say just e.g. "3 updates" without specifying their type. Users can always click on the icon and get the details. This would allow to remove the title attribute and use just the icon + number and an aria-label attribute. It would be easier to update the updates count via JavaScript too, if I remember correctly @pento worked on this a while ago and I'd greatly appreciate his thoughts on this.

Alternatively, a more advanced idea would be introducing a sort of notification area: users click the icon and a panel expands with all the relevant details in plain text and links/buttons for further actions.

Personally, I'd rather keep it simple and go with the first option, without excluding the second option for the future :)

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


8 years ago

#20 @afercia
8 years ago

Related: #33030

#21 @afercia
7 years ago

  • Keywords title-attribute added

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


7 years ago

This ticket was mentioned in Slack in #design by boemedia. View the logs.


6 years ago

#24 @boemedia
6 years ago

  • Keywords changed from ui-feedback, title-attribute to ui-feedback title-attribute

@afercia does this ticket still need design input? Or can we merge it with #33030 for the notification alternative? Would this be something to brainstorm on at upcoming Contributor Day in Belgrade? If so, I can note this down for a group of people to work on some mockups.

#25 @afercia
6 years ago

@boemedia yes I think in a way this ticket is similar to #33030 but still different, as the icon in the top bar groups all types of updates while the icons in the left admin bar work differently (also: themes don't' show an updates icon in the admin bar). Some brainstorming during WCEU contributor day would be very welcome!

This ticket was mentioned in Slack in #design by karmatosed. View the logs.


5 years ago

#27 @afercia
5 years ago

Related: #29022: updating the counts is buggy and there are some technical issues hard to solve. There's some consensus to simplify as much as possible, see https://core.trac.wordpress.org/ticket/29022#comment:29

The update types are displayed in a title attribute:

http://cldup.com/HKqweuPvNM.png

One option mentioned in #29022 is to just remove the total updates number, remove the title attribute, and use some text:

http://cldup.com/aeKtZl6Vth.png

Re: concerns about the limited space in the toolbar, especially when plugins add their own stuff, worth reminding this link is not visible when there are no updates.

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


4 years ago

#29 @afercia
4 years ago

#50355 was marked as a duplicate.

#30 @Mte90
4 years ago

I was checking my oldest patch still opened and there is still this one.
Just as reference the file is still the same, but the line is changed https://github.com/WordPress/wordpress-develop/blob/master/src/wp-includes/class-wp-admin-bar.php#L541

#31 @joedolson
4 years ago

  • Owner set to joedolson
  • Status changed from new to accepted

@sabernhardt
4 years ago

refresh: still using former title attribute as aria-label

@sabernhardt
4 years ago

replaces counts by type with total count; adds aria-hidden to ab-icon elements

#32 @sabernhardt
4 years ago

I simply refreshed the previous patch for 26562.refresh.patch, though I think it could be better.

Instead of giving a list of counts by type, 26562.2.patch only gives the total of all updates.

  • The visible number matches the beginning of the screen reader text (except when the translation moves the number later).
  • The code closely follows the example of the Comments in moderation link.
  • I also added aria-hidden to existing ab-icon elements. If the Site name, Customize and Search icons should have the same treatment, that can go in a separate ticket.

This ticket was mentioned in Slack in #accessibility by sabernhardt. View the logs.


3 years ago

#34 @joedolson
3 years ago

  • Milestone changed from Future Release to 5.8

This ticket was mentioned in Slack in #design by chaion07. View the logs.


3 years ago

#36 @paaljoachim
3 years ago

  • Keywords needs-screenshots added

Hey @sabernhardt

Can you post a new screenshoot please?
It is helpful to see what the newest version looks like. It makes it much easier to give feedback.
Thanks!

@sabernhardt
3 years ago

in WordPress 5.7, hovering mouse over link (on most screens) shows title attribute tooltip

@sabernhardt
3 years ago

tooltip with four types of updates

@sabernhardt
3 years ago

currently in 5.7, the Updates screen (also Themes and Plugins) removes the title attribute tooltip

@sabernhardt
3 years ago

26562.2.patch removes tooltip from toolbar's updates link on any screen

#37 @sabernhardt
3 years ago

  • Keywords has-screenshots added; needs-screenshots removed

The only visual differences are when the mouse hovers over the link. I'm more confident about simply removing the title attribute after noticing that the updates script already removes it from the Updates, Plugins and Themes screens.

Other notes:

  1. For anyone who appreciates seeing the plugin and theme counts, I opened #53031 to add those to the Updates screen.
  2. Because the patch's code uses screen-reader-text like the Comments in moderation link, the updates script still would need to edit that text (see #29022).

This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.


3 years ago

#39 @audrasjb
3 years ago

  • Keywords commit added; ui-feedback removed

I just tested 26562.2.patch and it looks like it works fine:

  • it removes the unwanted title attribute
  • it adds aria-hidden attributes to the number information (which is redondant for screen reader users)
  • it moves the details of the updates inside the screen reader text container

Good job! :) Marking for commit

#40 @joedolson
3 years ago

Thanks for testing @audrasjb!

#41 @joedolson
3 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 50801:

Toolbar: Remove title attribute on pending updates link.

Remove the title attribute from the link, wrap the link icon and numeric indicator with the aria-hidden attribute, and add a .screen-reader-text span so screen readers hear a link that has relevant context without requiring translators to deal with appended strings. Removes the individual counts of theme and plugin updates from the attribute, as those were already buggy and didn't include translation counts.

Props afercia, Mte90, sabernhardt, audrasjb
Fixes #26562. See #53031.

Note: See TracTickets for help on using tickets.