aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/features/messages.js90
-rw-r--r--tools/profile-pager-test.js120
2 files changed, 180 insertions, 30 deletions
diff --git a/src/features/messages.js b/src/features/messages.js
index 55deaa1..6d3aefa 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -10614,6 +10614,7 @@ export function messagesFeature(ctx) {
function profileScreen() {
const pk = ui.profilePk;
+ queueMicrotask(syncMediaPager); // a picture of theirs opened full screen: the pager over their timeline
const mine = isMe(pk) || (ctx.shownPubkey && pk === ctx.shownPubkey());
// History can outlive an account switch; only restore our own editor.
if (!mine && ui.profEdit) { ui.profEdit = null; ui.profEditFilled = false; }
@@ -11845,16 +11846,38 @@ export function messagesFeature(ctx) {
const inFeed = ui.chatOpen && ui.msgView === 'feed' && !ui.profilePk && !ui.noteThread && feed && !feed.stopped && feed.winList;
return inFeed && el && el.closest ? el.closest('.notes-feed > [data-key]')?.getAttribute('data-key') || null : null;
}
+ // the page the row is on: the feed, or a person's timeline (their
+ // profile page) — the pager runs over that page's pictures (or clips)
+ const onProfilePage = () => !!ui.profilePk && (!ui.noteThread || ui.profOverThread);
+ function pageRowOf(el) {
+ const rowId = el && el.closest ? el.closest('.notes-feed > [data-key]')?.getAttribute('data-key') || null : null;
+ if (!rowId) return null;
+ if (onProfilePage()) { const c = notesCache.get(ui.profilePk); return c && c.winList ? { c, rowId, profile: ui.profilePk } : null; }
+ return feedRowOf(el) ? { c: feed, rowId, profile: null } : null;
+ }
+ // Where a pager opened from a page gets its pictures: the feed on screen,
+ // or a person's timeline — its posts' pictures in its order, more fetched
+ // as the reader nears the end. The media grid's pager has no source here.
+ function pagerSource(p = pager) {
+ if (!p) return null;
+ if (p.profile) {
+ const c = notesCache.get(p.profile);
+ return c ? { c, profile: p.profile, items: (kind) => feedMediaItems(c, kind), more: () => loadOlderNotes(p.profile), done: () => !!c.end && !c.loadingMore,
+ live: () => onProfilePage() && ui.profilePk === p.profile } : null; // (the entry is replaced by a refetch: the page, not the object, says it is still there)
+ }
+ if (p.fromFeed) { const c = feedNow(); return { c, items: (kind) => feedMediaItems(c, kind), more: () => loadOlderFeed(), done: () => !!c.end && c.shown >= c.notes.length && !c.loadingMore, live: () => c === feed && !onProfilePage() }; }
+ return null;
+ }
// A picture tapped in the feed opens in the media pager, on that picture,
// with the feed's other pictures a swipe (or an arrow) away, the way the
// media grid's are. On any other page — a thread, a profile, a chat — the
// picture opens alone, as before.
function openPicture(url, e) {
try {
- const rowId = feedRowOf(e && e.target);
- if (rowId) {
- const it = feedMediaItems(feed, 'images').find((x) => x.row.id === rowId && x.url === url);
- if (it) { openMediaPager('images', mediaKey(it), { fromFeed: true }); return; }
+ const at = pageRowOf(e && e.target);
+ if (at) {
+ const it = feedMediaItems(at.c, 'images').find((x) => x.row.id === at.rowId && x.url === url);
+ if (it) { openMediaPager('images', mediaKey(it), { fromFeed: !at.profile, profile: at.profile }); return; }
}
} catch {}
ctx.openImage && ctx.openImage(url);
@@ -11866,14 +11889,14 @@ export function messagesFeature(ctx) {
// himself — so it follows the phone throughout.
function openClip(v, url) {
try {
- const rowId = feedRowOf(v);
- if (!rowId) return false;
- const it = feedMediaItems(feed, 'videos').find((x) => x.row.id === rowId && x.url === url);
+ const on = pageRowOf(v);
+ if (!on) return false;
+ const it = feedMediaItems(on.c, 'videos').find((x) => x.row.id === on.rowId && x.url === url);
if (!it) return false;
tappedClips.add(url); // asked for by hand: no tap-to-play cover
const at = v.currentTime || 0;
v.pause();
- openMediaPager('videos', mediaKey(it), { fromFeed: true, at });
+ openMediaPager('videos', mediaKey(it), { fromFeed: !on.profile, profile: on.profile, at });
pagerFullscreen();
return true;
} catch { return false; }
@@ -12031,13 +12054,13 @@ export function messagesFeature(ctx) {
// `fromFeed`: opened from a picture or clip in the feed (its pictures or
// clips, in the feed's order), rather than from the media grid; `at`: where
// the clip it opened on was, so it carries on from there
- function openMediaPager(kind, start, { fromFeed = false, at = 0 } = {}) {
+ function openMediaPager(kind, start, { fromFeed = false, profile = null, at = 0 } = {}) {
// the page's own players stop: the pager's is the one to hear
for (const v of document.querySelectorAll('video')) { try { v.pause(); } catch {} }
for (const f of document.querySelectorAll('.yt-embed[data-playing] iframe')) {
try { f.contentWindow.postMessage(JSON.stringify({ event: 'command', func: 'pauseVideo', args: [] }), '*'); f.closest('.yt-embed')._pausedByUs = true; } catch {}
}
- ui.mediaPager = { kind, start, feed: curFeedId, fromFeed, at };
+ ui.mediaPager = { kind, start, feed: curFeedId, fromFeed, profile, at };
render();
}
const closeMediaPager = () => ctx.closeLayer('mediaPager');
@@ -12047,17 +12070,17 @@ export function messagesFeature(ctx) {
// the feed on the post of the picture last looked at; otherwise (the
// media grid's pager, or nothing moved) it simply closes.
function dismissPager() {
- if (pager && pager.fromFeed && !pagerOnStart() && pager.cur) closePagerTo(pager.cur._rowId);
+ if (pager && pagerSource() && !pagerOnStart() && pager.cur) closePagerTo(pager.cur._rowId);
else closeMediaPager();
}
function closePagerTo(rowId) {
- const c = feedNow();
+ const src = pagerSource();
closeMediaPager();
// the pop that closes it lands on a later turn: the glide waits for the feed
let tries = 0;
const go = () => {
if (ui.mediaPager || !document.querySelector('.notes-feed')) { if (++tries < 90) requestAnimationFrame(go); return; }
- landOnPost(c, rowId);
+ landOnPost(src, rowId);
};
requestAnimationFrame(go);
}
@@ -12068,12 +12091,14 @@ export function messagesFeature(ctx) {
// draw, and set the row under the top again each frame — until it has sat
// still a moment, a couple of seconds have gone, or the reader touches the
// page. A jump, not a glide: the pager was covering the feed.
- function landOnPost(c, rowId) {
+ function landOnPost(src, rowId) {
const MARGIN = 8, t0 = Date.now();
const find = () => document.querySelector('.notes-feed > [data-key="' + CSS.escape(rowId) + '"]');
let still = 0, misses = 0, lastY = null;
const step = () => {
- if (c !== feed || ui.mediaPager || !document.querySelector('.notes-feed') || lastInputAt > t0 || Date.now() - t0 > 2500) return;
+ if (!src.live() || ui.mediaPager || !document.querySelector('.notes-feed') || lastInputAt > t0 || Date.now() - t0 > 2500) return;
+ // the list as it is now (a profile's entry is replaced by a refetch)
+ const c = src.profile ? notesCache.get(src.profile) || src.c : src.c;
// the page sent somewhere else meanwhile (not by a finger: a glide, a link)
if (lastY !== null && Math.abs(window.scrollY - lastY) > window.innerHeight / 2) return;
const el = find();
@@ -12106,9 +12131,11 @@ export function messagesFeature(ctx) {
let pager = null; // the live pager: { el, scroller, kind, keys, cur, loud, io, near, tick }
let pagerLoud = true; // sound on, unless the browser said no without a tap
function syncMediaPager() {
- const want = ui.mediaPager && ui.chatOpen && ui.msgView === 'feed' && !ui.profilePk && !ui.noteThread ? ui.mediaPager : null;
+ const m = ui.mediaPager;
+ const want = m && (m.profile ? onProfilePage() && ui.profilePk === m.profile && notesCache.has(m.profile)
+ : ui.chatOpen && ui.msgView === 'feed' && !ui.profilePk && !ui.noteThread) ? m : null;
if (!want) { if (pager) dropPager(); return; }
- if (pager && (pager.kind !== want.kind || pager.fromFeed !== !!want.fromFeed)) dropPager();
+ if (pager && (pager.kind !== want.kind || pager.fromFeed !== !!want.fromFeed || pager.profile !== (want.profile || null))) dropPager();
if (!pager) buildPager(want);
else growPager();
}
@@ -12686,8 +12713,8 @@ export function messagesFeature(ctx) {
else if (pager.cur) playSlide(pager.cur);
return;
}
- if (pager && pager.fromFeed) {
- // Opened from a post in the feed: a tap on the picture that opened
+ if (pager && pagerSource()) {
+ // Opened from a post in the feed (or on a profile): a tap on the picture that opened
// it closes it, as a full-screen picture always has. Once the reader
// has moved on, the first tap shows the post's details, and the next
// closes the pager onto that post in the feed.
@@ -12699,7 +12726,7 @@ export function messagesFeature(ctx) {
el.classList.toggle('show');
if (el.classList.contains('show')) pagerCounts(pager && pager.cur);
}
- pager = { el, scroller, kind: want.kind, keys: new Set(), cur: null, feed: want.feed, fromFeed: !!want.fromFeed, start: want.start, at: want.at || 0 };
+ pager = { el, scroller, kind: want.kind, keys: new Set(), cur: null, feed: want.feed, fromFeed: !!want.fromFeed, profile: want.profile || null, start: want.start, at: want.at || 0 };
// The end of the pager: swiping past the last slide lands here, on
// something saying more is coming (not a nudge that goes nowhere) — and
// asks for it at once. Slides that arrive go in above it; one arriving
@@ -12721,7 +12748,7 @@ export function messagesFeature(ctx) {
const v = pager.cur && pager.cur.querySelector('video.mp-media');
if (v) v.pause();
el.classList.remove('show');
- if (pager.fromFeed) pagerFeedAhead(); else crawlMedia().catch(() => {});
+ if (pagerSource()) pagerFeedAhead(); else crawlMedia().catch(() => {});
pagerTailState();
}
}, { root: scroller, threshold: [0, 0.6] });
@@ -12743,17 +12770,18 @@ export function messagesFeature(ctx) {
const v = pager.cur.querySelector('video.mp-media'); if (v) v.pause();
// how long a clip held the reader (the head start's measure of them)
if (v && pager.curAt) { const secs = (Date.now() - pager.curAt) / 1000; dwell = dwell ? dwell * 0.7 + secs * 0.3 : secs; }
- if (pager.fromFeed && video) el.classList.remove('show');
+ if (pagerSource() && video) el.classList.remove('show');
}
pager.cur = slide;
pager.anchor = slide;
pager.curAt = Date.now();
pagerArrows(slide);
if (pager.fromFeed) { const row = feedNow().notes.find((x) => x.id === slide._rowId); markSeen(row || slide._ev); }
+ else if (pager.profile) markSeen(slide._ev);
playSlide(slide);
pagerCounts(slide);
// near the end: ask the feed for more, the pager picks them up
- if (pager.fromFeed) pagerFeedAhead();
+ if (pagerSource()) pagerFeedAhead();
else { const gs = pagerGroups(); if (gs.indexOf(slide.closest('.mp-group')) >= gs.length - 3) crawlMedia().catch(() => {}); }
};
pager.io = new IntersectionObserver((entries) => {
@@ -12808,15 +12836,16 @@ export function messagesFeature(ctx) {
const PAGER_AHEAD = { images: 4, videos: 6 };
let pagerFeeding = false;
async function pagerFeedAhead() {
- if (pagerFeeding || !pager || !pager.fromFeed) return;
+ const src = pagerSource();
+ if (pagerFeeding || !src) return;
pagerFeeding = true;
try {
- const c = feedNow();
- for (let pages = 0; pages < 8 && pager && pager.fromFeed; pages++) {
+ const c = src.c;
+ for (let pages = 0; pages < 8 && pager && pagerSource(); pages++) {
const gs = pagerGroups();
if (gs.length - 1 - gs.indexOf(pager.cur && pager.cur.closest('.mp-group')) > (PAGER_AHEAD[pager.kind] || 4)) break;
const shown = c.shown, held = c.notes.length;
- await loadOlderFeed();
+ await src.more();
growPager();
if (c.shown === shown && c.notes.length === held) break;
}
@@ -12831,7 +12860,8 @@ export function messagesFeature(ctx) {
const waiting = pager.onTail;
let first = null;
pager.groups ||= new Map();
- for (const it of (pager.fromFeed ? feedMediaItems(c, pager.kind) : mediaItems(c, pager.kind))) {
+ const src = pagerSource();
+ for (const it of (src ? src.items(pager.kind) : mediaItems(c, pager.kind))) {
const k = mediaKey(it);
if (pager.keys.has(k)) continue;
pager.keys.add(k);
@@ -12873,8 +12903,8 @@ export function messagesFeature(ctx) {
// more to give — that this is everything
function pagerTailState() {
if (!pager || !pager.tail) return;
- const c = feedNow();
- const done = pager.fromFeed ? !!c.end && c.shown >= c.notes.length && !c.loadingMore : !!mediaIndex(c.id).end;
+ const src = pagerSource();
+ const done = src ? src.done() : !!mediaIndex(feedNow().id).end;
if (pager.tail.classList.contains('done') === done) return;
pager.tail.classList.toggle('done', done);
pager.tail.querySelector('.mp-tail-text').textContent = done ? t('pagerCaughtUp') : t(pager.kind === 'videos' ? 'pagerFetchingVideo' : 'pagerFetchingPictures');
diff --git a/tools/profile-pager-test.js b/tools/profile-pager-test.js
new file mode 100644
index 0000000..9006bce
--- /dev/null
+++ b/tools/profile-pager-test.js
@@ -0,0 +1,120 @@
+// A picture tapped on someone's profile page opens in the media pager over
+// THEIR pictures — the posts of their timeline, in its order, nobody
+// else's — and closing it after moving on lands the profile on that post.
+// (It opened alone, in the lightbox, before: no pager on a profile.)
+// Run: bun tools/profile-pager-test.js
+import puppeteer from './puppeteer.js';
+import { cacheKeyFor } from '../src/wallet.js';
+import { generateSecretKey, getPublicKey, finalizeEvent } from 'nostr-tools/pure';
+import { buildHtml } from '../build.js';
+const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
+let ok = true;
+const check = (n, c, d = '') => { console.log(` ${c ? '✓' : '✗'} ${n}${d ? ' — ' + d : ''}`); if (!c) ok = false; };
+const png = (size) => Bun.spawnSync(['ffmpeg', '-loglevel', 'error', '-f', 'lavfi', '-i', 'testsrc=size=' + size, '-frames:v', '1', '-f', 'image2', '-c:v', 'png', 'pipe:1']).stdout;
+const PICS = { a1: png('400x300'), a2: png('300x400'), b: png('320x320'), d: png('360x240'), x: png('200x200') };
+
+const SK = generateSecretKey(), AUTHOR = getPublicKey(SK), SK2 = generateSecretKey(), OTHER = getPublicKey(SK2);
+const now = Math.floor(Date.now() / 1000);
+const post = (content, ago, sk = SK) => finalizeEvent({ kind: 1, created_at: now - ago, tags: [], content }, sk);
+const html = await buildHtml({ minify: true, pwa: false });
+const server = Bun.serve({ port: 0, fetch: (req) => {
+ const path = new URL(req.url).pathname;
+ if (path.startsWith('/punks')) return new Response(Bun.file('dist' + path));
+ const m = /^\/(a1|a2|b|d|x)\.png$/.exec(path);
+ if (m) return new Response(PICS[m[1]], { headers: { 'content-type': 'image/png' } });
+ return new Response(html, { headers: { 'content-type': 'text/html' } });
+} });
+const U = (n) => server.url.origin + '/' + n + '.png';
+const seeded = [
+ post('bob picture ' + U('x'), 50, SK2), // someone else's, newest in the feed: not in Alice's pager
+ post('two pictures ' + U('a1') + ' ' + U('a2'), 100),
+ post('one picture ' + U('b'), 200),
+ post('only words here, nothing to look at', 300),
+ post('a last picture ' + U('d'), 400),
+ ...Array.from({ length: 12 }, (_, i) => post('filler ' + i + ' ' + 'lorem ipsum dolor sit amet. '.repeat(5), 500 + i * 60)),
+];
+
+const browser = await puppeteer.launch({ executablePath: '/usr/bin/google-chrome', headless: 'new', args: ['--no-sandbox'] });
+const page = await browser.newPage();
+const errs = [];
+page.on('pageerror', (e) => errs.push(String(e)));
+const click = (t) => page.evaluate((x) => { const e = [...document.querySelectorAll('button')].find((n) => n.textContent.trim().toLowerCase().includes(x)); if (e) { e.click(); return true; } return false; }, t);
+const waitText = async (x, ms = 25000) => { for (let i = 0; i < ms / 250; i++) { if ((await page.evaluate(() => document.body.innerText)).toLowerCase().includes(x)) return true; await sleep(250); } return false; };
+const waitFor = async (fn, arg, ms = 10000) => { for (let i = 0; i < ms / 100; i++) { if (await page.evaluate(fn, arg)) return true; await sleep(100); } return false; };
+// the slide the pager rests on, by its picture
+const curPic = () => page.evaluate(() => {
+ const sc = document.querySelector('.mp-scroll'); if (!sc) return null;
+ const s = [...sc.querySelectorAll('.mp-slide')].find((x) => { const r = x.getBoundingClientRect(); return Math.abs(r.top) < 4 && Math.abs(r.left) < 4; });
+ return s ? s.getAttribute('data-k').split('|')[1].split('/').pop() : 'between';
+});
+const resting = async (name) => waitFor((n) => { const sc = document.querySelector('.mp-scroll'); if (!sc) return false; const s = [...sc.querySelectorAll('.mp-slide')].find((x) => { const r = x.getBoundingClientRect(); return Math.abs(r.top) < 4 && Math.abs(r.left) < 4; }); return !!s && s.getAttribute('data-k').endsWith('/' + n); }, name, 4000);
+const openPic = async (word) => {
+ await page.evaluate((w) => { const r = [...document.querySelectorAll('.notes-feed [data-key]')].find((n) => n.textContent.includes(w)); r.scrollIntoView({ block: 'center' }); }, word);
+ await sleep(400);
+ const at = await page.evaluate((w) => { const r = [...document.querySelectorAll('.notes-feed [data-key]')].find((n) => n.textContent.includes(w)); const i = r.querySelector('img.note-img').getBoundingClientRect(); return { x: i.x + i.width / 2, y: i.y + i.height / 2, y0: window.scrollY }; }, word);
+ await page.mouse.click(at.x, at.y);
+ await waitFor(() => !!document.querySelector('.media-pager'), null, 4000);
+ return at.y0;
+};
+const tapPager = async () => { const at = await page.evaluate(() => { const sc = document.querySelector('.mp-scroll'); const s = [...sc.querySelectorAll('.mp-slide')].find((x) => { const r = x.getBoundingClientRect(); return Math.abs(r.top) < 4 && Math.abs(r.left) < 4; }) || sc.firstChild; const r = s.querySelector('img.mp-media').getBoundingClientRect(); return { x: r.x + r.width / 2, y: r.y + r.height / 2 }; }); await page.mouse.click(at.x, at.y); };
+const rowTop = (word) => page.evaluate((w) => { const r = [...document.querySelectorAll('.notes-feed [data-key]')].find((n) => n.textContent.includes(w)); return r ? Math.round(r.getBoundingClientRect().top) : null; }, word);
+
+try {
+ await page.setViewport({ width: 390, height: 844 });
+ await page.goto(server.url.href, { waitUntil: 'domcontentloaded' });
+ await page.evaluate(() => localStorage.setItem('btc-wallet-network', 'regtest'));
+ await page.reload({ waitUntil: 'domcontentloaded' });
+ await sleep(400);
+ await click('create a new wallet'); await sleep(600);
+ await page.waitForSelector('.words .w .t');
+ const mn = (await page.$$eval('.words .w .t', (l) => l.map((e) => e.textContent.trim()))).join(' ');
+ await click('skip verification');
+ await waitText('receive', 20000);
+ const base = cacheKeyFor(mn + '\n');
+ await page.evaluate(([k, pk, ns, other]) => {
+ localStorage.setItem(k + ':follows', JSON.stringify({ tags: [['p', pk], ['p', other]], c: '', at: Math.floor(Date.now() / 1000) }));
+ localStorage.setItem(k + ':feedNotes', JSON.stringify(ns));
+ localStorage.setItem(k + ':profiles', JSON.stringify({ [pk]: { name: 'Picture Poster', about: 'alice bio here', t: Date.now() }, [other]: { name: 'Bob Poster', t: Date.now() } }));
+ localStorage.setItem('btc-wallet-feed:' + k, 'following');
+ }, [base, AUTHOR, seeded, OTHER]);
+ await page.reload({ waitUntil: 'domcontentloaded' });
+ await waitText('receive', 20000);
+ await page.evaluate(() => document.querySelector('.app-nav-button[aria-label="Feed"]').click());
+ check('the pictures are in the feed', await waitFor(() => document.querySelectorAll('.notes-feed img.note-img').length >= 4, null, 20000));
+
+ console.log('\n[a picture on a profile page]');
+ // Alice's profile, from her face on a feed row
+ await page.evaluate(() => { const r = [...document.querySelectorAll('.notes-feed .note-avatar')].find((n) => n.closest('[data-key]')?.innerText.includes('one picture')); r.scrollIntoView({ block: 'center' }); });
+ await sleep(300);
+ const face = await page.evaluate(() => { const r = [...document.querySelectorAll('.notes-feed .note-avatar')].find((n) => n.closest('[data-key]')?.innerText.includes('one picture')).getBoundingClientRect(); return { x: r.x + r.width / 2, y: r.y + r.height / 2 }; });
+ await page.mouse.click(face.x, face.y);
+ check('her profile opens, with her posts', await waitText('alice bio here', 8000) && await waitFor(() => [...document.querySelectorAll('.notes-feed [data-key]')].some((r) => r.innerText.includes('two pictures')), null, 8000));
+ check('…and not Bob\'s', !(await page.evaluate(() => document.body.innerText.includes('bob picture'))));
+ await openPic('two pictures');
+ check('her picture opens in the pager, on itself', await resting('a1.png'), await curPic());
+ const keys = await page.evaluate(() => [...document.querySelectorAll('.mp-slide')].map((s) => s.getAttribute('data-k').split('/').pop()));
+ check('the pager holds her pictures only, in her timeline\'s order', JSON.stringify(keys) === JSON.stringify(['a1.png', 'a2.png', 'b.png', 'd.png']), JSON.stringify(keys));
+ await page.keyboard.press('ArrowRight');
+ check('right: the post\'s second picture', await resting('a2.png'), await curPic());
+ await page.keyboard.press('ArrowDown');
+ check('down: her next post with a picture', await resting('b.png'), await curPic());
+ await page.keyboard.press('ArrowDown');
+ check('down again: her last', await resting('d.png'), await curPic());
+ await page.keyboard.press('ArrowDown'); await sleep(600);
+ check('past her last: the end, not somebody else\'s picture', (await curPic()) !== 'x.png' && !(await page.evaluate(() => [...document.querySelectorAll('.mp-slide')].some((s) => s.getAttribute('data-k').endsWith('/x.png')))));
+ await page.keyboard.press('ArrowUp'); await resting('d.png'); // back off the end
+ await page.keyboard.press('ArrowUp');
+ check('up: her post before', await resting('b.png'), await curPic());
+ await page.keyboard.press('Escape');
+ check('Escape closes it', await waitFor(() => !document.querySelector('.media-pager') && !!document.querySelector('.notes-feed'), null, 3000));
+ await sleep(900);
+ check('…still on her profile', await page.evaluate(() => document.body.innerText.includes('alice bio here')));
+ check('…landed on that post', (await rowTop('one picture')) !== null && (await rowTop('one picture')) < 120 && (await rowTop('one picture')) > -10, 'row top ' + (await rowTop('one picture')));
+ await openPic('one picture');
+ check('opened again on the picture it closed on', await resting('b.png'), await curPic());
+ await tapPager(); await sleep(600);
+ check('a tap on the picture that opened it closes it', await waitFor(() => !document.querySelector('.media-pager'), null, 3000));
+ check('no page errors', errs.length === 0, errs.slice(0, 2).join(' | '));
+} catch (e) { console.error(e); ok = false; } finally { await browser.close(); server.stop(true); }
+console.log(ok ? '\n✅ a profile\'s pictures page through the pager' : '\n❌ failed');
+process.exit(ok ? 0 : 1);