mirror of
https://github.com/hoornet/vega.git
synced 2026-07-19 23:08:11 -07:00
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:
@@ -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"
|
||||
/>
|
||||
|
||||
@@ -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"; }}
|
||||
|
||||
Reference in New Issue
Block a user