From 7c22e42b8fc577adb8e4890f250d4308f4c14dad Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 21 Apr 2026 17:17:57 +0200 Subject: [PATCH] refactor(notification-bell): use buildCommentHref helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drops the inline conditional href construction in favour of the shared helper. Identical URL shape — behaviour preserved. Refs #300. Co-Authored-By: Claude Opus 4.7 (1M context) --- frontend/src/lib/components/NotificationBell.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/components/NotificationBell.svelte b/frontend/src/lib/components/NotificationBell.svelte index 03f5398a..0e390357 100644 --- a/frontend/src/lib/components/NotificationBell.svelte +++ b/frontend/src/lib/components/NotificationBell.svelte @@ -4,6 +4,7 @@ import { goto } from '$app/navigation'; import { m } from '$lib/paraglide/messages.js'; import { clickOutside } from '$lib/actions/clickOutside'; import { notificationStore } from '$lib/stores/notifications.svelte'; +import { buildCommentHref } from '$lib/utils/commentDeepLink'; import NotificationDropdown from './NotificationDropdown.svelte'; let open = $state(false); @@ -31,9 +32,11 @@ function closeDropdown() { async function handleMarkRead(notification: Parameters[0]) { await stream.markRead(notification); - const url = notification.annotationId - ? `/documents/${notification.documentId}?commentId=${notification.referenceId}&annotationId=${notification.annotationId}` - : `/documents/${notification.documentId}?commentId=${notification.referenceId}`; + const url = buildCommentHref( + notification.documentId, + notification.referenceId, + notification.annotationId + ); closeDropdown(); goto(url); }