Player: Stream Quality panel (redesign of the Statistics popup)#1323
Player: Stream Quality panel (redesign of the Statistics popup)#1323AKnassa wants to merge 3 commits into
Conversation
Replace the raw torrent Statistics panel with a Stream Quality meter that answers "will this play smoothly": a graded verdict from the local playback buffer, plain-meaning signals (sources / buffer / speed), and raw details on tap. Pure derivation logic is unit-tested; no new deps, no extra backend calls.
Make the info hash a tap and keyboard-activated copy target with a toast, styled as a subtle code chip. Untabbable while the drawer is collapsed.
Botsy
left a comment
There was a problem hiding this comment.
I reviewed and tested the changes. Overall, a clean, well-tested PR. Good call reframing raw numbers into a plain-language verdict. Pure logic extracted into streamQuality.js with solid edge-case test coverage; units consistent; conventions followed. 👍
A few non-blocking notes:
-
Cast path reads "Poor" for healthy streams. On the Chromecast sender path
bufferedisnull(vs ms on the HTML path), sobufferAheadreturns0and cast torrents score near-zero on buffer regardless of health. Regression from the old panel. Handle null-buffer or note cast as out of scope. -
keepingUp === nullscored as "not keeping up." Untildurationis known (and for live streams),keepingUpisnull, andkeepingUp ? 20 : 0docks 20 points at the moment the panel opens — healthy streams can transiently read Fair/Poor. Noted as a follow-up; flagging since it hits the primary case. -
Minor:
onCopyInfoHashdeps are[infoHash]only — missingt/toast(stale translation on mid-stream language switch; likely tripsexhaustive-deps). -
Translations: the inline
defaultValuestrings are fine as a stopgap, but we'd expect the newPLAYER_QUALITY_*/PLAYER_SIGNAL_*keys to land in a matching PR on the stremio-translations repo before merge.
Thank you for contributing!
Grade Good/Fair/Poor only when buffer runway or download-vs-bitrate is measurable; when neither is (Chromecast emits buffered null, live/unknown duration makes keepingUp null), show a neutral "Limited" state instead of scoring on peer count alone. Peers is swarm connectivity, not proof of smooth playback, so peers-only no longer yields a false Good or false Poor. - bufferAhead returns null (not 0) for non-finite input, so "unavailable" is distinct from a real zero-second buffer. - Reword verdicts to describe playback outcome, not the buffer, so the headline never contradicts a "Buffer: Not available" row on cast/live. - Fix onCopyInfoHash deps to [infoHash, t, toast] (was [infoHash]) to avoid a stale-language copy toast after a mid-stream language switch. Addresses review feedback on Stremio#1323.
What this does
Replaces the in-player "Statistics" popup, which showed raw torrent numbers (Peers, Speed, Completed, Info hash), with a Stream Quality panel that tells the viewer in plain words whether the video will play smoothly right now.
The redesign, from a UX/UI standpoint
The old panel treated four torrent internals (Peers, Speed, Completed, Info hash) as equal, unlabelled facts in a flat row, leaving the viewer to interpret raw numbers and judge for themselves whether anything was wrong. It surfaced data but never answered a question, and in the most common state it actively misled: "Speed 0 MB/s" next to "Completed 100%" reads as broken, when it is in fact the healthiest possible state, the whole title downloaded and unable to buffer.
The redesign reorganizes the same underlying data around the only decision a viewer makes when they open this panel: is this going to play smoothly, and if not, why? A single quality meter anchors the panel and states the verdict in plain language, so the answer is legible at a glance without reading a number. Beneath it the supporting signals remain, but each one now explains what it means to the viewer: Sources is where the video comes from, Buffer is how long you can safely watch before it needs more, and Speed is whether the download is keeping up with playback. The "will it stall" reading is taken from the real playback buffer rather than raw download progress, so it reflects the actual viewing experience. The raw torrent identifiers that only a power user needs move one level down into "More details," present but no longer competing for attention.
The result separates the two audiences this panel really serves: the everyday viewer, who gets an instant, honest read on their stream, and the power user, who can still reach every raw number and copy the info hash to report a bad source. The same telemetry, reframed from "here are the numbers" to "here is what they mean for you."
What changed
How to see it
Play a torrent stream, then open the panel from the network icon in the control bar. Try a fresh stream, a healthy stream, and a fully-cached title.
Review feedback addressed
Thanks for the thorough review — all four points are handled in the latest commit:
bufferedis alwaysnull, and on cast/livekeepingUpis oftennulltoo, which left the score resting on peer count alone. Peer count is swarm connectivity, not proof of smooth playback. So the panel now grades Good/Fair/Poor only when a real playback-evidence signal (buffer runway, or download-vs-bitrate) is measurable. When neither is, it shows a neutral "Limited" state ("A full quality read is not available here.") with the raw signals still visible, instead of guessing. A cast stream that does report keeping-up still grades normally, so a healthy cast stream no longer reads a false Poor.keepingUp === nulldocking the score. Same fix: an unmeasurable signal is dropped, never scored as a penalty.onCopyInfoHashdependencies. Now[infoHash, t, toast], so a mid-stream language switch can't leave a stale-language copy toast.The pure scoring/formatting logic is covered by 93 unit tests, including explicit cast, live, and peers-only cases.
Notes for reviewers
New user-facing strings are added inline as
t('KEY', { defaultValue: '...' }). Here are the new keys that need adding to stremio-translations — I'm happy to open the matching PR there:One deliberate design choice worth calling out: the meter fills to 99% for a perfectly streaming title and only reaches 100% for a fully-downloaded (cached) one, to keep those two states visually distinct.