Compare commits

...

3 Commits

Author SHA1 Message Date
Marcel
84ba728e08 feat(document-page): auto-open transcription panel when ?task=transcribe is present
Some checks failed
CI / OCR Service Tests (push) Has been cancelled
CI / Backend Unit Tests (push) Has been cancelled
CI / Unit & Component Tests (push) Failing after 3m36s
CI / Unit & Component Tests (pull_request) Failing after 3m34s
CI / OCR Service Tests (pull_request) Successful in 39s
CI / Backend Unit Tests (pull_request) Failing after 3m12s
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 <noreply@anthropic.com>
2026-04-29 21:30:23 +02:00
Marcel
6f40b2c32d feat(TranscriptionColumn): deep-link to transcription panel via ?task=transcribe
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 21:27:28 +02:00
Marcel
690eb234c4 feat(SegmentationColumn): deep-link to transcription panel via ?task=transcribe
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 21:25:35 +02:00
5 changed files with 19 additions and 6 deletions

View File

@@ -36,7 +36,7 @@ let { docs, weeklyCount }: Props = $props();
{#each docs as doc (doc.id)}
<li>
<a
href="/documents/{doc.id}"
href="/documents/{doc.id}?task=transcribe"
class="flex min-h-[44px] flex-col justify-center rounded px-1 py-2 hover:bg-canvas focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:outline-none"
>
<span class="font-serif text-sm text-ink">{doc.title}</span>

View File

@@ -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');
});
});

View File

@@ -41,7 +41,7 @@ function blockProgress(doc: TranscriptionQueueItemDTO): number {
{#each docs as doc (doc.id)}
<li>
<a
href="/documents/{doc.id}"
href="/documents/{doc.id}?task=transcribe"
class="flex min-h-[44px] flex-col justify-center rounded px-1 py-2 hover:bg-canvas focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:outline-none"
>
<span class="font-serif text-sm text-ink">{doc.title}</span>

View File

@@ -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');
});
});

View File

@@ -362,6 +362,19 @@ onMount(() => {
);
}
if (page.url.searchParams.get('task') === 'transcribe') {
transcribeMode = true;
tick().then(() => {
const closeBtn = document.querySelector<HTMLElement>('[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),