Skip to content

feat(play): a framing page that saves files is handed the package by Download (#98) - #99

Merged
alekswebnet merged 3 commits into
mainfrom
feat/play-host-saves
Nov 24, 2026
Merged

alekswebnet merged 3 commits into
mainfrom
feat/play-host-saves

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #98. Part of missing-elements/h5p-toolkit#210.

Inside a chat's card the play page's Download did nothing: the chat lets the frame save no file. The card can ask the chat to save one. Now a framing page that saves files says so, and Download hands it the package.

For the page that frames this one

All optional. With no saves, the page saves as before.

Message Way What it does
{ type: 'saves', max } to the page The framing page saves files itself. max is the most bytes it takes; none means any size.
{ type: 'save', id, file } from the page Download was pressed: save this package. id numbers the save. Sent where the page would have saved it: at once for a package with its files in it, and after the bytes are brought and the package built for one whose video plays from the chat.
{ type: 'saved', id, ok } to the page How the save with that id went, ok a boolean. Only word on the last package handed is taken. No word in a minute is taken as not saved; a yes that comes later is still said.
sizes, beside links to the page { 'clip.mp4': bytes }: what the file at each address weighs. A video that would make a package above max is then not fetched for it.

What a person sees

  • One Download that works. Pressed, the button says "Saving…", and a row under the stage "The chat is saving the .h5p…" with a bar, then "Saved. Look in your downloads.", which goes after a few seconds.
  • Not saved: "The chat did not save it. Open it in the build page, and download it there.", with the build page as the row's button.
  • Too big for the chat: "This .h5p is 235 MB, more than the chat can save from here. Open it in the build page, choose your video there, and download it." For a video still at its address, said before anything is brought: "With your video in it, this .h5p is over 230 MB…".
  • Outside a chat, and in one that says no saves: as before.

Testing

By hand, as this repository has no page tests: the built site served locally and framed by a page of another origin acting as a card that saves files, with a store on a third origin.

Case Result
A quiz, max 64 MB, the card answers yes (light and dark at 720 px, light at 360 px) "The chat is saving…", then "Saved…", then the row goes; one save with the 882 kB package; the browser saves nothing
A quiz, the card first answers with another number, with no number, and with no ok the row stays on saving until the real answer, then the saved row
A quiz, the card answers no the not-saved row, its button to /h5p/build/ with the source
A quiz above max the too-big row at once, no save
A quiz, no saves the browser saves water.h5p, no row: as before
An Interactive Video from its address, its size given, above max (720 and 360 px) the too-big row at once, "over 2.1 MB"; no needs-bytes, nothing fetched
The same within max needs-bytes, the package built, one save with the 6.3 MB package, "Saved…"
The same above max, no size given the bytes brought and the package built, then the too-big row with its real size, no save

Not verified

  • Not in ChatGPT: the card has to say saves and answer save with the chat's own save first, the next step of h5p-toolkit#210.
  • The minute with no answer: not waited out in a test.
  • Whether "Open in the build page" opens a tab from inside ChatGPT's card, as the row's button or the bar's.
  • What the largest file a chat's save takes is.
  • Chromium only.

Summary by cubic

The play page's Download now hands a package to a framing page that saves files, where before it could not save anything inside a chat's card.

  • A framing page sends { type: 'saves', max } to say it saves files itself; Download sends { type: 'save', file, id } and expects { type: 'saved', id, ok } back, where only the word on the last one handed counts, and a minute of silence is taken as not saved.
  • The row under the stage shows "Saving…", "The chat is saving the .h5p…", then "Saved. Look in your downloads.", or the not-saved row with a button to the build page.
  • A package above max is not handed over, and a video that would make one is not fetched when the frame gave its size (sizes beside links); the too-big row offers the build page instead.
  • A link the parent gives again, as with its size once known, no longer starts the build afresh.
  • With no saves message, behavior is unchanged.

Written for commit 0785753. Summary will update on new commits.

View guided diff Turn on auto-fix

…Download (#98)

Inside a chat's card the page's own Download saved nothing: the chat lets the frame save no file, and drops the press unsaid. The card can ask the chat to save one. So a framing page says it saves files, with the most it takes ({ type: 'saves', max }), and Download hands it the package ({ type: 'save', file }) where the page would have saved it; the framing page says how it went ({ type: 'saved', ok }), which the row under the stage says: saving, saved, or not saved, with the build page to open. No word in a minute is taken as not saved.

A package above max is not handed over, and a video that would make one is not fetched for it where the framing page gave its size (sizes, beside links): the row says the size and offers the build page, where the person chooses the file and downloads as anywhere.

With no 'saves', everything is as it was.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread src/h5p/play/play-page.ts Resolved
Comment thread src/h5p/play/play-page.ts Resolved
@alekswebnet
alekswebnet merged commit 9c3d169 into main Nov 24, 2026
4 checks passed
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.

play: Download saves nothing inside a chat's card; the card can save, so the page should hand it the file

1 participant