Skip to content

Fix document preview and add download button#62

Merged
Empreiteiro merged 1 commit intomainfrom
fix/document-preview-and-download
Mar 27, 2026
Merged

Fix document preview and add download button#62
Empreiteiro merged 1 commit intomainfrom
fix/document-preview-and-download

Conversation

@Empreiteiro
Copy link
Copy Markdown
Owner

Summary

  • Fix preview: File endpoint now serves files inline by default (Content-Disposition: inline) so PDFs render in iframes and images display in <img> tags
  • No auto-download: Removed the unintended auto-download behavior on page load
  • Download button: Added explicit "Download" button in the document header that uses ?download=true to trigger the browser download

Test plan

  • Open a PDF document detail page — PDF renders in the preview iframe
  • Open an image document — image renders in the preview area
  • Click "Download" button — file downloads correctly
  • Preview loads without triggering a download

🤖 Generated with Claude Code

The file endpoint was returning Content-Disposition: attachment which
caused browsers to download instead of rendering inline previews.
Now serves files inline by default for iframe/img preview, with a
?download=true query param for explicit downloads via a new button.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Empreiteiro Empreiteiro merged commit c3d0d99 into main Mar 27, 2026
@Empreiteiro Empreiteiro deleted the fix/document-preview-and-download branch March 27, 2026 13:57
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.

1 participant