aboutsummaryrefslogtreecommitdiffstats
path: root/feed/note-page.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-07 13:10:43 -0700
committerAdam Soltys <[email protected]>2026-10-07 13:10:43 -0700
commitc82e042aa592e4e619d0c280b02486eeb859d358 (patch)
tree6fb03c99cf227789ea7773128f935a317fc40411 /feed/note-page.js
parent6faf6b6fe49b8e51a38e0106c858341faf2145ef (diff)
downloadcoinosv3-c82e042aa592e4e619d0c280b02486eeb859d358.tar.gz
coinosv3-c82e042aa592e4e619d0c280b02486eeb859d358.zip
Profile links paint whole on the first frame: the server renders /npub1…, /nprofile1… and /<name> with the kind 0, latest posts, follow counts and mentioned faces inlined (stale-while-refresh cache, 2 s budget), the app seeds its caches from it, and the big avatar never flashes punk art while a lookup runs
A cold visit to a profile link showed a punk, '–' counts and no posts for 9 s. Server-side relay answers settle once events stop arriving (idle 400 ms) instead of waiting out a relay that never sends EOSE: a cold build is ~1.9 s. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'feed/note-page.js')
-rw-r--r--feed/note-page.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/feed/note-page.js b/feed/note-page.js
index f4dc08e..3145f14 100644
--- a/feed/note-page.js
+++ b/feed/note-page.js
@@ -117,9 +117,9 @@ export function createThreadCache({ build, now = Date.now }) {
return { get, refresh };
}
-const esc = (s) => String(s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
+export const esc = (s) => String(s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
// JSON inside a script tag: nothing in it may close the tag or open a comment
-const scriptJson = (v) => JSON.stringify(v).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
+export const scriptJson = (v) => JSON.stringify(v).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
function nameOf(data, pk) {
const p = (data.profiles || []).find((e) => e.pubkey === pk);