From fcc3b81745ab0912968a7761c3de986a9d7d3c82 Mon Sep 17 00:00:00 2001
From: Ben Basten <45583362+ben-basten@users.noreply.github.com>
Date: Fri, 29 Mar 2024 12:48:07 +0000
Subject: [PATCH] feat(web, a11y): add labels! (#8354)
* feat(web, a11y): add labels!
* fix: move required prop to the top of the list
---
.../album-page/album-options.svelte | 2 +-
.../album-page/share-info-modal.svelte | 1 +
.../asset-viewer/activity-viewer.svelte | 8 +++++-
.../asset-viewer/asset-viewer-nav-bar.svelte | 2 +-
.../asset-viewer/download-panel.svelte | 8 +++++-
.../buttons/circle-icon-button.svelte | 4 +--
.../faces-page/merge-face-selector.svelte | 7 +++++-
.../faces-page/merge-suggestion-modal.svelte | 3 ++-
.../components/faces-page/show-hide.svelte | 2 +-
.../components/forms/edit-user-form.svelte | 2 +-
.../memory-page/memory-viewer.svelte | 25 +++++++++++++++----
.../shared-components/base-modal.svelte | 2 +-
.../context-menu/menu-option.svelte | 2 +-
.../shared-components/control-app-bar.svelte | 1 +
.../navigation-bar/avatar-selector.svelte | 4 +--
.../shared-components/show-shortcuts.svelte | 2 +-
.../shared-components/user-avatar.svelte | 3 ++-
.../sharedlinks-page/shared-link-card.svelte | 6 ++---
.../(user)/albums/[albumId]/+page.svelte | 1 +
web/src/routes/admin/repair/+page.svelte | 4 +--
20 files changed, 63 insertions(+), 26 deletions(-)
diff --git a/web/src/lib/components/album-page/album-options.svelte b/web/src/lib/components/album-page/album-options.svelte
index d5f816047f..5118daf068 100644
--- a/web/src/lib/components/album-page/album-options.svelte
+++ b/web/src/lib/components/album-page/album-options.svelte
@@ -61,7 +61,7 @@
Options
- dispatch('close')} />
+ dispatch('close')} />
diff --git a/web/src/lib/components/album-page/share-info-modal.svelte b/web/src/lib/components/album-page/share-info-modal.svelte
index db227b03ab..5f60d2b404 100644
--- a/web/src/lib/components/album-page/share-info-modal.svelte
+++ b/web/src/lib/components/album-page/share-info-modal.svelte
@@ -97,6 +97,7 @@
{#if isOwned}
showContextMenu(event, user)}
icon={mdiDotsVertical}
backgroundColor="transparent"
diff --git a/web/src/lib/components/asset-viewer/activity-viewer.svelte b/web/src/lib/components/asset-viewer/activity-viewer.svelte
index cf98c527fa..0acfb88dcd 100644
--- a/web/src/lib/components/asset-viewer/activity-viewer.svelte
+++ b/web/src/lib/components/asset-viewer/activity-viewer.svelte
@@ -305,7 +305,13 @@
{:else if message}
-
+
{/if}
diff --git a/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte b/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte
index e4deffeef5..1772b8641d 100644
--- a/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte
+++ b/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte
@@ -102,7 +102,7 @@
class="z-[1001] flex h-16 place-items-center justify-between bg-gradient-to-b from-black/40 px-3 transition-transform duration-200"
>
- dispatch('back')} />
+ dispatch('back')} />
{#if showShareButton}
diff --git a/web/src/lib/components/asset-viewer/download-panel.svelte b/web/src/lib/components/asset-viewer/download-panel.svelte
index 297d6ead6e..7aac3e69e9 100644
--- a/web/src/lib/components/asset-viewer/download-panel.svelte
+++ b/web/src/lib/components/asset-viewer/download-panel.svelte
@@ -39,7 +39,13 @@
- abort(downloadKey, download)} size="20" icon={mdiClose} forceDark />
+ abort(downloadKey, download)}
+ size="20"
+ icon={mdiClose}
+ forceDark
+ />
{/each}
diff --git a/web/src/lib/components/elements/buttons/circle-icon-button.svelte b/web/src/lib/components/elements/buttons/circle-icon-button.svelte
index a2e6dc0c42..809eaa7228 100644
--- a/web/src/lib/components/elements/buttons/circle-icon-button.svelte
+++ b/web/src/lib/components/elements/buttons/circle-icon-button.svelte
@@ -2,11 +2,11 @@
import Icon from '$lib/components/elements/icon.svelte';
export let icon: string;
+ export let title: string;
export let backgroundColor = '';
export let hoverColor = '#e2e7e9';
export let padding = '3';
export let size = '24';
- export let title = '';
export let isOpacity = false;
export let forceDark = false;
export let hideMobile = false;
@@ -27,7 +27,7 @@
{hideMobile && 'hidden sm:flex'}"
on:click
>
-
+
diff --git a/web/src/lib/components/faces-page/merge-face-selector.svelte b/web/src/lib/components/faces-page/merge-face-selector.svelte
index 9fa8628ddc..312883db5c 100644
--- a/web/src/lib/components/faces-page/merge-face-selector.svelte
+++ b/web/src/lib/components/faces-page/merge-face-selector.svelte
@@ -135,7 +135,12 @@
{#if selectedPeople.length === 1}
-
+
{/if}
diff --git a/web/src/lib/components/faces-page/merge-suggestion-modal.svelte b/web/src/lib/components/faces-page/merge-suggestion-modal.svelte
index 89c9b6fc12..9b579909d1 100644
--- a/web/src/lib/components/faces-page/merge-suggestion-modal.svelte
+++ b/web/src/lib/components/faces-page/merge-suggestion-modal.svelte
@@ -40,7 +40,7 @@
Merge People - {title}
- dispatch('close')} />
+ dispatch('close')} />
@@ -57,6 +57,7 @@
([personMerge1, personMerge2] = [personMerge2, personMerge1])}
/>
diff --git a/web/src/lib/components/faces-page/show-hide.svelte b/web/src/lib/components/faces-page/show-hide.svelte
index bee1e98fb7..b7ab80f3f1 100644
--- a/web/src/lib/components/faces-page/show-hide.svelte
+++ b/web/src/lib/components/faces-page/show-hide.svelte
@@ -29,7 +29,7 @@
class="fixed top-0 z-10 flex h-16 w-full items-center justify-between border-b bg-white p-1 dark:border-immich-dark-gray dark:bg-black dark:text-immich-dark-fg md:p-8"
>
-
dispatch('close')} />
+ dispatch('close')} />
Show & hide people
({countTotalPeople.toLocaleString($locale)})
diff --git a/web/src/lib/components/forms/edit-user-form.svelte b/web/src/lib/components/forms/edit-user-form.svelte
index beb3f43053..6ec86a1b80 100644
--- a/web/src/lib/components/forms/edit-user-form.svelte
+++ b/web/src/lib/components/forms/edit-user-form.svelte
@@ -96,7 +96,7 @@
class="relative max-h-screen w-[500px] max-w-[95vw] overflow-y-auto rounded-3xl border bg-immich-bg p-4 py-8 shadow-sm dark:border-immich-dark-gray dark:bg-immich-dark-gray dark:text-immich-dark-fg"
>
- dispatch('close')} />
+ dispatch('close')} />
- (paused = !paused)} />
+ (paused = !paused)}
+ />
{#each currentMemory.assets as _, index}
{/if}
@@ -204,13 +209,23 @@
{#if canGoBack}
-
+
{/if}
{#if canGoForward}
-
+
{/if}
@@ -271,7 +286,7 @@
class:opacity-100={!galleryInView}
>
memoryGallery.scrollIntoView({ behavior: 'smooth' })}>
-
+
diff --git a/web/src/lib/components/shared-components/base-modal.svelte b/web/src/lib/components/shared-components/base-modal.svelte
index 234933b9b1..c5bf5380af 100644
--- a/web/src/lib/components/shared-components/base-modal.svelte
+++ b/web/src/lib/components/shared-components/base-modal.svelte
@@ -56,7 +56,7 @@
- dispatch('close')} icon={mdiClose} size={'20'} />
+ dispatch('close')} icon={mdiClose} size={'20'} title="Close" />
diff --git a/web/src/lib/components/shared-components/context-menu/menu-option.svelte b/web/src/lib/components/shared-components/context-menu/menu-option.svelte
index 6d5adc4197..28c29c74ad 100644
--- a/web/src/lib/components/shared-components/context-menu/menu-option.svelte
+++ b/web/src/lib/components/shared-components/context-menu/menu-option.svelte
@@ -14,7 +14,7 @@
{#if text}
{#if icon}
-
+
{text}
{:else}
diff --git a/web/src/lib/components/shared-components/control-app-bar.svelte b/web/src/lib/components/shared-components/control-app-bar.svelte
index 095b12d274..10f1965a7e 100644
--- a/web/src/lib/components/shared-components/control-app-bar.svelte
+++ b/web/src/lib/components/shared-components/control-app-bar.svelte
@@ -58,6 +58,7 @@
{#if showBackButton}
- dispatch('close')} />
+ dispatch('close')} />
{#each colors as color}
dispatch('choose', color)}>
-
+
{/each}
diff --git a/web/src/lib/components/shared-components/show-shortcuts.svelte b/web/src/lib/components/shared-components/show-shortcuts.svelte
index 7a660de1b2..cfa3768bb5 100644
--- a/web/src/lib/components/shared-components/show-shortcuts.svelte
+++ b/web/src/lib/components/shared-components/show-shortcuts.svelte
@@ -44,7 +44,7 @@
Keyboard Shortcuts
- dispatch('close')} />
+ dispatch('close')} />
diff --git a/web/src/lib/components/shared-components/user-avatar.svelte b/web/src/lib/components/shared-components/user-avatar.svelte
index e07a55f867..fac7890d74 100644
--- a/web/src/lib/components/shared-components/user-avatar.svelte
+++ b/web/src/lib/components/shared-components/user-avatar.svelte
@@ -22,6 +22,7 @@
export let interactive = false;
export let showTitle = true;
export let showProfileImage = true;
+ export let label: string | undefined = undefined;
let img: HTMLImageElement;
let showFallback = true;
@@ -61,7 +62,7 @@
$: colorClass = colorClasses[color];
$: sizeClass = sizeClasses[size];
- $: title = `${user.name} (${user.email})`;
+ $: title = label ?? `${user.name} (${user.email})`;
$: interactiveClass = interactive
? 'border-2 border-immich-primary hover:border-immich-dark-primary dark:hover:border-immich-primary dark:border-immich-dark-primary transition-colors'
: '';
diff --git a/web/src/lib/components/sharedlinks-page/shared-link-card.svelte b/web/src/lib/components/sharedlinks-page/shared-link-card.svelte
index 993a052bf6..e71e62e40f 100644
--- a/web/src/lib/components/sharedlinks-page/shared-link-card.svelte
+++ b/web/src/lib/components/sharedlinks-page/shared-link-card.svelte
@@ -168,9 +168,9 @@
- dispatch('delete')} />
- dispatch('edit')} />
- dispatch('copy')} />
+ dispatch('delete')} />
+ dispatch('edit')} />
+ dispatch('copy')} />
diff --git a/web/src/routes/(user)/albums/[albumId]/+page.svelte b/web/src/routes/(user)/albums/[albumId]/+page.svelte
index 23e6a1b2ee..d4b665bc0a 100644
--- a/web/src/routes/(user)/albums/[albumId]/+page.svelte
+++ b/web/src/routes/(user)/albums/[albumId]/+page.svelte
@@ -545,6 +545,7 @@
{#if album.hasSharedLink && isOwned}
copyToClipboard(orphan.pathValue)}>
-
+
|
{orphan.pathValue}
@@ -306,7 +306,7 @@
title={extra.filename}
>
| copyToClipboard(extra.filename)}>
-
+
|
|