aboutsummaryrefslogtreecommitdiffstats
path: root/tools/video-compress-test.js
Commit message (Collapse)AuthorAgeFilesLines
* A flick through the feed no longer drags background work through the middle ↵Adam Soltys2026-11-071-3/+3
| | | | | | | of it. "When I flick to scroll, it's not getting up to speed very quickly, and clicking around in the app feels a bit sluggish at times" (Adam, 2026-11-07). Measured on his Pixel 9 in the installed PWA: idle is quiet (0.16 s of script in 10 s), but three real flicks through Following spent 1.7 s of 9 on the main thread, frames up to 200 ms, and the work was the avatar thumbnailer finishing faces as they scrolled in: a synchronous canvas.toDataURL WebP encode per face (229 ms), the profile cache JSON.stringified twice per half-second flush (once just to measure it, up to ~2 MB with thumbnails), and a whole-page repaint per finished face that changes nothing on screen (feed rows keep the face they were admitted with). Now: the crop, resize and encode happen off the main thread (createImageBitmap with resizeWidth/Height, OffscreenCanvas.convertToBlob, FileReader), with the old canvas path as the fallback; a finished face is recorded once the page settles; scheduleRepaint holds while a finger is down or the page scrolled in the last 200 ms (at most 1.5 s), and the profile flush likewise (at most 5 s, forced on an account switch) and sizes the blob by summing rows instead of stringifying it. Tests: the create flow's heads-up / passphrase / check steps from earlier today broke every test that made a wallet by waiting for the words and clicking "Skip verification"; tools/puppeteer.js exports seedWords() and skipSeedCheck() and the 96 tests use them. room-faces and avatar-profile fail the same way on 8858591 (row.hover, scrollIntoView), before today's changes Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6Ts5Tktega8VbLg31q
* Browser tests: public relays answered in the page, never reachedAdam Soltys2026-10-071-1/+1
| | | | | | | | | | | | | | A suite run let ~90 throwaway test wallets subscribe and publish on public relays from one home address, and nos.lol and relay.damus.io banned it. tools/puppeteer.js wraps puppeteer-core: every socket to a non-local host gets an in-page stand-in relay (EVENT -> OK, REQ -> EOSE). Tests that read real content launch with { relays: 'read' } (real reads, publishes answered in place); feed-live, chat-layout and cordn-ui launch with { relays: 'live' }. LIVE_RELAYS=read|1|host,... overrides per run. profile-key-qr: measure the QR again if a repaint swapped it out. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Feed, composer and zap tests follow today's appAdam Soltys2026-10-071-2/+2
| | | | | | | | | | | | | | | | | | | | - feed tests reach the Feed from the bottom nav (the chat-home row is gone) and seed this wallet's last feed as Following (new wallets open on Popular, c89050e) plus the author's profile (readiness gate) - post-actions: its picture is made locally (it read another session's scratchpad), the post's own ⋯ (not the feed header's), a real tap on the DM picture (a tap beside a fitted picture is a tap on the post) - composer-media / video-compress: intercept every public media host (ditto is first now; the tests were uploading for real) - compose-preview: Preview is one toggle button (aria-pressed) - thread-reply: harness has a wallet (else visitor: Reply asks to sign in), registers <coinos-text>, holds the root's id-only query; atomic send tap - video-unmute: stubs what videoNode reaches outside its slice; preload none means the in-view clip is told to load - zap-deep-profile: zap button scrolled to mid-screen (the bottom nav covered it) Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A picture or video on its way shows a bar with its percentage — shrinking, ↵Adam Soltys2026-09-301-9/+34
| | | | | | | | | | | | | | | | then uploading; the pencil reads "New post". ui.mediaProgress { stage, pct } (a render per whole percent) drawn as a labelled bar under the reply and post composers, instead of only the paperclip turning into a spinner. Upload progress comes from XMLHttpRequest upload events (fetch() has none) in uploadPublicMedia's new onProgress; injected fetchers (tests) keep the fetch path. upload-progress-test: 1.2 MB at 400 KB/s climbs 0→100 in steps. video-compress-test: the bar counts the shrink, then the upload. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Du1qT1wbkYwYK6zkGH79Rp
* Videos are shrunk on the phone before upload; nostr.build is the first media ↵Adam Soltys2026-09-301-0/+101
host. No public Blossom host transcodes (nostr.build's and primal's BUD-05 /media return the same bitrate), so a 15-20 Mbps phone clip stalled on playback. src/video-compress.js re-encodes on the device with WebCodecs via Mediabunny (a lazily loaded chunk, left out of the SW precache and the standalone file): H.264, short edge 720, ~2.5 Mbps, moov first, audio passed through, rotation baked in. Anything short of a clear win uploads the original. A toast counts the shrinking down. Media hosts: blossom.nostr.build first, nostr.download second (it was unreachable for hours); a HEAD probe skips a host that doesn't answer within 5 s instead of waiting out the whole upload timeout. video-compress-test: 1080p 20 Mbps 5 s (landscape and rotated portrait) → 1.6 MB H.264 720p 2.49 Mbps with audio, moov first, in 2-3 s. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Du1qT1wbkYwYK6zkGH79Rp
> !== null ? exports : this; g.proceed = false; $(function() { $('#title').focus(); return $.getJSON("/js/rates.json", function(data) { var currencies, user; currencies = Object.keys(data); currencies = currencies.sort(); currencies.pop(); $.each(currencies, function(i, v) { return $('#currency').append("<option value='" + v + "'>" + v + "</option>"); }); $("#currency option[value='CAD']").attr('selected', 'selected'); user = $('#username').val(); $('#currency').change(function() { var symbol, symbols; $('#symbol option').remove(); symbol = $(this).val(); if (!symbol) { return; } symbols = Object.keys(data[symbol]); $.each(symbols, function(i, v) { return $('#symbol').append("<option value='" + v + "'>" + v + " bid price</option>"); }); switch ($(this).val()) { case 'CAD': return $("#symbol option[value='quadrigacx']").attr('selected', 'selected'); case 'USD': return $("#symbol option[value='bitstamp']").attr('selected', 'selected'); } }).change(); $('#address').change(function() { if (check_address($(this).val())) { return $(this).css('color', 'black'); } else { return $(this).css('color', 'red'); } }); $('#confirm').blur(function() { $('#confirm_error').remove(); if ($('#password').val() !== $('#confirm').val()) { $('#password, #confirm').parent().addClass('has-error'); return $('#confirm').parent().after('<div id="confirm_error" class="alert alert-danger">Passwords don\'t match</div>'); } else { return $('#password, #confirm').parent().removeClass('has-error'); } }); $('#setup').submit(function() { if ($('.has-error').length()) { return false; } }); if (user) { $('#setup').attr('action', "/" + user + "/update").attr('method', 'post'); return $.getJSON("/" + user + ".json", function(data) { $('#title').val(data.title); $('#logo').val(data.logo); $('#address').val(data.address); $("#symbol option[value='" + data.symbol + "']").attr('selected', 'selected'); return $('#commission').val(data.commission); }); } }); }); }).call(this);