Add in-app experiment file downloads (Downloads menu + ZIP endpoint) - #13
Merged
Merged
Conversation
New GET /api/experiments/{id}/download zips an experiment's whole folder
(images, metadata.json, saved config XML) and serves it as an attachment.
Built to a temp file on disk rather than in memory -- a multi-day run can
accumulate hundreds of JPEGs, and holding the whole archive in an
io.BytesIO() risks real memory pressure on a Pi with as little as 2GB RAM.
New Downloads screen (TopNav, modeled on ImportConfigMenu) lists the
current researcher's own experiments -- filtered client-side by the same
getUsername() value already written into each experiment folder name --
with a per-experiment "Download ZIP" link. This box has no auth, so the
filter is a UI convenience (see "my experiments" vs "everyone's"), not
access control; documented as such in the code and README.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a Downloads screen so a researcher can pull their own experiment files straight from the web app — no SSH, no Samba, no leaving the browser. Works from any device on the LAN at
http://<pi-ip>:8000, same as the kiosk.GET /api/experiments/{id}/downloadzips an experiment's whole folder (images,metadata.json, saved config XML) and serves it as an attachment.io.BytesIO()would put the whole thing in RAM at once, which risks real memory pressure on a Pi with as little as 2GB — especially one sitting unattended mid-protocol. Disk understorage_rootis comparatively abundant. The temp file is removed by a background task once the response is sent.Rebased onto
mainafter #12; the only conflict was both branches appending a bullet to the same README feature list. Verified the two features coexist: 158 backend tests pass,npm run typecheckandnpm run buildclean.