From 0c33480a840d628488b44de0143771555423def0 Mon Sep 17 00:00:00 2001 From: James Xylight Date: Sat, 23 Aug 2025 21:40:14 -0700 Subject: [PATCH] aria: improve semantics --- eslint.config.js | 1 + src/app.html | 4 +- src/lib/auth.svelte.ts | 2 +- src/lib/components/lemmy/SiteCard.svelte | 9 +- .../lemmy/community/CommunityCard.svelte | 10 +- src/lib/components/lemmy/post/Post.svelte | 24 +--- src/lib/components/lemmy/post/PostMeta.svelte | 1 - .../lemmy/post/link/PostLink.svelte | 111 +++++++++--------- src/lib/components/ui/EndPlaceholder.svelte | 10 +- src/lib/components/ui/Pageination.svelte | 2 - src/lib/components/ui/layout/Shell.svelte | 66 ++++++----- .../components/ui/layout/pages/Header.svelte | 7 +- .../ui/sidebar/ProfileSelection.svelte | 1 + src/lib/components/ui/sidebar/Sidebar.svelte | 6 +- src/lib/i18n/en.json | 8 ++ src/lib/mono/loader/Spinner.svelte | 2 + src/lib/mono/materials/Material.svelte | 3 +- src/routes/+layout.svelte | 40 ++++--- src/routes/+page.svelte | 40 +++---- 19 files changed, 175 insertions(+), 172 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 5fb6b567..4fd4d3a8 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -28,6 +28,7 @@ export default ts.config( 'svelte/require-each-key': 'off', 'svelte/prefer-writable-derived': 'off', 'no-console': 'off', + '@typescript-eslint/no-explicit-any': 'off', }, }, { diff --git a/src/app.html b/src/app.html index a23e57e7..36bc42fc 100644 --- a/src/app.html +++ b/src/app.html @@ -13,9 +13,7 @@ > -
+
%sveltekit.body%
diff --git a/src/lib/auth.svelte.ts b/src/lib/auth.svelte.ts index 54b2e84e..466aae74 100644 --- a/src/lib/auth.svelte.ts +++ b/src/lib/auth.svelte.ts @@ -237,7 +237,7 @@ class Profile { const id = Math.max(...this.meta.profiles.map(p => p.id)) + 1 this.meta.profile = id - this.meta.profiles.push({ + this.meta.profiles.unshift({ id: id, instance: instance, jwt: jwt, diff --git a/src/lib/components/lemmy/SiteCard.svelte b/src/lib/components/lemmy/SiteCard.svelte index 098ae46b..ddbb037e 100644 --- a/src/lib/components/lemmy/SiteCard.svelte +++ b/src/lib/components/lemmy/SiteCard.svelte @@ -12,13 +12,14 @@ import LabelStat from '../ui/LabelStat.svelte' import ItemList from './generic/ItemList.svelte' import { optimizeImageURL } from './post/helpers' + import type { ClassValue } from 'svelte/elements' - interface Props { + interface Props extends HTMLDivElement { site: SiteView taglines?: Tagline[] | undefined admins?: PersonView[] | undefined version?: string | undefined - class?: string + class?: ClassValue } let { @@ -30,7 +31,7 @@ }: Props = $props() -
- + diff --git a/src/lib/components/lemmy/community/CommunityCard.svelte b/src/lib/components/lemmy/community/CommunityCard.svelte index 0e61404a..628a97bd 100644 --- a/src/lib/components/lemmy/community/CommunityCard.svelte +++ b/src/lib/components/lemmy/community/CommunityCard.svelte @@ -146,11 +146,15 @@ {#await community_view} -
+
{:then community_view} -
-
+ {/await} diff --git a/src/lib/components/lemmy/post/Post.svelte b/src/lib/components/lemmy/post/Post.svelte index 5ccf209d..4f960840 100644 --- a/src/lib/components/lemmy/post/Post.svelte +++ b/src/lib/components/lemmy/post/Post.svelte @@ -1,10 +1,10 @@ -

{/if} -

+ diff --git a/src/lib/components/ui/sidebar/ProfileSelection.svelte b/src/lib/components/ui/sidebar/ProfileSelection.svelte index 9929d9c9..4d10ce52 100644 --- a/src/lib/components/ui/sidebar/ProfileSelection.svelte +++ b/src/lib/components/ui/sidebar/ProfileSelection.svelte @@ -32,6 +32,7 @@ size="md" rounding="xl" class="flex flex-row gap-2 items-center" + aria-label={$t('aria.sidebar.accounts')} > {#snippet prefix()} -