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 <noreply@anthropic.com>
This commit is contained in:
@@ -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), {
|
scrollToCommentFromQuery(new URL(page.url), {
|
||||||
transcribeMode,
|
transcribeMode,
|
||||||
setTranscribeMode: (v) => (transcribeMode = v),
|
setTranscribeMode: (v) => (transcribeMode = v),
|
||||||
|
|||||||
Reference in New Issue
Block a user