diff --git a/frontend/src/lib/components/chronik/ChronikFuerDichBox.svelte b/frontend/src/lib/components/chronik/ChronikFuerDichBox.svelte index fd4b94f9..82f9a6e6 100644 --- a/frontend/src/lib/components/chronik/ChronikFuerDichBox.svelte +++ b/frontend/src/lib/components/chronik/ChronikFuerDichBox.svelte @@ -2,6 +2,7 @@ import * as m from '$lib/paraglide/messages.js'; import { relativeTime } from '$lib/utils/time'; import type { NotificationItem } from '$lib/stores/notifications.svelte'; +import { buildCommentHref } from '$lib/utils/commentDeepLink'; interface Props { unread: NotificationItem[]; @@ -18,7 +19,7 @@ function verb(type: NotificationItem['type'], actor: string): string { } function href(n: NotificationItem): string { - return `/documents/${n.documentId}?commentId=${n.referenceId}`; + return buildCommentHref(n.documentId, n.referenceId, n.annotationId); } diff --git a/frontend/src/lib/components/chronik/ChronikFuerDichBox.svelte.spec.ts b/frontend/src/lib/components/chronik/ChronikFuerDichBox.svelte.spec.ts index edb53951..3bea1aae 100644 --- a/frontend/src/lib/components/chronik/ChronikFuerDichBox.svelte.spec.ts +++ b/frontend/src/lib/components/chronik/ChronikFuerDichBox.svelte.spec.ts @@ -114,6 +114,25 @@ describe('ChronikFuerDichBox', () => { expect(onMarkRead.mock.calls[0][0]).toEqual(n); }); + it('mention row href includes both commentId and annotationId when annotationId is present', async () => { + render(ChronikFuerDichBox, { + unread: [ + notif({ + id: 'n-link', + documentId: 'doc-42', + referenceId: 'comment-7', + annotationId: 'annot-9' + }) + ], + onMarkRead: vi.fn(), + onMarkAllRead: vi.fn() + }); + const link = document.querySelector( + 'a[href="/documents/doc-42?commentId=comment-7&annotationId=annot-9"]' + ); + expect(link).not.toBeNull(); + }); + it('Dismiss button is a sibling of the document link, never nested inside ', async () => { render(ChronikFuerDichBox, { unread: [notif({ id: 'x' })],