Skip to content

Player: Stream Quality panel (redesign of the Statistics popup)#1323

Open
AKnassa wants to merge 3 commits into
Stremio:developmentfrom
AKnassa:feat/stream-health-panel
Open

Player: Stream Quality panel (redesign of the Statistics popup)#1323
AKnassa wants to merge 3 commits into
Stremio:developmentfrom
AKnassa:feat/stream-health-panel

Conversation

@AKnassa

@AKnassa AKnassa commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

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

Screen Recording 2026-07-01 at 12 52 06 AM

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

  • A colour-coded quality meter (Poor / Fair / Good) with a one-line verdict, e.g. "Smooth playback. No pauses expected."
  • Each signal explains itself: Sources ("where your video streams from"), Buffer ("safe to watch before it loads more", in minutes/seconds), Speed ("faster/slower than you're watching").
  • Buffer is read from the real player buffer, so it reflects whether playback will actually stall, not just total download progress.
  • Raw details (Completed %, Info hash) move into a collapsible More details with a smooth expand animation; tap the info hash to copy it.
  • No new dependencies, no extra backend calls (reuses data already fetched). The scoring/formatting logic is pure and covered by 93 unit tests.

How to see it

statistics

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:

  1. Cast reading "Poor" for a healthy stream (and the opposite risk of a false "Good"). You were right that on Chromecast buffered is always null, and on cast/live keepingUp is often null too, 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.
  2. keepingUp === null docking the score. Same fix: an unmeasurable signal is dropped, never scored as a penalty.
  3. Verdict copy contradicting the Buffer row. The verdicts now describe the outcome rather than the buffer, so the headline never says "Buffered well ahead" above a "Buffer: Not available" row (Good is now "Smooth playback. No pauses expected.").
  4. onCopyInfoHash dependencies. 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:

PLAYER_STREAM_QUALITY
PLAYER_QUALITY_CHECKING  PLAYER_QUALITY_GOOD  PLAYER_QUALITY_FAIR  PLAYER_QUALITY_POOR  PLAYER_QUALITY_LIMITED
PLAYER_QUALITY_VERDICT_CHECKING  PLAYER_QUALITY_VERDICT_CACHED  PLAYER_QUALITY_VERDICT_GOOD
PLAYER_QUALITY_VERDICT_FAIR  PLAYER_QUALITY_VERDICT_POOR  PLAYER_QUALITY_VERDICT_LIMITED
PLAYER_SIGNAL_SOURCES  PLAYER_SIGNAL_SOURCES_MEANING
PLAYER_SIGNAL_BUFFER  PLAYER_SIGNAL_BUFFER_MEANING  PLAYER_SIGNAL_BUFFER_MEANING_CACHED
PLAYER_SIGNAL_BUFFER_VALUE_CACHED  PLAYER_SIGNAL_BUFFER_VALUE_UNKNOWN
PLAYER_SIGNAL_SPEED  PLAYER_SIGNAL_SPEED_MEANING_OK  PLAYER_SIGNAL_SPEED_MEANING_SLOW  PLAYER_SIGNAL_SPEED_VALUE_CACHED
PLAYER_MORE_DETAILS  PLAYER_COMPLETED  PLAYER_INFO_HASH  PLAYER_COPY_INFO_HASH  PLAYER_INFO_HASH_COPIED
MB_S  COPIED

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.

AKnassa added 2 commits June 30, 2026 21:52
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.
@AKnassa AKnassa marked this pull request as ready for review July 1, 2026 06:11
@kKaskak kKaskak requested a review from Botsy July 7, 2026 14:10

@Botsy Botsy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Cast path reads "Poor" for healthy streams. On the Chromecast sender path buffered is null (vs ms on the HTML path), so bufferAhead returns 0 and 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.

  2. keepingUp === null scored as "not keeping up." Until duration is known (and for live streams), keepingUp is null, and keepingUp ? 20 : 0 docks 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.

  3. Minor: onCopyInfoHash deps are [infoHash] only — missing t/toast (stale translation on mid-stream language switch; likely trips exhaustive-deps).

  4. Translations: the inline defaultValue strings are fine as a stopgap, but we'd expect the new PLAYER_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.
@AKnassa AKnassa requested a review from Botsy July 8, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants