Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

fix(web): build the skip link from the absolute page URL

AkitaOnRails684f0db4513a
diff --git a/crates/ai-memory-web/templates/base.html b/crates/ai-memory-web/templates/base.html
index f6fb5f84..ed111cfc 100644
--- a/crates/ai-memory-web/templates/base.html
+++ b/crates/ai-memory-web/templates/base.html
@@ -11,9 +11,11 @@
<a id="skip-link" href="#main-content" class="sr-only focus:not-sr-only focus:absolute focus:left-4 focus:top-2 focus:z-20 focus:rounded-md focus:bg-white focus:px-3 focus:py-1.5 focus:text-sm focus:font-medium focus:text-blue-700 dark:focus:bg-slate-900 dark:focus:text-blue-400">Skip to content</a>
<script>
// The injected <base href> would send a bare "#main-content" to the web root.
+ // Build from the absolute URL: a pathname starting with "//" would otherwise
+ // become a link to another host.
(function () {
var a = document.getElementById("skip-link");
- if (a) a.setAttribute("href", location.pathname + location.search + "#main-content");
+ if (a) a.setAttribute("href", location.href.split("#")[0] + "#main-content");
})();
</script>
<header class="border-b border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-950 sticky top-0 z-10">