From 0d1e60bf1ddf20d63500d8b439c1174c1f160688 Mon Sep 17 00:00:00 2001 From: Coracle-Bot Date: Wed, 9 Sep 2026 01:14:19 +0000 Subject: [PATCH] Add a scroll to top button, reorder the home dashboard on narrow screens, and paint cards further ahead --- src/app/components/HomeActivity.svelte | 4 ++- src/app/components/HomeHosting.svelte | 4 ++- src/app/components/HomeNetwork.svelte | 4 ++- src/app/components/HomeNetworkItem.svelte | 5 ++-- src/app/components/HomeSection.svelte | 5 ++-- src/lib/components/ScrollToTop.svelte | 36 +++++++++++++++++++++++ src/lib/components/base.css | 1 + src/routes/home/+page.svelte | 18 ++++++++---- 8 files changed, 64 insertions(+), 13 deletions(-) create mode 100644 src/lib/components/ScrollToTop.svelte diff --git a/src/app/components/HomeActivity.svelte b/src/app/components/HomeActivity.svelte index 29082424..825ee8a5 100644 --- a/src/app/components/HomeActivity.svelte +++ b/src/app/components/HomeActivity.svelte @@ -8,10 +8,12 @@ import {displayContentCount} from "@app/content" import {inboxSpaceContent} from "@app/inbox" import {makeSpacePath} from "@app/routes" + + const {class: className = ""}: {class?: string} = $props() {#if $inboxSpaceContent.length > 0} - +
{#each $inboxSpaceContent as { url, timestamp, countsByKind } (url)} ([]) let loading = $state(true) @@ -33,7 +35,7 @@ }) - + {#snippet action()} {#if relays.length > 0} Manage diff --git a/src/app/components/HomeNetwork.svelte b/src/app/components/HomeNetwork.svelte index 9c8ef6ea..4897c333 100644 --- a/src/app/components/HomeNetwork.svelte +++ b/src/app/components/HomeNetwork.svelte @@ -16,6 +16,8 @@ import {followLists, relayLists, router, user} from "@app/core" import {isFeedLoading, makeFeed, makeFeedContext, makeScrollLoader} from "@app/feeds" + const {class: className = ""}: {class?: string} = $props() + // The hubs most of the user's follows publish to, which is the same set and the same limit // `syncFollowNetwork` reads their lists from. const RELAY_LIMIT = 8 @@ -77,7 +79,7 @@ }) - +
{#if isEmpty}
diff --git a/src/app/components/HomeNetworkItem.svelte b/src/app/components/HomeNetworkItem.svelte index 98dce5bf..377f0e56 100644 --- a/src/app/components/HomeNetworkItem.svelte +++ b/src/app/components/HomeNetworkItem.svelte @@ -2,6 +2,7 @@ import {sortBy} from "@welshman/lib" import {COMMENT, NOTE} from "@welshman/util" import type {TrustedEvent} from "@welshman/util" + import Cv from "@lib/components/Cv.svelte" import NoteItem from "@app/components/NoteItem.svelte" import CommentTree from "@app/components/CommentTree.svelte" import type {FeedContext} from "@app/feeds" @@ -29,7 +30,7 @@ ) -
+ {#if nodes.length > 0}
@@ -38,4 +39,4 @@ {/each}
{/if} -
+ diff --git a/src/app/components/HomeSection.svelte b/src/app/components/HomeSection.svelte index 57ecdcde..aca12438 100644 --- a/src/app/components/HomeSection.svelte +++ b/src/app/components/HomeSection.svelte @@ -7,12 +7,13 @@ icon: string action?: Snippet children: Snippet + class?: string } - const {title, icon, action, children}: Props = $props() + const {title, icon, action, children, class: className = ""}: Props = $props() -
+

diff --git a/src/lib/components/ScrollToTop.svelte b/src/lib/components/ScrollToTop.svelte new file mode 100644 index 00000000..a09168ec --- /dev/null +++ b/src/lib/components/ScrollToTop.svelte @@ -0,0 +1,36 @@ + + +{#if scrolled} +
+ +
+{/if} diff --git a/src/lib/components/base.css b/src/lib/components/base.css index 2b631bc6..cbbabb27 100644 --- a/src/lib/components/base.css +++ b/src/lib/components/base.css @@ -103,6 +103,7 @@ Nothing else should reach for it. */ @utility cv { content-visibility: auto; + contain-intrinsic-size: auto 16rem; } /* Marks the event a link pointed at, so the reader can pick it out of the conversation once the jump lands. Brightness rather than a background so it works over any row's own surface. */ diff --git a/src/routes/home/+page.svelte b/src/routes/home/+page.svelte index 9187e92a..814b67e2 100644 --- a/src/routes/home/+page.svelte +++ b/src/routes/home/+page.svelte @@ -5,6 +5,7 @@ import Page from "@lib/components/Page.svelte" import PageBar from "@lib/components/PageBar.svelte" import PageContent from "@lib/components/PageContent.svelte" + import ScrollToTop from "@lib/components/ScrollToTop.svelte" import HomeInbox from "@app/components/HomeInbox.svelte" import HomeActivity from "@app/components/HomeActivity.svelte" import HomeNetwork from "@app/components/HomeNetwork.svelte" @@ -14,6 +15,8 @@ import {HOSTING_ENABLED} from "@app/hosting" import {PLATFORM_RELAYS} from "@app/env" + let element: Element | undefined = $state() + const today = new Date().toLocaleDateString(undefined, { weekday: "long", month: "short", @@ -38,19 +41,22 @@

- +
-
+ +
- - + +
-
+
{#if HOSTING_ENABLED} - + {/if}
+