Skip to content

Conversation

@tzi
Copy link
Contributor

@tzi tzi commented Nov 5, 2025

Description

Nice and catchy blue focus ring everywhere

Blue by default.

before after
Screenshot 2025-11-06 at 00 33 27 Screenshot 2025-11-06 at 00 33 18

Alternative color on the main navigation to avoid blue over blue.

before after
Screenshot 2025-11-06 at 00 30 22 Screenshot 2025-11-06 at 00 30 36

Fix sidenav selection with keyboard navigation

It was impossible to open a submenu.

before after
sidenav-before sidenav-after

Small improvements

Improve « skip to content » focus ring

before after
Screenshot 2025-11-06 at 00 28 50 Screenshot 2025-11-06 at 00 29 05

Improve Matomo logo focus ring

before after
Screenshot 2025-11-06 at 00 28 45 Screenshot 2025-11-06 at 00 29 00

Fix period selection with keyboard navigation

Fixing the period selector was harder, broke tests, and change different files. So I choose to separate it in another PR that is not ready yet:

#23768

Checklist

  • [NA] I have understood, reviewed, and tested all AI outputs before use
  • [NA] All AI instructions respect security, IP, and privacy rules

Review

}

.accessibility-skip-to-content {
padding: 0 0.5rem;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ To separate a bit the focus ring and the link label

a:focus-visible,
button:focus-visible {
outline-color: @theme-color-focus-ring-alternative;
}
Copy link
Contributor Author

@tzi tzi Nov 6, 2025

Choose a reason for hiding this comment

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

ℹ️ Update focus ring color for the navigation to improve contrast and avoid a blue ring over a blue background.

Copy link
Contributor

Choose a reason for hiding this comment

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

No need to change, just a note.
This is already a good improvement, I just thought I'd mention that the new green colour doesn't meet 3:1 contrast ratio. We're definitely not in a WCAG 2.1 AA compliant state, so just a note for future reference.

Comment on lines +3 to +8
<a href="{{ logoLink|default('index.php') }}" tabindex="3"
title="{% if isCustomLogo %}{{ 'General_PoweredBy'|translate }} {% endif %}Matomo{% if not isCustomLogo %} # {{ 'General_OpenSourceWebAnalytics'|translate }}{% endif %}"
>
{% endif %}
{% if hasSVGLogo %}
<img src='{{ logoSVG }}?matomo' tabindex="3"
<img src='{{ logoSVG }}?matomo'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ The logo image was focused instead of the link

Comment on lines 38 to 46
if (binding.value?.onExpand) {
binding.value.onExpand();
}
Copy link
Contributor Author

@tzi tzi Nov 6, 2025

Choose a reason for hiding this comment

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

ℹ️ All the changes in this file is to allow an optional onExpand option. It was a bad idea since I do not want to force focus for the mouse users so I added onExpandByKeyboard too.

</button>

<a
<button
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ Moved to <button> since there is no href. a <a> without is not a link but an anchor.

:href="`#?${makeUrl(category, subcategory)}`"
class="item"
@click="loadSubcategory(category, subcategory, $event)"
tabindex="5"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ The missing tabindex made the submenu inaccessibles

@tzi tzi force-pushed the ux-300 branch 3 times, most recently from 815cafc to b431ef9 Compare November 7, 2025 15:05
Copy link
Contributor Author

@tzi tzi Nov 7, 2025

Choose a reason for hiding this comment

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

ℹ️ matomo logo centered and selector title centered

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ matomo logo centered

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ matomo logo centered

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ matomo logo centered

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ matomo logo centered

Comment on lines +134 to +138
a:focus-visible,
button:focus-visible {
outline: 2px solid @theme-color-focus-ring;
outline-offset: -2px;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ :focus-visible is the selector that is only triggered by keyboard navigation

@tzi tzi force-pushed the ux-300 branch 6 times, most recently from 2a006e5 to c5a3a30 Compare November 11, 2025 09:20
@tzi tzi added Bug For errors / faults / flaws / inconsistencies etc. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. c: Design / UI For issues that impact Matomo's user interface or the design overall. c: Accessibility When something is not usable for a certain group (eg missing contrast) or devices (eg smartphones). and removed Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. labels Nov 11, 2025
Comment on lines +12 to +13
background-color: transparent;
border: none;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ Add button reset style since I added button support

padding-right: 1rem;

text-decoration: none;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ Improve logo position and focus ring size

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ Centered role selector

@tzi tzi force-pushed the ux-300 branch 3 times, most recently from c9eab06 to cf6189f Compare November 11, 2025 15:26
@tzi tzi marked this pull request as ready for review November 11, 2025 20:00
@tzi tzi requested a review from a team November 11, 2025 20:00
@tzi tzi added Needs Review PRs that need a code review and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels Nov 11, 2025
michalkleiner
michalkleiner previously approved these changes Nov 13, 2025
Copy link
Contributor

@michalkleiner michalkleiner left a comment

Choose a reason for hiding this comment

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

LGTM, nice improvement. The taborder is still a bit unintuitive, but it's definitely better than what it was on the areas fixed in this PR.

@sgiehl I'm not sure what implications adding two new colour variables might have for 3rd-party themes, is it a safe thing to do or do we need to mention it somewhere?

Please don't merge yet until Stefan had a chance to answer the question above.

a:focus-visible,
button:focus-visible {
outline-color: @theme-color-focus-ring-alternative;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to change, just a note.
This is already a good improvement, I just thought I'd mention that the new green colour doesn't meet 3:1 contrast ratio. We're definitely not in a WCAG 2.1 AA compliant state, so just a note for future reference.

@michalkleiner michalkleiner changed the title Improve keyboard navigation in navbar, sidenav and top controls, ux-300 Improve keyboard navigation in navbar, sidenav and top controls Nov 13, 2025
@michalkleiner michalkleiner removed their assignment Nov 13, 2025
@sgiehl
Copy link
Member

sgiehl commented Nov 13, 2025

I guess we could consider mentioning those new color variables in CHANGELOG.md so plugin/theme developers are aware they might need to add those to their themes. Besides that it should be fine to add those.

Copy link
Contributor

@michalkleiner michalkleiner left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Added the changelog entry, created an internal ticket to add changelog entry for 5.5.0 that seems to be missing.

@michalkleiner michalkleiner merged commit be18a0a into 5.x-dev Nov 14, 2025
48 of 52 checks passed
@michalkleiner michalkleiner deleted the ux-300 branch November 14, 2025 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug For errors / faults / flaws / inconsistencies etc. c: Accessibility When something is not usable for a certain group (eg missing contrast) or devices (eg smartphones). c: Design / UI For issues that impact Matomo's user interface or the design overall. Needs Review PRs that need a code review

Development

Successfully merging this pull request may close these issues.

4 participants