From 1d5ca133218f39dddc2328772665cd77806d6997 Mon Sep 17 00:00:00 2001 From: Sabine Maennel <5292683+sabinem@users.noreply.github.com> Date: Mon, 31 Aug 2026 21:14:41 +0200 Subject: [PATCH] fix(frontend): project rows show a 100-character markdown excerpt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A project description is authored in the markdown editor, but the list row printed it as source: rows opened with a literal "## Abstract summary of the project proposal and context ## Goal", and since nothing capped or clamped the text, a full body rendered five lines deep. A list whose job is telling projects apart was neither readable nor scannable. The loaders now flatten the markdown and cut it to a hundred characters with markdownExcerpt — the same treatment the Pages list already gives page bodies. The card's prop is renamed description -> excerpt, because a prop that must secretly be pre-flattened is how the raw body finds its way back in. The rest of the description lives one click away, behind More Info. Flattening in the loader rather than the row also keeps whole descriptions off the wire for every row of every list. --- .../components/hackathon/ProjectCard.svelte | 25 ++++++++++++++----- .../frontend/src/lib/utils/projectExcerpt.ts | 12 +++++++++ .../hackathon/[id]/projects/+page.server.ts | 6 +++-- .../my/hackathon/[id]/projects/+page.svelte | 4 +-- .../[id]/projects/manage/+page.server.ts | 4 ++- .../[id]/projects/manage/+page.svelte | 2 +- 6 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 components/frontend/src/lib/utils/projectExcerpt.ts diff --git a/components/frontend/src/lib/components/hackathon/ProjectCard.svelte b/components/frontend/src/lib/components/hackathon/ProjectCard.svelte index 1d23c834..abf8f20c 100644 --- a/components/frontend/src/lib/components/hackathon/ProjectCard.svelte +++ b/components/frontend/src/lib/components/hackathon/ProjectCard.svelte @@ -7,7 +7,7 @@ let { num, title, - description, + excerpt, creator, track, imageUrl, @@ -19,7 +19,10 @@ }: { num: number; title: string; - description: string; + /** The description, flattened out of markdown and cut to a row's worth + * by the loader — never the raw body. Absent when the project has no + * description, or has one with nothing quotable in it. */ + excerpt?: string; /** Who proposed it. Omitted when the creator is no longer a member. */ creator?: string; /** Track name. Omitted when the project has no track, or its track was @@ -76,10 +79,20 @@ -

- {description} -

+ keeps the measure readable at any container width. + + Two lines and no more. The loader already cut the text to a hundred + characters, so the clamp is only what holds on a narrow screen, + where those hundred characters still run to three lines and the row + stops being scannable. --> + {#if excerpt} +

+ {excerpt} +

+ {/if}