╭ changed ──────────╮ │src/embed/script.js│ ╰───────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │63 // restore focus across the swap. │ │64 grid.innerHTML = html; │ │65 }, │ │66 - _pushState: function (ptr, len) { │ │66 + _replaceState: function (ptr, len) { │ │67 const url = readWasmString(ptr, len); │ │68 - // idempotent: wasm tells us its current page every tick after a│ │69 - // change, but we don't want to add history entries for a URL │ │70 - // the browser is already on (e.g., right after the page loaded │ │71 - // from a server-side render of the same route). │ │68 + // passive same-page URL changes. replaceState changes the URL │ │69 + // without adding a history entry, so the back button isn't │ │70 + // cluttered with unnecessary entries. │ │71 if (window.location.pathname !== url) { │ │73 - history.pushState({}, "", url); │ │72 + history.replaceState({}, "", url); │ │73 } │ │74 }, │ │75 _setOverlay: function (ptr, len) { │ ╰────────────────────────────────────────────────────────────────────────────────╯