From 9ae1148a43628c4a1116349af77a13ddcccd0f7d Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Sun, 13 Sep 2026 14:58:31 -0400 Subject: [PATCH] ac: a rewritten URL should keep what describes the view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `nogap`, `nolabel` and `autoreload` say what kind of view this is, not which piece it is showing, so the worker's URL rewrite drops them along with the old slug. Everything that reloads afterwards then comes back as a plain page — and the update auto-reload is exactly such a reload, which is how a preview card that was clean on arrival grew its corner label back an hour later, on a deploy. They are re-attached on rewrite now, from the same `preservedParams` the explicit reload path has always used. Co-Authored-By: Claude Opus 5 (1M context) --- system/public/aesthetic.computer/bios.mjs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/system/public/aesthetic.computer/bios.mjs b/system/public/aesthetic.computer/bios.mjs index 4bc778a3e2..e99ff0f078 100644 --- a/system/public/aesthetic.computer/bios.mjs +++ b/system/public/aesthetic.computer/bios.mjs @@ -619,7 +619,24 @@ function setUpdateAutoReload(enabled) { function performHistoryRewrite(path, historical) { // Skip history manipulation in pack mode (blob/srcdoc context) if (checkPackMode()) return; - + + // The params that describe the embedding rather than the piece — nogap, + // nolabel, autoreload — are no part of a piece's address, so the worker's + // rewrite naturally drops them. Anything that reloads the view afterwards + // then comes back as a plain page: the corner label returns, and a preview + // card starts offering updates nobody can reach it to accept. The update + // auto-reload is exactly such a reload, which is how a card that was clean + // on arrival grew its label back an hour later. + try { + const next = new URL(path, window.location.href); + for (const [name, value] of Object.entries(preservedParams || {})) { + if (value) next.searchParams.set(name, value); + } + path = next.pathname + next.search + next.hash; + } catch (err) { + /* An unparseable path is rewritten as given, the way it always was. */ + } + if (historical) { console.log("Rewriting to:", path); history.pushState("", document.title, path); -- 2.51.2