android: a streamed file copied into a folder, the listening port, the dev build's diagnostics
The now-playing sheet's streamed track can be copied into a folder picked on the phone, as the file it is — the cache written out, nothing downloaded again, no library row (copy_stream_to_folder, which the desktop has had a command for and no UI). You → Sharing carries the listening port, what peers dial when they download from you: unset is the client's own 50300, the app asks the router to forward it over UPnP and falls back to the server relaying, and a change applies on the next connect. The dev flavour gets the desktop's debug overlay as a screen under This phone — CPU, memory, the network, the stream and its loudness, what the pre-buffer is fetching, the size of the play history — behind devBuild in util.js, which is Vite's own DEV flag, so the embedded build the phone keeps has no row to tap.
This commit is contained in:
1 parent
1737c5e1b6
commit
aff29aba5c
8 files changed
+272
-2
No files matched your search
@@ -167,6 +167,11 @@ const PROBE = `(function () {
|
||||
hwant: (function () { try { var n = __ss.nav; return (n.sheet ? 1 : 0) + (n.half ? 1 : 0) + (n.stacks[n.tab].length - 1) + (n.tab !== 'home' ? 1 : 0); } catch (e) { return -1; } })(),
|
||||
cardImgs: document.querySelectorAll('.rail .acard img').length,
|
||||
cardPhs: document.querySelectorAll('.rail .acard svg').length,
|
||||
port: (function () { var r = [].slice.call(document.querySelectorAll('.screen .row')).find(function (x) { return /Listening port/.test(x.textContent); }); var m = r && r.querySelector('.m'); return m ? m.textContent.trim() : ''; })(),
|
||||
diagRows: document.querySelectorAll('.group.diag .kv').length,
|
||||
diagCpu: (function () { var r = [].slice.call(document.querySelectorAll('.group.diag .kv')).find(function (x) { return /App CPU/.test(x.textContent); }); var v = r && r.querySelector('.v'); return v ? v.textContent.trim() : ''; })(),
|
||||
diagPlays: (function () { var r = [].slice.call(document.querySelectorAll('.group.diag .kv')).find(function (x) { return /Play rows/.test(x.textContent); }); var v = r && r.querySelector('.v'); return v ? v.textContent.trim() : ''; })(),
|
||||
diagDeck: document.querySelectorAll('.group.diag-deck .row').length,
|
||||
popCounts: [].filter.call(document.querySelectorAll('.row.pop .lbar em'), function (e) { return e.textContent.trim(); }).length,
|
||||
barCounts: [].filter.call(document.querySelectorAll('.trk .lbar em'), function (e) { return e.textContent.trim(); }).length,
|
||||
heroPix: !!document.querySelector('.hero .hero-img.dissolve'),
|
||||
@@ -336,6 +341,10 @@ const MOCK_STEPS = [
|
||||
/* the now-playing sheet's ⋯: the streamed track saved into the library
|
||||
(its cache is complete by now, so it files at once) */
|
||||
{ do: `document.querySelectorAll('.sheet .np-head .iconbtn')[1].click()`, name: "np-more", wait: 700 },
|
||||
/* the same cache, copied out as a plain file into a picked folder —
|
||||
nothing downloaded again, no library row */
|
||||
{ do: `__click('.halfsheet .row', 'Copy to a folder')`, name: "np-copied", wait: 900 },
|
||||
{ do: `document.querySelectorAll('.sheet .np-head .iconbtn')[1].click()`, wait: 700 },
|
||||
{ do: `__click('.halfsheet .row', 'Save to library')`, name: "np-saved", wait: 900 },
|
||||
/* the raw peers: a peer's sheet → their shares browsed → a folder opened
|
||||
→ one of its files streams */
|
||||
@@ -506,6 +515,19 @@ const MOCK_STEPS = [
|
||||
{ do: `(function () { try { Object.defineProperty(navigator, 'connection', { value: { type: 'cellular' }, configurable: true }); } catch (e) {} return __ss.wifi.downloadsAllowed(); })()`, name: "wifi-refused", wait: 400 },
|
||||
{ do: `__click('.toast:not(.notice)', null)`, wait: 300 },
|
||||
{ do: `__click('.screen .row', 'Wi-Fi only')`, name: "wifi-off", wait: 400 },
|
||||
/* the listening port: typed in, saved, read back off the config — then
|
||||
a port below 1024 refused and the saved one left standing */
|
||||
{ do: `__click('.screen .row', 'Listening port')`, name: "you-port-prompt", wait: 600 },
|
||||
{ do: `(function () { var i = document.querySelector('.halfsheet .prompt .field'); i.value = '50555'; i.dispatchEvent(new Event('input', { bubbles: true })); })()`, wait: 300 },
|
||||
{ do: `__click('.halfsheet .prompt-acts .btn-fill', 'Save')`, name: "you-port", wait: 700 },
|
||||
{ do: `__click('.screen .row', 'Listening port')`, wait: 500 },
|
||||
{ do: `(function () { var i = document.querySelector('.halfsheet .prompt .field'); i.value = '80'; i.dispatchEvent(new Event('input', { bubbles: true })); })()`, wait: 300 },
|
||||
{ do: `__click('.halfsheet .prompt-acts .btn-fill', 'Save')`, name: "you-port-refused", wait: 600 },
|
||||
{ do: `__click('.toast:not(.notice)', null)`, wait: 300 },
|
||||
/* the dev flavour's diagnostics — the desktop's Ctrl+Shift+D overlay as
|
||||
a screen; a normal build has no row here to tap */
|
||||
{ do: `__click('.screen .row', 'Diagnostics')`, name: "diag", wait: 1500 },
|
||||
{ do: `history.back()`, name: "diag-back", wait: 800 },
|
||||
{ do: `__click('.screen .row', 'Clear play history')`, name: "history-confirm", wait: 600 },
|
||||
{ do: `__click('.halfsheet .prompt-acts .btn-fill', 'Clear')`, name: "history-cleared", wait: 800 },
|
||||
/* recent searches on the empty page: the ones this walk used */
|
||||
@@ -555,6 +577,11 @@ const MOCK_EXPECT = {
|
||||
"wifi-on": (i) => i.wifiOnly === "on",
|
||||
"wifi-refused": (i) => /Wi-Fi/.test(i.toast),
|
||||
"wifi-off": (i) => i.wifiOnly === "off" && !i.toast,
|
||||
"you-port-prompt": (i) => i.half.includes("up") && /Listening port/.test(i.sheetTitle) && i.promptVal === "" && /^50300 \(the default\)/.test(i.port),
|
||||
"you-port": (i) => !i.half.includes("up") && /^50555 /.test(i.port) && !/the default/.test(i.port) && !i.toast,
|
||||
"you-port-refused": (i) => !i.half.includes("up") && /between 1024 and 65535/.test(i.toast) && /^50555 /.test(i.port),
|
||||
"diag": (i) => i.title.startsWith("Diagnostics") && i.diagRows >= 12 && /%$/.test(i.diagCpu) && /4,?210/.test(i.diagPlays) && i.diagDeck === 1,
|
||||
"diag-back": (i) => i.title.startsWith("You"),
|
||||
"history-confirm": (i) => i.half.includes("up") && /Clear the play history/.test(i.halfText),
|
||||
"history-cleared": (i) => !i.half.includes("up") && /history cleared/i.test(i.notice),
|
||||
"search-recent": (i) => i.title.startsWith("Search") && i.recents >= 1 && i.jump >= 1,
|
||||
@@ -625,6 +652,7 @@ const MOCK_EXPECT = {
|
||||
"net-sheet": (i) => i.sheet.includes("up") && i.lane.includes("rising"),
|
||||
"net-arrived": (i) => i.sheet.includes("up") && !i.lane.includes("rising"),
|
||||
"np-more": (i) => i.half.includes("up") && /Save to library/.test(i.halfText),
|
||||
"np-copied": (i) => !i.half.includes("up") && /1 file copied/.test(i.notice),
|
||||
"np-saved": (i) => !i.half.includes("up") && /Saved to the library/.test(i.notice),
|
||||
"net-peers": (i) => i.title.startsWith("Search") && i.peers >= 3,
|
||||
"net-filter-flac": (i) => i.peers === 3,
|
||||
@@ -817,6 +845,15 @@ const PHONE_STEPS = [
|
||||
{ do: `__click('.screen .row', 'Word-by-word')`, name: "you-words-off", wait: 900 },
|
||||
{ do: `__click('.prefs[data-mode="albumart"] .chip', '1000 px')`, name: "you-artedge", wait: 900 },
|
||||
{ do: `__click('.prefs[data-mode="albumart"] .chip', '1500 px')`, name: "you-artedge-back", wait: 900 },
|
||||
/* the listening port on the real core, camelCase for real: a spare
|
||||
number, then 50300 — the client's own default, so the phone ends the
|
||||
walk on exactly the port an unset config would already have used */
|
||||
{ do: `__click('.screen .row', 'Listening port')`, name: "you-port-prompt", wait: 900 },
|
||||
{ do: `(function () { var i = document.querySelector('.halfsheet .prompt .field'); i.value = '50310'; i.dispatchEvent(new Event('input', { bubbles: true })); })()`, wait: 400 },
|
||||
{ do: `__click('.halfsheet .prompt-acts .btn-fill', 'Save')`, name: "you-port", wait: 1200 },
|
||||
{ do: `__click('.screen .row', 'Listening port')`, wait: 800 },
|
||||
{ do: `(function () { var i = document.querySelector('.halfsheet .prompt .field'); i.value = '50300'; i.dispatchEvent(new Event('input', { bubbles: true })); })()`, wait: 400 },
|
||||
{ do: `__click('.halfsheet .prompt-acts .btn-fill', 'Save')`, name: "you-port-restored", wait: 1200 },
|
||||
{ do: `document.querySelectorAll('.nav button')[2].click()`, wait: 700 },
|
||||
{ do: `document.querySelectorAll('.nav button')[3].click()`, name: "community", wait: 900 },
|
||||
/* the real config's contact list, read back over the real IPC */
|
||||
@@ -871,6 +908,9 @@ const PHONE_EXPECT = {
|
||||
"you-words-off": (i) => i.wordfill === "off" && !i.toast,
|
||||
"you-artedge": (i) => i.artEdge === "1000 px" && !i.toast,
|
||||
"you-artedge-back": (i) => i.artEdge === "1500 px" && !i.toast,
|
||||
"you-port-prompt": (i) => i.half.includes("up") && /Listening port/.test(i.sheetTitle) && !i.toast,
|
||||
"you-port": (i) => !i.half.includes("up") && /^50310 /.test(i.port) && !/the default/.test(i.port) && !i.toast,
|
||||
"you-port-restored": (i) => !i.half.includes("up") && /^50300 /.test(i.port) && !/the default/.test(i.port) && !i.toast,
|
||||
playlists: (i) => i.title.startsWith("Your library"),
|
||||
"playlist-new": (i) => i.screen.includes("tr-push") && i.title.startsWith("Walk test") && i.plrows === 0 && !i.toast,
|
||||
"playlist-pick": (i) => i.half.includes("up") && /Walk test/.test(i.halfText),
|
||||
|
||||
Reference in new issue
Block a user