docsy icon indicating copy to clipboard operation
docsy copied to clipboard

Remove ARIA attributes from taxonomy lists

Open chalin opened this issue 2 years ago • 5 comments

  • Closes #1071

I've chosen to avoid complicating the logic of the breadcrumbs partial since it's complicated enough already. This PR implements what I proposed earlier: it strips out unnecessary classes and irrelevant ARIA labels from the "breadcrumbs" used in the taxonomy lists.

You'll notice that I've removed the disabled state from the last breadcrumb since it no longer makes sense to disable it (because we're not on that page anymore :)).

Preview: https://deploy-preview-1072--docsydocs.netlify.app/categories/taxonomies/


Screenshots

Before:

image

After:

image

/cc @at055612

chalin avatar Jun 24 '22 12:06 chalin

@at055612 - PTAL and approve if this solution is suitable for you.

chalin avatar Jun 24 '22 12:06 chalin

@chalin Agree with making the leaf link enabled on the taxonomy results. I think a comment would be useful to explain why the regex replace is there. I did play with passing a flag into the partial to define whether it was a page breadcrumb or not and thus whether to include the aria bits, but it wasn't working for some reason. My only worry with the regex approach is that if someone changes the implementation of the partial they may unknowingly break the the taxonomy results.

I did wander about keeping the aria-label on the <nav> but setting its value to "breadcrumb for {{ .LinkTitle }}". However I think aria-label should be unique and we can't guarantee that. Setting it to something like "breadcrumb for result N" would be an option but the partial has no knowledge of its index.

at055612 avatar Jun 24 '22 14:06 at055612

LGTM, though agree with @at055612 that a comment for the regex replace would be useful, especially for future users who might want to modify or override the partial.

LisaFC avatar Jul 04 '22 15:07 LisaFC

Added a comment and rebased. PTAL

chalin avatar Aug 01 '22 15:08 chalin

Rebased. Pinging @LisaFC and @geriom for a review.

chalin avatar Aug 09 '22 14:08 chalin

@LisaFC - just a reminder that this is ready for your review.

chalin avatar Aug 15 '22 07:08 chalin