fix: expand and display tag name in list view (#742)

Co-authored-by: Christian Beutel <>
Co-authored-by: Flomp <Flomp@users.noreply.github.com>
This commit is contained in:
Martin Schmidt
2026-02-20 11:00:04 +01:00
committed by GitHub
parent b09b7d51a2
commit be8465be78
2 changed files with 6 additions and 6 deletions

View File

@@ -130,13 +130,13 @@
{handleFromRecordWithIRI(trail)} {handleFromRecordWithIRI(trail)}
</p> </p>
{/if} {/if}
{#if trail.tags.length} {#if trail.tags.length && trail.expand?.tags}
<div class="flex flex-wrap gap-1 mb-3 items-center"> <div class="flex flex-wrap gap-1 mb-3 items-center">
{#each expandedTags ? trail.tags : trail.tags.slice(0, 2) as t} {#each expandedTags ? trail.expand.tags : trail.expand.tags.slice(0, 2) as tag}
<Chip text={t} closable={false} primary={false}></Chip> <Chip text={tag.name} closable={false} primary={false}></Chip>
{/each} {/each}
{#if trail.tags.length > 2} {#if trail.expand.tags.length > 2}
<button <button
onclick={toggleExpandTags} onclick={toggleExpandTags}
class="text-sm text-gray-500 hover:underline focus:outline-none" class="text-sm text-gray-500 hover:underline focus:outline-none"
@@ -145,7 +145,7 @@
{#if expandedTags} {#if expandedTags}
Show less Show less
{:else} {:else}
+{trail.tags.length - 2} more +{trail.expand.tags.length - 2} more
{/if} {/if}
</button> </button>
{/if} {/if}

View File

@@ -79,7 +79,7 @@ export async function lists_search_filter(filter: ListFilter, page: number = 1,
export async function lists_show(id: string, handle?: string, f: (url: RequestInfo | URL, config?: RequestInit) => Promise<Response> = fetch) { export async function lists_show(id: string, handle?: string, f: (url: RequestInfo | URL, config?: RequestInit) => Promise<Response> = fetch) {
const r = await f(`/api/v1/list/${id}?` + new URLSearchParams({ const r = await f(`/api/v1/list/${id}?` + new URLSearchParams({
expand: "author,trails,trails.author,trails.category,list_share_via_list.actor", expand: "author,trails,trails.author,trails.category,trails.tags,list_share_via_list.actor",
...(handle ? { handle } : {}) ...(handle ? { handle } : {})
}), { }), {
method: 'GET', method: 'GET',