diff options
| author | Adam Soltys <[email protected]> | 2026-10-18 23:41:23 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-18 23:41:23 -0700 |
| commit | 1f0b1cd2af2c2391d6706f6194bdb65c85f14ca6 (patch) | |
| tree | 3511e22c11b83141e60248cafd336aa91783fd4c | |
| parent | a99d37ca24e6484d8c2edd2ec7ac7dcaf4f29809 (diff) | |
| download | coinosv3-1f0b1cd2af2c2391d6706f6194bdb65c85f14ca6.tar.gz coinosv3-1f0b1cd2af2c2391d6706f6194bdb65c85f14ca6.zip | |
Leaving a stream: Feed (and the rest of the nav) leaves it on the first tap — with the feed under the stream, Feed thought it was already there and only scrolled the hidden feed, and the nav's page-leaving didn't close the stream or Go live. On the stream's own page, the host's ringed face opens their profile instead of the same stream again.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013ZDf1cyCQLkfjftYhymZAg
| -rw-r--r-- | src/features/messages.js | 10 | ||||
| -rw-r--r-- | tools/live-stream-test.js | 10 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index 695cba2..a1b49d0 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -3925,7 +3925,8 @@ export function messagesFeature(ctx) { try { on = liveHostNow(pk); } catch {} // (an avatar drawn while the feature is still being built) if (on) { node.classList.add('live-ring'); - if (clickable) node.onclick = (e) => { e.stopPropagation(); openLive(on); }; + // (on that stream's own page, the face is a way out: to their profile) + if (clickable) node.onclick = (e) => { e.stopPropagation(); if (ui.liveStream && ui.liveStream.a === liveAddr(on)) openProfile(pk); else openLive(on); }; } return hook('wrapAvatar', pk, node) || hatStamp(pk, node) || node; }; @@ -12897,12 +12898,15 @@ export function messagesFeature(ctx) { function appBottomNav() { const visitor = isVisitor(); const me = !visitor && ctx.shownPubkey ? ctx.shownPubkey() : null; - const active = ui.userSearch ? 'search' : me && ui.profilePk === me && !ui.noteThread ? 'profile' : ui.noteThread || ui.profilePk ? 'feed' : ui.chatOpen + // a stream (or Go live) over the shell is a place of its own: no button + // is "here", so the one tapped goes there (Feed under a stream thought it + // was home and only scrolled the hidden feed) + const active = ui.liveStream || ui.goLive ? 'live' : ui.userSearch ? 'search' : me && ui.profilePk === me && !ui.noteThread ? 'profile' : ui.noteThread || ui.profilePk ? 'feed' : ui.chatOpen ? ui.msgView === 'feed' ? 'feed' : ui.msgView === 'notifs' ? 'notifs' : 'messages' : ui.tab === 'settings' ? 'settings' : 'wallet'; const leavePage = () => { stopFeedWatch(); stopNotifWatch(); // Top-level destinations must leave any feature page covering the shell. - for (const key of ['profilePk', 'profEdit', 'profEditFilled', 'profOverThread', 'noteThread', 'userSearch', + for (const key of ['profilePk', 'profEdit', 'profEditFilled', 'profOverThread', 'noteThread', 'liveStream', 'goLive', 'liveReport', 'userSearch', 'zapSetup', 'hatShop', 'feedEdit', 'feedMenu', 'feedRelayEdit', 'noteSheet', 'reactPick', 'reportSheet', 'msgReplyTo', 'msgSheet', 'arkCoinsPage', 'arkExitPage', 'nameEditOpen', 'nostrReconnect', 'nostrLoginOpen', 'pos', 'lockedGift', 'viewGift', 'claimChoose', 'signinAsk']) ui[key] = null; diff --git a/tools/live-stream-test.js b/tools/live-stream-test.js index 608ce76..7ca4e4d 100644 --- a/tools/live-stream-test.js +++ b/tools/live-stream-test.js @@ -187,6 +187,16 @@ try { check('...and goes out as a kind 1311 addressed to the stream', !!sent && sent.content === 'first time here' && sent.tags.some((x) => x[0] === 'a' && x[1] === A), JSON.stringify(sent && sent.tags)); check('the player keeps playing through the renders', await waitFor(playing, 3000)); + console.log('\n[ways out]'); + await page.evaluate(() => document.querySelector('.live-page .chat-avatar.mini.live-ring').click()); + check('on the stream, the host\'s ringed face opens their profile (not the same stream again)', await waitFor(() => !document.querySelector('.live-page') && !!document.querySelector('.live-banner'), 8000)); + await page.goBack(); + await waitFor(() => !!document.querySelector('.live-page'), 5000); + await page.evaluate(() => document.querySelector('.app-nav-button[aria-label="Feed"]').click()); + check('Feed in the nav leaves the stream on the first tap', await waitFor(() => !document.querySelector('.live-page') && !!document.querySelector('.media-modes'), 5000)); + await page.goBack(); + await waitFor(() => !!document.querySelector('.live-page'), 5000); + console.log('\n[leaving]'); await page.goBack(); check('Back leaves the stream\'s page', await waitFor(() => !document.querySelector('.live-page'), 5000)); |
