From 690eb234c44031bf4764907db02ba1cd8ef6e156 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 29 Apr 2026 21:25:35 +0200 Subject: [PATCH 1/4] feat(SegmentationColumn): deep-link to transcription panel via ?task=transcribe Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/lib/components/SegmentationColumn.svelte | 2 +- frontend/src/lib/components/SegmentationColumn.svelte.spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/components/SegmentationColumn.svelte b/frontend/src/lib/components/SegmentationColumn.svelte index b46153c6..e0ce338d 100644 --- a/frontend/src/lib/components/SegmentationColumn.svelte +++ b/frontend/src/lib/components/SegmentationColumn.svelte @@ -36,7 +36,7 @@ let { docs, weeklyCount }: Props = $props(); {#each docs as doc (doc.id)}
  • {doc.title} diff --git a/frontend/src/lib/components/SegmentationColumn.svelte.spec.ts b/frontend/src/lib/components/SegmentationColumn.svelte.spec.ts index 8f0c538d..0e03d0e8 100644 --- a/frontend/src/lib/components/SegmentationColumn.svelte.spec.ts +++ b/frontend/src/lib/components/SegmentationColumn.svelte.spec.ts @@ -56,12 +56,12 @@ describe('SegmentationColumn', () => { await expect.element(page.getByText(/diese Woche/)).not.toBeInTheDocument(); }); - it('links to /documents/{id}', async () => { + it('links to /documents/{id}?task=transcribe', async () => { const doc = makeDoc({ id: 'abc-123', title: 'Verlinktes Dokument' }); render(SegmentationColumn, { props: { docs: [doc], weeklyCount: 0 } }); const link = page.getByRole('link', { name: /Verlinktes Dokument/ }); - await expect.element(link).toHaveAttribute('href', '/documents/abc-123'); + await expect.element(link).toHaveAttribute('href', '/documents/abc-123?task=transcribe'); }); }); -- 2.49.1 From 6f40b2c32de21ade4662523fff62a6f9b178919b Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 29 Apr 2026 21:27:28 +0200 Subject: [PATCH 2/4] feat(TranscriptionColumn): deep-link to transcription panel via ?task=transcribe Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/lib/components/TranscriptionColumn.svelte | 2 +- .../src/lib/components/TranscriptionColumn.svelte.spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/components/TranscriptionColumn.svelte b/frontend/src/lib/components/TranscriptionColumn.svelte index 9c168f98..19b40950 100644 --- a/frontend/src/lib/components/TranscriptionColumn.svelte +++ b/frontend/src/lib/components/TranscriptionColumn.svelte @@ -41,7 +41,7 @@ function blockProgress(doc: TranscriptionQueueItemDTO): number { {#each docs as doc (doc.id)}
  • {doc.title} diff --git a/frontend/src/lib/components/TranscriptionColumn.svelte.spec.ts b/frontend/src/lib/components/TranscriptionColumn.svelte.spec.ts index 05b09d9b..845fedce 100644 --- a/frontend/src/lib/components/TranscriptionColumn.svelte.spec.ts +++ b/frontend/src/lib/components/TranscriptionColumn.svelte.spec.ts @@ -74,12 +74,12 @@ describe('TranscriptionColumn', () => { expect(dashEl?.textContent?.trim()).toBe('—'); }); - it('links to /documents/{id}', async () => { + it('links to /documents/{id}?task=transcribe', async () => { const doc = makeDoc({ id: 'xyz-456', title: 'Transkriptions Dokument' }); render(TranscriptionColumn, { props: { docs: [doc], weeklyCount: 0 } }); const link = page.getByRole('link', { name: /Transkriptions Dokument/ }); - await expect.element(link).toHaveAttribute('href', '/documents/xyz-456'); + await expect.element(link).toHaveAttribute('href', '/documents/xyz-456?task=transcribe'); }); }); -- 2.49.1 From 84ba728e080e53eef6cac3ba9dcd0b4420016e14 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 29 Apr 2026 21:30:23 +0200 Subject: [PATCH 3/4] feat(document-page): auto-open transcription panel when ?task=transcribe is present On mount, reads the task query param before the comment deep-link handler. When task=transcribe, opens the transcription panel, scrolls the close button into view, moves focus to it, then strips the param from the URL via replaceState. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/routes/documents/[id]/+page.svelte | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/frontend/src/routes/documents/[id]/+page.svelte b/frontend/src/routes/documents/[id]/+page.svelte index a62fb70c..fbec8612 100644 --- a/frontend/src/routes/documents/[id]/+page.svelte +++ b/frontend/src/routes/documents/[id]/+page.svelte @@ -362,6 +362,19 @@ onMount(() => { ); } + if (page.url.searchParams.get('task') === 'transcribe') { + transcribeMode = true; + tick().then(() => { + const closeBtn = document.querySelector('[data-testid="panel-close"]'); + closeBtn?.scrollIntoView({ + behavior: prefersReducedMotion ? 'instant' : 'smooth', + block: 'nearest' + }); + closeBtn?.focus({ preventScroll: true }); + replaceState(page.url.pathname, page.state ?? {}); + }); + } + scrollToCommentFromQuery(new URL(page.url), { transcribeMode, setTranscribeMode: (v) => (transcribeMode = v), -- 2.49.1 From a81a6e725377bdc3cb56670ea64eea5c08dc44d1 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 29 Apr 2026 21:34:41 +0200 Subject: [PATCH 4/4] fix(document-page): add .catch() to task deep-link tick promise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addresses @felix — tick().then() had no error handler; console.error is now logged on failure, matching the existing deep-link scroll pattern. Co-Authored-By: Claude Sonnet 4.6 --- .../src/routes/documents/[id]/+page.svelte | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/frontend/src/routes/documents/[id]/+page.svelte b/frontend/src/routes/documents/[id]/+page.svelte index fbec8612..69f24b50 100644 --- a/frontend/src/routes/documents/[id]/+page.svelte +++ b/frontend/src/routes/documents/[id]/+page.svelte @@ -364,15 +364,17 @@ onMount(() => { if (page.url.searchParams.get('task') === 'transcribe') { transcribeMode = true; - tick().then(() => { - const closeBtn = document.querySelector('[data-testid="panel-close"]'); - closeBtn?.scrollIntoView({ - behavior: prefersReducedMotion ? 'instant' : 'smooth', - block: 'nearest' - }); - closeBtn?.focus({ preventScroll: true }); - replaceState(page.url.pathname, page.state ?? {}); - }); + tick() + .then(() => { + const closeBtn = document.querySelector('[data-testid="panel-close"]'); + closeBtn?.scrollIntoView({ + behavior: prefersReducedMotion ? 'instant' : 'smooth', + block: 'nearest' + }); + closeBtn?.focus({ preventScroll: true }); + replaceState(page.url.pathname, page.state ?? {}); + }) + .catch((e) => console.error('task deep-link failed', e)); } scrollToCommentFromQuery(new URL(page.url), { -- 2.49.1