Skip to content

Conversation

@hlfan
Copy link
Collaborator

@hlfan hlfan commented Nov 5, 2025

Addendum to #6487. Touches some adjustments from #6215.

Copy link
Contributor

@pablobm pablobm left a comment

Choose a reason for hiding this comment

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

Thank you for this, it's underappreciated, mind-numbing work! 💪 Left some comments regarding accessibility nuances, let's see what you think.

<div class="card-text d-flex justify-content-between align-items-center mt-auto">
<small class="text-body-secondary d-flex gap-1 align-items-center">
<i class="bi bi-chat fs-5 my-n1" aria-hidden="true"></i>
<i class="bi bi-chat fs-5 my-n1" title="<%= t ".comments_label" %>" aria-hidden="true"></i>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this specific title needed? Also the span right after. They are followed by an "X comments" line, so I feel they might be redundant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It only occurred to me once I was testing something else on https://master.apis.dev.openstreetmap.org/ that the hover tooltips need a title attribute.

And since the Bootstrap icons use special characters in the pseudo-elements, I'm not happy with having this maybe appear on screen readers.

Hence twice.

Copy link
Contributor

Choose a reason for hiding this comment

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

In this specific case, what I mean is that I think it's not necessary to have anything working as a title (neither icon title nor span) because they are followed by "X comments" which is self-explanatory.

I just tried with iOS VoiceOver and with the Read Aloud extension on Firefox. In this specific instance both say "comments, zero comments". I think it can do with just saying "zero comments", with no prologue.

Also in my test, it appears to be the span that is read by these tools, so perhaps it can be removed and the icon title left in place, although I don't know that the title serves any purpose. If it's any like the alt attribute in images, then it's best not to use it unless the image adds significant meaning, which is not the case here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What do you think of removing the span elements and adding role=img, aria-label=* AND title=* instead of the aria-hidden?
Then there's just one element, even though there's still two translated texts specified.

Copy link
Contributor

Choose a reason for hiding this comment

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

In this specific case I would remove both the title and the span. I don't think they add anything. The i18n texts can be removed too then.

</small>
<small class="text-body-secondary d-flex gap-1 align-items-center">
<i class="bi bi-calendar fs-5 my-n1" aria-hidden="true"></i>
<i class="bi bi-calendar fs-5 my-n1" title="<%= t ".date_label" %>" aria-hidden="true"></i>
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly here: perhaps the title and span are not necessary as the content is self-explanatory.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the actual blog entry, the date is put in a sentence, so I think both can be dropped.

Comment on lines +7 to +8
<i class="bi bi-star-fill fs-5 role-<%= role %> align-middle" title="<%= t ".revoke.#{role}" %>" aria-hidden="true"></i>
<span class="visually-hidden"><%= t ".revoke.#{role}" %></span>
Copy link
Contributor

Choose a reason for hiding this comment

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

Related to the above: do we need both the title and the span? I suspect a single one will suffice. As for which one... any a11y experts in the room? 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

Following my experiment above, I think in these cases we should leave the span in place and remove the icon title.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since this logic branch is only visible for admins, I'd drop the span and leave the title for the tooltips.

Copy link
Contributor

Choose a reason for hiding this comment

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

I tested iOS VoiceOver and Read Aloud (on Firefox) again. They have slightly different behaviours that are driving me a bit crazy, particularly how Read Aloud doesn't always reload the page properly 😠

The following seems to work with both:

<i class="bi bi-star-fill fs-5 role-<%= role %> align-middle" title="<%= t ".revoke.#{role}" %>" role="button" aria-pressed="true"><span class="visually-hidden"><%= t ".revoke.#{role}" %></span></i>

On iOS the text is read twice, annoyingly. Not sure if this is best. Read Aloud appears to read what's in the browser's Accessibility Tree so I would think that's relevant...? No idea 😭

Comment on lines +14 to +15
<i class="bi bi-star fs-5 role-<%= role %> align-middle" title="<%= t ".grant.#{role}" %>" aria-hidden="true"></i>
<span class="visually-hidden"><%= t ".grant.#{role}" %></span>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

Comment on lines +256 to 257
<i class="align-self-baseline bi bi-geo-alt-fill flex-shrink-0 fs-6" title="<%= t ".home_location" %>" aria-hidden="true"></i>
<span class="visually-hidden"><%= t ".home_location" %></span>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same: probably one is enough.

Comment on lines +268 to 269
<i class="align-self-baseline bi bi-buildings-fill flex-shrink-0 fs-6" title="<%= t ".company" %>" aria-hidden="true"></i>
<span class="visually-hidden"><%= t ".company" %></span>
Copy link
Contributor

Choose a reason for hiding this comment

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

And same.

@gravitystorm
Copy link
Collaborator

@hlfan do you consider this ready, or are you planning further tweaks?

@hlfan
Copy link
Collaborator Author

hlfan commented Dec 3, 2025

Haven't gotten around to play with the ARIA details...

@hlfan hlfan marked this pull request as draft December 9, 2025 02:10
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.

3 participants