Add document download#16
Merged
Merged
Conversation
9a4da25 to
1501943
Compare
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.
Summary
?download=1mode on/api/filesets a sanitizedContent-Disposition: attachmentheader; existing inline behavior, path-safety, and content-type handling are unchanged.downloadUrl(path)builder, arefreshDownloadButton()visibility helper wired into every active-document state change, native browser download via a temporary<a download>.Test coverage (4 layers)
server_test.go): header set, basename, filename sanitization (CRLF/quote injection blocked), inline-preservation, body-unchanged.e2e_test.go):?download=1over a realhttptestserver assertsContent-Dispositionand that inline requests omit it.app.test.js): puredownloadUrlbuilder incl. encoding of spaces, slashes, and query-delimiter chars.web/e2e/download.e2e.js, Playwright + Chromium): builds and drives the real binary; asserts button hidden→appears, text download (byte-exact content), binary download fidelity, and hides after closing the last tab. Verified with a teeth-check (tests fail when the feature is broken). New isolated CIe2ejob; dev-only dependency, shipped binary unchanged.Design & plans
docs/specs/2026-06-26-document-download-design.md,docs/specs/2026-06-26-download-e2e-design.mddocs/plans/2026-06-26-document-download.md,docs/plans/2026-06-26-download-e2e.mdTest Plan
go test -race ./...— passnpm test— 60/60 (unit; does not run the e2e file)npm run e2e— 5/5 (Playwright, real binary)go vet/gofmt -lclean