Skip to content

feat(demo): a "My file does not play" button on the player page - #156

Merged
alekswebnet merged 1 commit into
mainfrom
feat/demo-report-button
Nov 8, 2026
Merged

alekswebnet merged 1 commit into
mainfrom
feat/demo-report-button

Conversation

@alekswebnet

Copy link
Copy Markdown
Contributor

Summary

People who try their own .h5p on the demo's player page can now tell us when it does not play. Closes #155.

Changes

Once something has been played, a My file does not play button appears under the player. It opens the repository's bug report form in a new tab, without opener, filled in from the load:

  • the file's name or link, and how to open it again: a ?src= link to the page, or "choose the file from disk";
  • the Trusted/Untrusted, Newest libraries and Older if needed switches;
  • the content type, from metadata, or from missingLibraries.mainLibrary when the package was refused;
  • the player's error, or the state it reached when there was none;
  • the player's version (__PLAYER_VERSION__), the browser and the OS;
  • the event log, oldest first and without the xAPI lines.

The visitor reads the report on GitHub and sends it if they choose. Nothing leaves the page on its own, and the file goes only if they attach it: the form says GitHub takes it renamed to .zip, up to 25 MB.

Every address loses its query and fragment, in the log too, since a signed URL carries its credentials there and an issue is public. labels isn't passed, because GitHub answers a visitor who may not set labels with a 404; the form adds bug itself. The log is cut from its middle to keep the address under 7,000 characters, short of GitHub's 414.

design/demo.md describes the button.

Verification

Demo pages are checked by hand, per design/testing.md. I drove the page in Chromium with Playwright, against pnpm dev and then against pnpm build:demo served by pnpm preview:demo under the production headers and CSP. The results were the same on both. In each case below, I read the opened address back and decoded it.

Case What the report said
A broken package picked from disk (its library's script defines another name) runtime error, content type H5P.GreetingCard1, "choose the file from disk", size
A link with ?token=SECRET123#frag No trace of the query anywhere, the log included, and "(its query left out)"
A good load, then a link that answers 404 network error, content type "not known", not the earlier quiz's
An untrusted refusal (an h5p.org Course Presentation needing its own Drop and Tether) The refusal and H5P.CoursePresentation
A real click A new tab at github.com/…/issues/new?template=bug_report.yml&…, with no opener

The addresses were 1.4–1.9 kB. The row stays hidden until the first load. The button and its note fit side by side on a wide screen and wrap at 390 px, in light and dark.

Not verified: how GitHub draws the filled-in form, which needs a signed-in browser. GitHub documents that a form's fields fill from the query by their id. Whether that covers the component dropdown isn't documented. If it doesn't, the visitor picks the component, which the form requires anyway.

  • Tests added or updated where behavior changed: demo pages have no tests
  • Documentation updated where public behavior or deployment changed
  • Relevant type checks, tests, and builds pass: pnpm build:demo
  • No security-sensitive details or credentials are included

Screenshots or reproduction

Play anything on the player page, the Vercel preview included, and press My file does not play under the player.

Once something has been played, the button opens the repository's bug
report form in a new tab, filled in from the load: the file's name or
link, the switches, the content type, the error, the player's version
and the event log. Nothing is sent from the page, the file goes only if
the visitor attaches it, and every address loses its query and fragment.

Closes #155
@alekswebnet alekswebnet self-assigned this Nov 8, 2026
@alekswebnet
alekswebnet merged commit 28cc46b into main Nov 8, 2026
8 checks passed
@alekswebnet
alekswebnet deleted the feat/demo-report-button branch November 8, 2026 13:37
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.

Demo: let visitors report a file that does not play

1 participant