Repository navigation
fix(app): CSV downloads save instead of opening as a page - #46
Merged
Merged
Conversation
In the app window a CSV link replaced the page with the CSV as text and left no way back: pywebview downloads only what WebKit can't show, or a link with the download attribute, and CSV is text. Every link to an attachment route now carries download, and a test holds every such route to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The offboarded leaver was deleted from the user page after the transfer completed (GAM 7.48.22). The README row, the offboarding runbook and the plan now say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
goetchstone
enabled auto-merge (squash)
October 8, 2026 11:15
no-failure-log: records the operator's check of this branch's own fix. Co-Authored-By: Claude Opus 5.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.
What and why
The bug. In the app window, Builder → a read → Download CSV replaced the page with the CSV shown as text, and the window has no Back, so the only way out was to quit. The Audit export and the onboarding template CSV did the same. Logged in
docs/failure-log/2026-10-08-a-csv-download-opened-as-a-page-in-the-app-window.md.The cause. pywebview 6.2.1's macOS backend downloads a response only when WebKit can't display it (
canShowMIMEType) or when the link has the HTMLdownloadattribute (shouldPerformDownload). CSV is text, so WebKit displays it and ignoresContent-Disposition: attachment.ALLOW_DOWNLOADS = Trueonly enables those two paths. A browser downloads either way, so TestClient and the Chrome a11y run never saw it, and CI never launches the.app.The fix.
downloadon every link to an attachment route (audit.html,onboarding.html,_records_meta.html). WebKit then hands it to pywebview's save panel, in the window's own session (token cookie included).tests/test_app_window_downloads.pyfinds every GET route that sends an attachment and fails unless each is linked withdownload.Also: the first live account delete is recorded (README row, offboarding runbook, plan): the offboarded leaver, from the user page, after the transfer completed.
How it was verified
.venv/bin/python -m pytest -qpasses (1607 passed); the new test fails with the attribute removedmake lintis clean;make a11ypasses (axe 0)Live status: the save panel appearing is reasoned from pywebview's source and unproven until the operator clicks Download CSV in the rebuilt app. The delete ran live on the operator's tenant.
Nothing private
🤖 Generated with Claude Code