diff --git a/src/app/os/keys/page.tsx b/src/app/os/keys/page.tsx index e31dc8b..48f38d6 100644 --- a/src/app/os/keys/page.tsx +++ b/src/app/os/keys/page.tsx @@ -544,6 +544,11 @@ export default function Keys() { if (ns) next.set("ns", ns); else next.delete("ns"); window.history.replaceState(null, "", `?${next.toString()}`); + // A new namespace is a new list: start it from the top, or a shorter + // list leaves the page scrolled past its end and looking empty. The + // tree stays in view: it is sticky beside the list, or above it on + // narrow screens. + window.scrollTo({ top: 0 }); }, []); // A namespace with no (matching) keys falls back to all keys. const activeNs = findNamespace(keyTree, selectedNs) ? selectedNs : "";