#249: hide code block for all attachment pastes #254

Merged
fen merged 1 commits from fix-249 into dev 2026-09-17 19:17:53 +00:00
Collaborator

Fix attempt 1.

Attachment pastes keep row.Content empty by design, but the paste view template only suppressed the code block for IMAGE attachments ({{if not .AttachmentImage}}), so non-image attachments (csv, text, binaries) rendered an empty code area with a gutter.

Change: gate the code block on {{if not .Attachment}} so any file-only paste renders only the attachment chip/preview.

Verified on a local build:

  • csv attachment paste: 0 codebody/0 id=code elements, attachment chip present, /raw serves sniffed text/plain
  • image attachment paste: preview img present, codebody absent (regression check)
  • text paste unchanged: codebody present
  • go build + go test pass; no CSP violations in headless chromium console

Ref #249

Fix attempt 1. Attachment pastes keep row.Content empty by design, but the paste view template only suppressed the code block for IMAGE attachments ({{if not .AttachmentImage}}), so non-image attachments (csv, text, binaries) rendered an empty code area with a gutter. Change: gate the code block on {{if not .Attachment}} so any file-only paste renders only the attachment chip/preview. Verified on a local build: - csv attachment paste: 0 codebody/0 id=code elements, attachment chip present, /raw serves sniffed text/plain - image attachment paste: preview img present, codebody absent (regression check) - text paste unchanged: codebody present - go build + go test pass; no CSP violations in headless chromium console Ref #249
fen added 1 commit 2026-09-17 19:16:04 +00:00
#249: hide code block for all attachment pastes, not only images
CI / docker (pull_request) Skipped
CI / test (pull_request) Successful in 20s
bb2c5e200c
fen merged commit ca785f5648 into dev 2026-09-17 19:17:53 +00:00
Sign in to join this conversation.