aboutsummaryrefslogtreecommitdiffstats
path: root/build.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-01 22:48:11 -0700
committerAdam Soltys <[email protected]>2026-10-01 22:48:11 -0700
commit23f18ff13e0a8c612d04727de2ccfadf2d13ff7c (patch)
tree578915726c8b4285d6e0dcaedb6d24049996d773 /build.js
parentc6b279abd5e502ce05c1418797714782356b7707 (diff)
downloadcoinosv3-23f18ff13e0a8c612d04727de2ccfadf2d13ff7c.tar.gz
coinosv3-23f18ff13e0a8c612d04727de2ccfadf2d13ff7c.zip
Shared note links open on the post, with names and faces
The server renders /nevent1 and /note1 pages with the thread inlined (post, root, replies, kind 0s) and Open Graph tags; the client seeds its thread cache from it and opens the thread on the first paint. Without it, a pending frame holds the screen instead of the front door. Profile lookups ask our relays and the profile indexes at once, streamed, instead of one after the other behind five-second waits. A thread opened straight from a link has no Back button. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'build.js')
-rw-r--r--build.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/build.js b/build.js
index 1fdd889..c90656f 100644
--- a/build.js
+++ b/build.js
@@ -88,9 +88,13 @@ self.addEventListener('fetch', (e) => {
if (u.pathname === '/api/feed') return;
if (req.mode === 'navigate') {
+ // A note page comes back with its thread rendered into it (the server's
+ // note-page); that copy must not become the offline shell for every path.
+ const notePage = /^\\/(note|nevent)1/i.test(u.pathname);
e.respondWith(
fetch(req)
.then((res) => {
+ if (notePage) return res;
const copy = res.clone();
caches.open(CACHE).then((c) => c.put('./', copy));
return res;
@@ -369,7 +373,7 @@ function bootShell(logo, staging) {
: '<span class="beta-badge">v3 beta</span>';
return `<div class="col" style="gap:16px"><div class="row between"><div class="brand ${staging ? 'staging' : 'beta'}">${badge}<div class="logo-full" aria-label="coinos" role="img">${logo}</div></div></div><div class="card col" id="boot-shell" style="gap:12px;display:none"><div class="row gap6" style="align-items:center"><div class="chat-avatar profile-avatar fallback loading"></div><div class="chat-title" id="boot-shell-name"></div></div></div></div>`;
}
-const BOOT_SHELL_SCRIPT = `<script>try{var m=location.pathname.match(/^\\/([A-Za-z0-9._-]{1,64})\\/?$/);if(m){document.getElementById('boot-shell').style.display='';document.getElementById('boot-shell-name').textContent=decodeURIComponent(m[1]);}}catch(e){}</script>`;
+const BOOT_SHELL_SCRIPT = `<script>try{var m=location.pathname.match(/^\\/([A-Za-z0-9._-]{1,64})\\/?$/);if(m&&!/^(note|nevent|naddr)1/i.test(m[1])){document.getElementById('boot-shell').style.display='';document.getElementById('boot-shell-name').textContent=decodeURIComponent(m[1]);}}catch(e){}</script>`;
// HAL_NO_SW=1: the page registers no service worker. The Android bundled
// build serves this page from its own assets, where a worker would only