Improve mode transitions and add nav perf instrumentation

This commit is contained in:
Smittix
2026-02-23 18:14:31 +00:00
parent c31ed14041
commit 3acdab816a
4 changed files with 218 additions and 18 deletions

View File

@@ -18,6 +18,18 @@
if (menuLink) {
event.preventDefault();
event.stopPropagation();
try {
const target = new URL(menuLink.href, window.location.href);
if (window.InterceptNavPerf && typeof window.InterceptNavPerf.markStart === 'function') {
window.InterceptNavPerf.markStart({
targetPath: target.pathname,
trigger: 'global-nav',
sourceMode: document.body?.getAttribute('data-mode') || null,
});
}
} catch (_) {
// Ignore malformed link targets.
}
window.location.href = menuLink.href;
return;
}