Harden accessibility: ARIA roles, semantic buttons, alt text, form labels

- Replace clickable divs with semantic <button> elements (NoteCard, SearchView)
- Add role="dialog", aria-modal, aria-labelledby on all modals (Login, Quote, Zap, Lightbox)
- Add role="presentation" on overlay backdrops (NoteCard menu, emoji pickers)
- Add aria-label to all icon-only buttons (close, nav arrows, context menu)
- Add aria-expanded to context menu toggle
- Add meaningful alt text to all 35+ images (avatars, covers, thumbnails, media)
- Add aria-label to form inputs (search, onboarding login)
This commit is contained in:
Jure
2026-04-02 17:01:02 +02:00
parent f1781691c5
commit 1fd613425d
27 changed files with 75 additions and 54 deletions
@@ -70,7 +70,7 @@ export function ProfileMediaGallery({ notes, loading }: { notes: NDKEvent[]; loa
>
<img
src={item.url}
alt=""
alt="Media content"
className="w-full h-full object-cover"
loading="lazy"
onError={(e) => { (e.target as HTMLImageElement).style.display = "none"; }}
@@ -88,7 +88,7 @@ export function ProfileMediaGallery({ notes, loading }: { notes: NDKEvent[]; loa
{item.thumbnailId ? (
<img
src={`https://img.youtube.com/vi/${item.thumbnailId}/mqdefault.jpg`}
alt=""
alt="Video thumbnail"
className="w-full h-full object-cover"
loading="lazy"
/>
+3 -3
View File
@@ -28,7 +28,7 @@ function TopFollowerAvatar({ pubkey }: { pubkey: string }) {
{profile?.picture ? (
<img
src={profile.picture}
alt=""
alt={`${name}'s avatar`}
className="w-5 h-5 rounded-sm object-cover bg-bg-raised"
onError={(e) => { (e.target as HTMLImageElement).style.display = "none"; }}
/>
@@ -218,7 +218,7 @@ export function ProfileView() {
)}
<img
src={profile.banner}
alt=""
alt={`${name}'s banner`}
className="w-full h-full object-cover object-[center_30%] cursor-pointer hover:opacity-90 transition-opacity"
onClick={() => setBannerLightbox(true)}
onLoad={() => setBannerLoaded(true)}
@@ -233,7 +233,7 @@ export function ProfileView() {
{avatar ? (
<img
src={avatar}
alt=""
alt={`${name}'s avatar`}
style={{ width: 64, height: 64 }}
className="rounded-sm object-cover bg-bg-raised"
onError={(e) => { (e.target as HTMLImageElement).style.display = "none"; }}