Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(prompt): suppress stale "(N behind)" version badge on local dev

The .commit-ref on a dev checkout can be a stale leftover from a
prior deploy, making the version API report a large behindBy count.
Use the `debug` flag (true on localhost and codespaces) to zero out
behindBy and remap "unknown" → "dev" — no user is deploying from a
dev tree, so the badge should just say "dev".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+6 -2
+6 -2
system/public/aesthetic.computer/disks/prompt.mjs
··· 714 714 notice, 715 715 dark, 716 716 store, 717 + debug, 717 718 // code, 718 719 net: { socket }, 719 720 vscode, ··· 757 758 const res = await fetch("/api/version"); 758 759 if (!res.ok) throw new Error(`HTTP ${res.status}`); 759 760 versionInfo = await res.json(); 760 - if (location.hostname === "localhost" || location.hostname === "127.0.0.1") { 761 + // Local/dev: never show "(N behind)" — the .commit-ref on a dev 762 + // checkout can be stale and the user isn't deploying anything. 763 + if (debug) { 761 764 versionInfo = { 762 765 ...versionInfo, 763 766 deployed: versionInfo.deployed === "unknown" ? "dev" : versionInfo.deployed, 764 767 status: "local", 768 + behindBy: 0, 765 769 }; 766 770 } 767 771 // Store recent commits from the version API ··· 775 779 776 780 // Long-poll loop: detect new deployments within ~5 seconds 777 781 const startVersionPoll = async () => { 778 - if (location.hostname === "localhost" || location.hostname === "127.0.0.1") { 782 + if (debug) { 779 783 // Local dev: just poll every 60 seconds 780 784 setInterval(fetchVersion, 60 * 1000); 781 785 return;