From ef6c6bdcab12033d5f188e95107d11ec44418634 Mon Sep 17 00:00:00 2001 From: eti Date: Tue, 13 Oct 2026 22:24:30 +0200 Subject: [PATCH] web/lib: fit long subject ids in notification rows, drop title fallback Signed-off-by: eti --- web/src/lib/api/notifications.ts | 2 +- .../notifications/NotificationItem.svelte | 16 +++++++++++----- web/src/lib/components/notifications/types.ts | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/web/src/lib/api/notifications.ts b/web/src/lib/api/notifications.ts index 16cd768fb..00524f01b 100644 --- a/web/src/lib/api/notifications.ts +++ b/web/src/lib/api/notifications.ts @@ -106,7 +106,7 @@ const subjectFromUri = ( kind, uri, number: rkeyFromUri(uri), - title: title ?? rkeyFromUri(uri) + title }); /** resolve rows best-effort: missing actor, repo, or entity falls back to the raw value */ diff --git a/web/src/lib/components/notifications/NotificationItem.svelte b/web/src/lib/components/notifications/NotificationItem.svelte index c6f9f0b6f..59f6f874f 100644 --- a/web/src/lib/components/notifications/NotificationItem.svelte +++ b/web/src/lib/components/notifications/NotificationItem.svelte @@ -15,8 +15,10 @@ timing: "relative flex items-center", time: "typography-paragraph-small whitespace-nowrap text-foreground-subtle", toggle: "absolute inset-0 z-10 hidden items-center justify-end text-foreground-placeholder hover:cursor-pointer hover:text-foreground-muted md:group-hover/notification:flex", - number: "col-start-1 row-start-2 text-left typography-paragraph-small text-foreground-subtle", - title: "col-start-2 row-start-2 truncate typography-paragraph-small text-foreground-subtle" + subject: + "col-span-2 col-start-2 row-start-2 flex min-w-0 gap-xs typography-paragraph-small text-foreground-subtle", + number: "shrink-0", + title: "truncate" }, variants: { read: { @@ -86,7 +88,7 @@ handle={notification.actor.handle} did={notification.actor.did} size="small" - class="shrink-0" + class="min-w-0" /> @@ -125,7 +127,11 @@ {#if notification.subject} - #{notification.subject.number} -
{notification.subject.title}
+
+ #{notification.subject.number} + {#if notification.subject.title} + {notification.subject.title} + {/if} +
{/if} diff --git a/web/src/lib/components/notifications/types.ts b/web/src/lib/components/notifications/types.ts index b1ad1f6a8..96b3f76a0 100644 --- a/web/src/lib/components/notifications/types.ts +++ b/web/src/lib/components/notifications/types.ts @@ -36,7 +36,7 @@ export interface NotificationSubject { kind: "issue" | "pull"; uri: string; number: string; - title: string; + title?: string; } export interface NotificationSummary { -- 2.54.0