From 922a0996e5a5c3e82611aad7f344473ad3bea827 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Fri, 14 Aug 2026 16:06:17 -0700 Subject: [PATCH] Tweak how the library page renders --- src/app/components/BoardMenu.svelte | 59 +++++ src/app/components/PinboardItem.svelte | 42 ++-- src/app/routes.ts | 13 +- .../spaces/[relay]/library/+page.svelte | 64 ++++- .../[relay]/library/[address]/+page.svelte | 229 ------------------ 5 files changed, 141 insertions(+), 266 deletions(-) delete mode 100644 src/routes/spaces/[relay]/library/[address]/+page.svelte diff --git a/src/app/components/BoardMenu.svelte b/src/app/components/BoardMenu.svelte index bc9e9cea..f9d84b5f 100644 --- a/src/app/components/BoardMenu.svelte +++ b/src/app/components/BoardMenu.svelte @@ -1,13 +1,23 @@ -
+
+
-
- {board.title() || "Untitled shelf"} - {#if board.description()} - {board.description()} - {/if} -
- {#each $pins.slice(0, 1) as pin (pin.id())} - - {/each} - - - View all content -
diff --git a/src/app/routes.ts b/src/app/routes.ts index 20a11dc6..c0e478b5 100644 --- a/src/app/routes.ts +++ b/src/app/routes.ts @@ -135,8 +135,17 @@ export const makeCalendarPath = (url: string, address?: string) => export const makePollPath = (url: string, id?: string) => makeSpacePath(url, "polls", id) -export const makeLibraryPath = (url: string, address?: string) => - makeSpacePath(url, "library", address) +// Shelves are selected in place on the library page rather than having their own +// route, so the address goes in a query param. +export const makeLibraryPath = (url: string, address?: string) => { + const path = makeSpacePath(url, "library") + + if (address) { + return path + "?" + new URLSearchParams({board: address}).toString() + } + + return path +} export const makeContentPath = (url: string, kind: number, idOrAddress?: string) => { switch (kind) { diff --git a/src/routes/spaces/[relay]/library/+page.svelte b/src/routes/spaces/[relay]/library/+page.svelte index 003183dc..3ec699a5 100644 --- a/src/routes/spaces/[relay]/library/+page.svelte +++ b/src/routes/spaces/[relay]/library/+page.svelte @@ -1,22 +1,28 @@ - - - {#snippet title()} -

{$board?.title() || "Shelf"}

- {/snippet} - {#snippet action()} -
- - {#if menuOpen} - - - - {/if} -
- {/snippet} -
- - - {#if $board} - {#if $pins.length === 0} -
-

This shelf doesn't have any links yet.

- {#if $canManage} - - {/if} -
- {:else} - - {#if filtered.length === 0} -

No links found.

- {:else} - pin.id()} columnWidth={60} gap={3}> - {#snippet child(pin)} - - {/snippet} - - {/if} - {/if} - {:else} -
- {#await sleep(5000)} - Loading shelf... - {:then} -

Failed to load shelf.

- {/await} -
- {/if} -