diff options
| author | Adam Soltys <[email protected]> | 2026-09-04 08:55:45 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-04 08:55:45 -0700 |
| commit | a6851ae954d819b116aae6b19b175525f1488928 (patch) | |
| tree | cc7768cd754b2cb6077b2390e18cdbf3501ca289 /src/app.js | |
| parent | 174ce1027327230154b37b80e44c6b2d45929101 (diff) | |
| download | coinosv3-a6851ae954d819b116aae6b19b175525f1488928.tar.gz coinosv3-a6851ae954d819b116aae6b19b175525f1488928.zip | |
Public read-only coinos community chat at /chat — a share-anywhere link that shows the live chat history to anyone, logged in or not, with a "Sign in to chat" button ("Open coinos" when the device already has an account). No server-side decoder needed: the community's join material was already public by construction (baked into the client bundle — every coinos user is meant to be a member), so the page derives the stream keys and decrypts wraps client-side exactly like the app's Chat tab, worker-offloaded with the same sliced fallback. Renders messages + edits + deletes + reactions and honors the folded control state's ban list; presence/typing/guestbook deliberately omitted. Profiles come from ONE batched kind-0 query per burst (a REQ per author tripped relay concurrency limits). Plumbing: the join material moved to src/community.js (shared with messages.js so they can never drift), /chat is excluded from the single-segment profile deep-link (which was eating the path and rewriting the URL before the route ran), and app renders stand down in public-chat mode so a feature-init render can't paint onboarding over the page. Verified headless against the live relays: 59 messages decrypt, ban-fold applies, names resolve
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MGzU12QrAA4G6BYGzGVdXz
Diffstat (limited to 'src/app.js')
| -rw-r--r-- | src/app.js | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -428,7 +428,12 @@ function animatedAmount(key, sat) { let _carDragging = false; // a balance-carousel drag is in progress let _renderDeferred = false; +// /chat runs the standalone public community view: it owns #app outright, +// and every app render (feature init, emitter ticks) must stand down or the +// onboarding screen paints over the chat moments after it mounts. +let _publicChatMode = false; function render() { + if (_publicChatMode) return; // A background render mid carousel-drag rebuilds the strip; the morph then // strips the drag's inline scroll-snap-type:none, so mandatory snap yanks // the card back to its origin — the "jump partway through" stutter (a @@ -4950,6 +4955,15 @@ window.addEventListener('load', () => { }); loadLocale(getLang()).finally(async () => { applyBootAutoLogout(); // clear an overdue session before we read it for claim targets + // Public read-only community chat: no wallet, no login — the join material + // ships in the bundle, so the page decrypts client-side (src/public-chat.js). + // A share-anywhere link; its sign-in button leads back to the normal app. + if (location.pathname === '/chat') { + _publicChatMode = true; // app renders stand down — the page owns #app + const m = await import('./public-chat.js'); + m.mountPublicChat(); + return; + } // A gift link's feature is deferred — wait for it before asking who owns // the URL, or the claim would fall through to a normal boot and be lost. if (/^\/(g|ag|lg)\//.test(location.pathname)) await _deferredReady; |
