Preview attachments in Postvak and Meelezen #467

Merged
robbertbos merged 3 commits from postvak-attachment-previews into main 2026-09-28 20:35:39 +00:00
Owner

A non-image attachment on a Postvak or Meelezen message was a plain link to the file proxy. The proxy serves HTML as a download on purpose (the rendered view only exists behind ?preview=html), so an HTML report never previewed. MessageItem now draws the file cards AttachmentPreview already gives a card: HTML opens in the sandboxed preview, PDF, text and video in theirs, and every file keeps its download button.

MessageItem also draws the card modal's thread and channel context, so those get the same file cards.

The image viewer now steps to the previous and next image of a message (arrows, counter, ArrowLeft/ArrowRight). ImageLightbox already supported this, but MessageItem only ever handed it the clicked image. It now emits every image of the message with the clicked index. The same wiring is added to the channel context and to the card modal's own message.

The Postvak dev-mock's attachments had no file id (the proxy could not serve them) and no HTML file; both fixed in a separate commit.

Checked in the preview with Playwright: a Postvak row shows the file cards, and clicking rapport.html opens the HTML preview with a sandbox="allow-scripts" iframe on ?preview=html.

A non-image attachment on a Postvak or Meelezen message was a plain link to the file proxy. The proxy serves HTML as a download on purpose (the rendered view only exists behind `?preview=html`), so an HTML report never previewed. `MessageItem` now draws the file cards `AttachmentPreview` already gives a card: HTML opens in the sandboxed preview, PDF, text and video in theirs, and every file keeps its download button. `MessageItem` also draws the card modal's thread and channel context, so those get the same file cards. The image viewer now steps to the previous and next image of a message (arrows, counter, ArrowLeft/ArrowRight). `ImageLightbox` already supported this, but `MessageItem` only ever handed it the clicked image. It now emits every image of the message with the clicked index. The same wiring is added to the channel context and to the card modal's own message. The Postvak dev-mock's attachments had no file id (the proxy could not serve them) and no HTML file; both fixed in a separate commit. Checked in the preview with Playwright: a Postvak row shows the file cards, and clicking `rapport.html` opens the HTML preview with a `sandbox="allow-scripts"` iframe on `?preview=html`.
The unread mock's files had no id, so the file proxy could not serve
them, and there was no HTML attachment to open a preview on.
Preview attachments in Postvak and Meelezen
All checks were successful
CI / pre-commit (pull_request) Successful in 2m7s
security-scan / Python SCA (pip-audit) (pull_request) Successful in 54s
security-scan / Python SAST (bandit) (pull_request) Successful in 33s
security-scan / JS SCA (npm audit) (pull_request) Successful in 33s
CI / frontend-test (pull_request) Successful in 4m50s
security-scan / Filesystem scan (trivy fs) (pull_request) Successful in 24s
security-scan / SBOM (trivy) (pull_request) Successful in 17s
test-build / build (backend) (pull_request) Successful in 2m12s
test-build / build (frontend) (pull_request) Successful in 2m13s
test-build / build (pull_request) Successful in 0s
CI / e2e (pull_request) Successful in 15m50s
CI / backend-test (pull_request) Successful in 17m12s
CI / release-scripts (pull_request) Successful in 17s
6e34e526df
MessageItem drew a non-image file as a plain link to the file proxy,
which serves HTML as a download by design: the rendered view only
exists behind ?preview=html. Draw the file cards AttachmentPreview
already gives a card instead, so HTML, PDF, text and video open in
their preview and every file keeps a download button.

MessageItem also draws the card modal's thread and channel context,
which get the same file cards.
robbertbos force-pushed postvak-attachment-previews from 6e34e526df
All checks were successful
CI / pre-commit (pull_request) Successful in 2m7s
security-scan / Python SCA (pip-audit) (pull_request) Successful in 54s
security-scan / Python SAST (bandit) (pull_request) Successful in 33s
security-scan / JS SCA (npm audit) (pull_request) Successful in 33s
CI / frontend-test (pull_request) Successful in 4m50s
security-scan / Filesystem scan (trivy fs) (pull_request) Successful in 24s
security-scan / SBOM (trivy) (pull_request) Successful in 17s
test-build / build (backend) (pull_request) Successful in 2m12s
test-build / build (frontend) (pull_request) Successful in 2m13s
test-build / build (pull_request) Successful in 0s
CI / e2e (pull_request) Successful in 15m50s
CI / backend-test (pull_request) Successful in 17m12s
CI / release-scripts (pull_request) Successful in 17s
to 7125243e81
Some checks failed
CI / pre-commit (pull_request) Successful in 2m14s
CI / release-scripts (pull_request) Successful in 18s
security-scan / Python SCA (pip-audit) (pull_request) Successful in 49s
security-scan / Python SAST (bandit) (pull_request) Successful in 32s
security-scan / JS SCA (npm audit) (pull_request) Successful in 33s
CI / frontend-test (pull_request) Successful in 4m48s
security-scan / Filesystem scan (trivy fs) (pull_request) Successful in 25s
security-scan / SBOM (trivy) (pull_request) Successful in 17s
test-build / build (backend) (pull_request) Successful in 2m16s
test-build / build (frontend) (pull_request) Successful in 2m9s
test-build / build (pull_request) Successful in 0s
CI / e2e (pull_request) Successful in 15m13s
CI / backend-test (pull_request) Successful in 16m24s
CI / pre-commit (push) Successful in 2m13s
CI / release-scripts (push) Successful in 17s
publish-and-stage / decide (push) Successful in 10s
security-scan / Python SCA (pip-audit) (push) Successful in 49s
security-scan / Python SAST (bandit) (push) Successful in 32s
security-scan / JS SCA (npm audit) (push) Successful in 31s
CI / frontend-test (push) Successful in 4m43s
security-scan / SBOM (trivy) (push) Successful in 15s
publish-and-stage / build (backend) (push) Has been skipped
publish-and-stage / build (frontend) (push) Has been skipped
publish-and-stage / deploy-staging (push) Has been skipped
CI / e2e (push) Has been cancelled
tag-release / release (push) Successful in 14s
security-scan / Filesystem scan (trivy fs) (push) Successful in 26s
publish-and-stage / build (push) Successful in 0s
CI / backend-test (push) Has been cancelled
2026-09-28 20:07:08 +00:00
Compare
robbertbos deleted branch postvak-attachment-previews 2026-09-28 20:35:39 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
robbertbos/waggle!467
No description provided.