a11y: comprehensive WCAG 2.1 Level AA accessibility audit

- Add skip-to-main-content link and main content ID target
- Add prefers-reduced-motion media queries for all animations
- Enhance visible focus indicators (2px offset, high-contrast ring)
- Replace ~160 text-surface-500 instances with text-surface-600/dark:text-surface-400
  for 4.5:1+ contrast ratio compliance
- Add aria-hidden="true" to ~30+ decorative SVG icons across sidebars/widgets
- Convert facepile containers from div to semantic ul/li with role="list"
- Add aria-label to icon-only buttons (share, sort controls)
- Add sr-only labels to form inputs (webmention, search)
- Add aria-live="polite" to dynamically loaded webmentions
- Add aria-label with relative+absolute date to time-difference component
- Add keyboard handlers (Enter/Space) to custom interactive elements
- Add aria-label to nav landmarks (table of contents)
- Fix modal focus trap and dialog accessibility
- Fix lightbox keyboard navigation and screen reader announcements

Confab-Link: http://localhost:8080/sessions/edb1b7b0-da66-4486-bd9c-d1cfa7553b88
This commit is contained in:
Ricardo
2026-03-07 18:58:08 +01:00
parent db75bd05ea
commit e236b4bf65
77 changed files with 638 additions and 505 deletions

View File

@@ -99,9 +99,9 @@ withSidebar: true
</h2>
<p class="text-surface-600 dark:text-surface-400">{{ fwNowPlaying.artist }}</p>
{% if fwNowPlaying.album %}
<p class="text-sm text-surface-500 mt-1">{{ fwNowPlaying.album }}</p>
<p class="text-sm text-surface-600 dark:text-surface-400 mt-1">{{ fwNowPlaying.album }}</p>
{% endif %}
<p class="text-xs text-surface-500 mt-2">{{ fwNowPlaying.relativeTime }}</p>
<p class="text-xs text-surface-600 dark:text-surface-400 mt-2">{{ fwNowPlaying.relativeTime }}</p>
</div>
</div>
</div>
@@ -154,9 +154,9 @@ withSidebar: true
</h2>
<p class="text-surface-600 dark:text-surface-400">{{ lfmNowPlaying.artist }}</p>
{% if lfmNowPlaying.album %}
<p class="text-sm text-surface-500 mt-1">{{ lfmNowPlaying.album }}</p>
<p class="text-sm text-surface-600 dark:text-surface-400 mt-1">{{ lfmNowPlaying.album }}</p>
{% endif %}
<p class="text-xs text-surface-500 mt-2">{{ lfmNowPlaying.relativeTime }}</p>
<p class="text-xs text-surface-600 dark:text-surface-400 mt-2">{{ lfmNowPlaying.relativeTime }}</p>
</div>
</div>
</div>
@@ -187,15 +187,15 @@ withSidebar: true
<div class="grid grid-cols-3 gap-4 text-center">
<div>
<div class="text-2xl font-bold text-surface-900 dark:text-surface-100">{{ funkwhaleActivity.stats.summary.all.totalPlays | default(0) }}</div>
<div class="text-xs text-surface-500 uppercase">Plays</div>
<div class="text-xs text-surface-600 dark:text-surface-400 uppercase">Plays</div>
</div>
<div>
<div class="text-2xl font-bold text-surface-900 dark:text-surface-100">{{ funkwhaleActivity.stats.summary.all.uniqueArtists | default(0) }}</div>
<div class="text-xs text-surface-500 uppercase">Artists</div>
<div class="text-xs text-surface-600 dark:text-surface-400 uppercase">Artists</div>
</div>
<div>
<div class="text-2xl font-bold text-surface-900 dark:text-surface-100">{{ funkwhaleActivity.stats.summary.all.uniqueTracks | default(0) }}</div>
<div class="text-xs text-surface-500 uppercase">Tracks</div>
<div class="text-xs text-surface-600 dark:text-surface-400 uppercase">Tracks</div>
</div>
</div>
{# Top Artists #}
@@ -206,7 +206,7 @@ withSidebar: true
{% for artist in funkwhaleActivity.stats.topArtists.all | head(5) %}
<div class="flex justify-between text-sm">
<span class="text-surface-600 dark:text-surface-400 truncate">{{ artist.name }}</span>
<span class="text-surface-500 ml-2">{{ artist.playCount }}</span>
<span class="text-surface-600 dark:text-surface-400 ml-2">{{ artist.playCount }}</span>
</div>
{% endfor %}
</div>
@@ -225,15 +225,15 @@ withSidebar: true
<div class="grid grid-cols-3 gap-4 text-center">
<div>
<div class="text-2xl font-bold text-surface-900 dark:text-surface-100">{{ lastfmActivity.stats.summary.all.totalPlays | default(0) }}</div>
<div class="text-xs text-surface-500 uppercase">Scrobbles</div>
<div class="text-xs text-surface-600 dark:text-surface-400 uppercase">Scrobbles</div>
</div>
<div>
<div class="text-2xl font-bold text-surface-900 dark:text-surface-100">{{ lastfmActivity.stats.summary.all.uniqueArtists | default(0) }}</div>
<div class="text-xs text-surface-500 uppercase">Artists</div>
<div class="text-xs text-surface-600 dark:text-surface-400 uppercase">Artists</div>
</div>
<div>
<div class="text-2xl font-bold text-surface-900 dark:text-surface-100">{{ lastfmActivity.stats.summary.all.lovedCount | default(0) }}</div>
<div class="text-xs text-surface-500 uppercase">Loved</div>
<div class="text-xs text-surface-600 dark:text-surface-400 uppercase">Loved</div>
</div>
</div>
{# Top Artists from Last.fm #}
@@ -244,7 +244,7 @@ withSidebar: true
{% for artist in lastfmActivity.stats.topArtists.all | head(5) %}
<div class="flex justify-between text-sm">
<span class="text-surface-600 dark:text-surface-400 truncate">{{ artist.name }}</span>
<span class="text-surface-500 ml-2">{{ artist.playCount }}</span>
<span class="text-surface-600 dark:text-surface-400 ml-2">{{ artist.playCount }}</span>
</div>
{% endfor %}
</div>
@@ -294,7 +294,7 @@ withSidebar: true
<div class="text-right flex-shrink-0">
<span class="inline-block px-2 py-0.5 text-xs font-medium bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-400 rounded-full mb-1">Funkwhale</span>
<span class="text-xs text-surface-500 block">{{ listening.relativeTime }}</span>
<span class="text-xs text-surface-600 dark:text-surface-400 block">{{ listening.relativeTime }}</span>
<button
class="share-post-btn mt-1"
data-share-url="{{ listening.trackUrl }}"
@@ -351,7 +351,7 @@ withSidebar: true
<div class="text-right flex-shrink-0">
<span class="inline-block px-2 py-0.5 text-xs font-medium bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-400 rounded-full mb-1">Last.fm</span>
<span class="text-xs text-surface-500 block">{{ scrobble.relativeTime }}</span>
<span class="text-xs text-surface-600 dark:text-surface-400 block">{{ scrobble.relativeTime }}</span>
<button
class="share-post-btn mt-1"
data-share-url="{{ scrobble.trackUrl }}"
@@ -391,7 +391,7 @@ withSidebar: true
<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
</svg>
Loved Tracks
<span class="text-sm font-normal text-surface-500">(Last.fm)</span>
<span class="text-sm font-normal text-surface-600 dark:text-surface-400">(Last.fm)</span>
</h2>
<div class="grid gap-3 sm:gap-4 md:grid-cols-2">
@@ -452,7 +452,7 @@ withSidebar: true
<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
</svg>
Favorite Tracks
<span class="text-sm font-normal text-surface-500">(Funkwhale)</span>
<span class="text-sm font-normal text-surface-600 dark:text-surface-400">(Funkwhale)</span>
</h2>
<div class="grid gap-3 sm:gap-4 md:grid-cols-2">
@@ -478,7 +478,7 @@ withSidebar: true
</h3>
<p class="text-sm text-surface-600 dark:text-surface-400 truncate">{{ favorite.artist }}</p>
{% if favorite.album %}
<p class="text-xs text-surface-500 truncate">{{ favorite.album }}</p>
<p class="text-xs text-surface-600 dark:text-surface-400 truncate">{{ favorite.album }}</p>
{% endif %}
</div>
<button