aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/messages.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-22 10:03:16 -0700
committerAdam Soltys <[email protected]>2026-10-22 10:03:16 -0700
commitd898efbe1f56834c27fd3b5fdc2f6b010f0b0429 (patch)
tree3920352730dbfa1a45b31d7adaaf685216624f74 /src/features/messages.js
parent6a5f1e64d14d6295b0c641809fd375e2d513ef79 (diff)
downloadcoinosv3-d898efbe1f56834c27fd3b5fdc2f6b010f0b0429.tar.gz
coinosv3-d898efbe1f56834c27fd3b5fdc2f6b010f0b0429.zip
Videos: "All shapes" in a pager opened from the grid brings in the clips the other way round (the pager now holds every clip, pagerFit keeping the wrong-shaped ones out of sight until asked)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/features/messages.js')
-rw-r--r--src/features/messages.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/features/messages.js b/src/features/messages.js
index 6122ade..32d23a9 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -13958,7 +13958,10 @@ export function messagesFeature(ctx) {
// or the same words from the same person posted again with another upload.
const sameFile = (url) => { const m = /\/([0-9a-f]{64})(?:\.\w+)?(?:[?#]|$)/i.exec(url); return m ? m[1].toLowerCase() : url.replace(/[?#].*$/, ''); };
const saidAgain = (ev) => { const w = String(ev.content || '').replace(/https?:\/\/\S+/g, '').replace(/\s+/g, ' ').trim(); return w.length >= 8 ? ev.pubkey + '|' + w : null; };
- function mediaItems(c, kind) {
+ // (anyShape: the pager's list — every clip, the ones the wrong way round
+ // for the screen held out of sight by pagerFit, so "All shapes" there has
+ // them to show)
+ function mediaItems(c, kind, anyShape = false) {
const out = [], seen = new Set(), said = new Map();
const r = mediaIndex(c.id);
indexMedia(r, c.notes);
@@ -13972,7 +13975,7 @@ export function messagesFeature(ctx) {
if (again && said.has(again) && said.get(again) !== ev.id) continue;
if (kind === 'videos') learnVideoMeta(ev);
// (a clip whose host says it's deleted has nothing to show: a blank tile)
- const urls = kind === 'videos' ? clipUrlsOf(ev).filter((u) => !clipGone(u)).filter(fitClip)
+ const urls = kind === 'videos' ? clipUrlsOf(ev).filter((u) => !clipGone(u) && (anyShape || fitClip(u)))
: noteMediaUrls(ev.content).filter((u) => !u.startsWith('https://i.ytimg.com/'));
// (the words are taken by a post that shows: one whose clip doesn't fit
// the screen leaves them to the next)
@@ -15594,7 +15597,7 @@ export function messagesFeature(ctx) {
const c = feedNow();
pager.groups ||= new Map();
const src = pagerSource();
- for (const it of (src ? src.items(pager.kind) : mediaItems(c, pager.kind))) {
+ for (const it of (src ? src.items(pager.kind) : mediaItems(c, pager.kind, true))) {
const k = mediaKey(it);
if (pager.keys.has(k)) continue;
pager.keys.add(k);