bug: notification deep-link does not scroll to comment on document detail page #299

Merged
marcel merged 8 commits from feat/issue-276-notification-deep-link-scroll into main 2026-04-21 15:06:02 +02:00
Showing only changes of commit 3bf0b38c42 - Show all commits

View File

@@ -291,6 +291,11 @@ $effect(() => {
let navHeight = $state(0);
async function waitForPanelRender(): Promise<void> {
await tick();
await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()));
}
onMount(() => {
navHeight = document.querySelector('header')?.getBoundingClientRect().height ?? 0;
@@ -311,13 +316,10 @@ onMount(() => {
setTimeout(() => (flashAnnotationId = null), prefersReducedMotion ? 2000 : 1500);
},
prefersReducedMotion,
afterTick: async () => {
await tick();
await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()));
},
afterTick: waitForPanelRender,
getElement: (id) => document.getElementById(id),
onStripUrl: () => replaceState(page.url.pathname, page.state)
});
onStripUrl: () => replaceState(page.url.pathname, page.state ?? {})
}).catch((e) => console.error('deep-link scroll failed', e));
function onKeyDown(e: KeyboardEvent) {
if (e.key === 'Escape' && transcribeMode) {