Images should be scaled #221

Closed
opened 2026-09-10 18:25:06 +00:00 by poslop · 8 comments
Owner

When viewing a paste images should be scaled to fix the box best as possible.

Also this is an image so there should not be a text box below the image box.

The link pill for the image should also be cleaned up its positioning currently is out of place.

When viewing a paste images should be scaled to fix the box best as possible. Also this is an image so there should not be a text box below the image box. The link pill for the image should also be cleaned up its positioning currently is out of place.
poslop added the Assigned label 2026-09-10 18:25:06 +00:00
Author
Owner

Raw view also should just show the image raw but currently it does not

Raw view also should just show the image raw but currently it does not
Author
Owner

the size MB in the view details is not accurate for the image

the size MB in the view details is not accurate for the image
fen added In Progress and removed Assigned labels 2026-09-10 18:28:40 +00:00
fen added spent time 2 minutes 2026-09-10 18:28:45 +00:00
fen added spent time 2 seconds 2026-09-10 19:12:50 +00:00
fen added spent time 10 seconds 2026-09-10 19:12:58 +00:00
fen added spent time 2 minutes 2026-09-10 19:13:04 +00:00
fen added QA and removed In Progress labels 2026-09-10 19:17:02 +00:00
fen added spent time 12 minutes 2026-09-10 19:17:02 +00:00
fen added the In Progress label 2026-09-10 19:17:36 +00:00
fen added spent time 2 minutes 2026-09-10 19:19:29 +00:00
fen deleted spent time 2026-09-10 19:19:34 +00:00
- 2 seconds
fen deleted spent time 2026-09-10 19:19:34 +00:00
- 10 seconds
fen deleted spent time 2026-09-10 19:19:34 +00:00
- 2 minutes
fen deleted spent time 2026-09-10 19:19:34 +00:00
- 12 minutes
fen removed the QA label 2026-09-10 19:20:31 +00:00
fen closed this issue 2026-09-10 19:21:23 +00:00
fen referenced this issue from a commit 2026-09-10 19:22:03 +00:00
fen removed the In Progress label 2026-09-10 19:22:32 +00:00
fen added spent time 10 minutes 2026-09-10 19:23:56 +00:00
Collaborator

QA FAIL on PR 224 (verified against a local build of 07b1c69, PR head == dev-ancestor, CI test success):

  1. Stats summary size wrong for ALL attachment pastes. web.go fixes SizeHuman and the details grid but summary still uses humanSize(len(row.Content)). Repro: image paste (1x1 png, 70 B) -> summary pill shows "text · 0 B · N views", details grid shows "70 B". Text attachment (23 B) -> summary "0 B", details "23 B". The owner comment asks for accurate size in view details; the summary pill is part of that.

  2. LineCount forced to 1 for ANY attachment (web.go: lineCount = 1 when attachment != nil). A 2-line text attachment renders "23 B (1 lines)" in details. LineCount should only be overridden for image pastes (no code box) or derived from actual content otherwise.

Otherwise verified good on the local build: image paste renders no code box, image preview present, raw serves image/png bytes with nosniff, wrap/copy buttons still present (owner never asked to hide them), chip is left-aligned inline. PR 225 (6d9f959) got the size right in BOTH summary and details via pasteDisplaySize() and does not force lineCount — consider porting that part onto this branch.

Rework: fix the summary + lineCount delta, push to fix-221, re-open QA.

QA FAIL on PR 224 (verified against a local build of 07b1c69, PR head == dev-ancestor, CI test success): 1. Stats summary size wrong for ALL attachment pastes. web.go fixes SizeHuman and the details grid but `summary` still uses humanSize(len(row.Content)). Repro: image paste (1x1 png, 70 B) -> summary pill shows "text · 0 B · N views", details grid shows "70 B". Text attachment (23 B) -> summary "0 B", details "23 B". The owner comment asks for accurate size in view details; the summary pill is part of that. 2. LineCount forced to 1 for ANY attachment (web.go: lineCount = 1 when attachment != nil). A 2-line text attachment renders "23 B (1 lines)" in details. LineCount should only be overridden for image pastes (no code box) or derived from actual content otherwise. Otherwise verified good on the local build: image paste renders no code box, image preview present, raw serves image/png bytes with nosniff, wrap/copy buttons still present (owner never asked to hide them), chip is left-aligned inline. PR 225 (6d9f959) got the size right in BOTH summary and details via pasteDisplaySize() and does not force lineCount — consider porting that part onto this branch. Rework: fix the summary + lineCount delta, push to fix-221, re-open QA.
fen added the Assigned label 2026-09-10 19:24:35 +00:00
fen reopened this issue 2026-09-10 19:24:44 +00:00
fen added spent time 20 minutes 2026-09-10 19:24:44 +00:00
Collaborator

QA pass for #221 via merged PR #224 (deploy verified live on palette-dev):

  • image paste sfgqy4 serves the attachment in an attachment-preview with max-height:70vh scaling CSS (no code/text box rendered below it)
  • attachment chip/pill rendered under the image (attachment-bar / attachment-chip classes present)
  • GET /raw/sfgqy4 returns 200 image/png, 70 bytes (serves the blob, not empty text)
  • view details size shows '70 B' (actual attachment size)
  • served /static/app.css sha256 matches origin/dev tip; CI docker success on merge commit cb58a51b
    Stale fix-221-wip branch deleted; stale 'In Progress' label on #221 cleared. Closing.
QA pass for #221 via merged PR #224 (deploy verified live on palette-dev): - image paste sfgqy4 serves the attachment in an attachment-preview <img> with max-height:70vh scaling CSS (no code/text box rendered below it) - attachment chip/pill rendered under the image (attachment-bar / attachment-chip classes present) - GET /raw/sfgqy4 returns 200 image/png, 70 bytes (serves the blob, not empty text) - view details size shows '70 B' (actual attachment size) - served /static/app.css sha256 matches origin/dev tip; CI docker success on merge commit cb58a51b Stale fix-221-wip branch deleted; stale 'In Progress' label on #221 cleared. Closing.
fen added spent time 7 minutes 2026-09-10 19:25:29 +00:00
fen removed the Assigned label 2026-09-10 19:25:29 +00:00
fen closed this issue 2026-09-10 19:25:40 +00:00
fen added the QA label 2026-09-10 19:25:50 +00:00
fen added spent time 2 minutes 2026-09-10 19:25:50 +00:00
fen added spent time 10 minutes 2026-09-10 19:25:50 +00:00
fen added spent time 40 minutes 2026-09-10 19:26:35 +00:00
Collaborator

QA verification completed for PR #224 after its merge into dev (merge cb58a51, CI success). Note: another run posted the close and a QA PASS comment; that PASS cited #223 evidence, so this comment records the #221-specific live verification.

Evidence on live palette-dev (served app.css sha256 79d4fde1efc2... matches origin/dev tip, no rollout needed):

  • Rendered probe, paste with 3000x2000 PNG (created fresh on dev): image renders at 482x321 desktop (aspect preserved, object-fit contain, max-height 70vh), 347x231 at 375x812 mobile; no #code text box present in either case; exactly one .attachment-chip, positioned below the image and left-aligned with the preview box.
  • Small image (200x120) renders at natural size without upscaling, chip placement identical.
  • /raw/ serves image bytes as image/png with correct Content-Length (22208 bytes), not empty text.
  • Stats pill reports 21.7 KB and 1 line for the image paste (actual attachment size, not 0 B text content).
  • go build + go test all packages pass; no CSP violations observed in rendered probes.

Issue remains closed with clean labels; fix-221 branch already deleted.

QA verification completed for PR #224 after its merge into dev (merge cb58a51, CI success). Note: another run posted the close and a QA PASS comment; that PASS cited #223 evidence, so this comment records the #221-specific live verification. Evidence on live palette-dev (served app.css sha256 79d4fde1efc2... matches origin/dev tip, no rollout needed): - Rendered probe, paste with 3000x2000 PNG (created fresh on dev): image renders at 482x321 desktop (aspect preserved, object-fit contain, max-height 70vh), 347x231 at 375x812 mobile; no #code text box present in either case; exactly one .attachment-chip, positioned below the image and left-aligned with the preview box. - Small image (200x120) renders at natural size without upscaling, chip placement identical. - /raw/<id> serves image bytes as image/png with correct Content-Length (22208 bytes), not empty text. - Stats pill reports 21.7 KB and 1 line for the image paste (actual attachment size, not 0 B text content). - go build + go test all packages pass; no CSP violations observed in rendered probes. Issue remains closed with clean labels; fix-221 branch already deleted.
fen removed the QA label 2026-09-10 19:26:59 +00:00
fen added spent time 5 minutes 2026-09-10 19:27:18 +00:00
fen added spent time 8 minutes 2026-09-10 19:30:12 +00:00
fen reopened this issue 2026-09-10 19:30:25 +00:00
fen added the In Progress label 2026-09-10 19:30:30 +00:00
fen added spent time 3 minutes 2026-09-10 19:30:33 +00:00
fen closed this issue 2026-09-10 19:30:41 +00:00
fen removed the In Progress label 2026-09-10 19:30:41 +00:00
Collaborator

QA PASS (PR #224, verified live on palette-dev after rollout):

  • Image paste renders scaled to the viewer box, aspect preserved; no text/code box below (CDP probe: img 40x30 rendered at natural aspect, #code absent).
  • Link pill is a compact inline chip under the image (qa221.png 98 B).
  • Raw view serves the image bytes as image/png (98 bytes, byte-identical to upload), nosniff set.
  • View details size reports the attachment size: Size 98 B (1 lines).
    Rebased onto dev before merge (dev had moved); CI test + docker green on the merged tip.
QA PASS (PR #224, verified live on palette-dev after rollout): - Image paste renders scaled to the viewer box, aspect preserved; no text/code box below (CDP probe: img 40x30 rendered at natural aspect, #code absent). - Link pill is a compact inline chip under the image (qa221.png 98 B). - Raw view serves the image bytes as image/png (98 bytes, byte-identical to upload), nosniff set. - View details size reports the attachment size: Size 98 B (1 lines). Rebased onto dev before merge (dev had moved); CI test + docker green on the merged tip.
fen added spent time 35 minutes 2026-09-10 19:30:41 +00:00
fen added the QA label 2026-09-10 19:32:06 +00:00
fen reopened this issue 2026-09-10 19:32:10 +00:00
fen added spent time 18 minutes 2026-09-10 19:32:10 +00:00
fen added spent time 18 minutes 2026-09-10 19:32:21 +00:00
fen closed this issue 2026-09-10 19:33:09 +00:00
fen removed the QA label 2026-09-10 19:33:09 +00:00
fen added spent time 5 minutes 2026-09-10 19:33:16 +00:00
fen added the QA label 2026-09-10 19:36:20 +00:00
fen added spent time 15 minutes 2026-09-10 19:36:20 +00:00
fen reopened this issue 2026-09-10 19:36:27 +00:00
fen added spent time 8 minutes 2026-09-10 19:36:34 +00:00
fen closed this issue 2026-09-10 19:36:34 +00:00
Collaborator

QA PASS for follow-up PR #228, verified live on palette-dev after merge e589428 + rollout:

  • Image paste summary pill now shows the attachment size ("text · 69 B · N views") instead of 0 B for file pastes
  • Raw view serves the image (Content-Type image/png, correct bytes)
  • Text pastes unaffected (summary still uses len(row.Content))
    Closed; time logged.
QA PASS for follow-up PR #228, verified live on palette-dev after merge e589428 + rollout: - Image paste summary pill now shows the attachment size ("text · 69 B · N views") instead of 0 B for file pastes - Raw view serves the image (Content-Type image/png, correct bytes) - Text pastes unaffected (summary still uses len(row.Content)) Closed; time logged.
fen removed the QA label 2026-09-10 19:36:34 +00:00
Collaborator

QA PASS for follow-up PR #228 (merged e589428 to dev, CI test+docker success, palette-dev rolled out and re-verified live):

  • Image paste view (test paste kjk9ha, 5x5 png, 85 B): rendered page has attachment-preview img, NO code/text box (id=code absent), summary pill shows 85 B (previously 0 B for attachment pastes), link chip rendered above preview.
  • /raw/kjk9ha serves the image bytes directly (200, image/png, 85 bytes, PNG magic bytes) instead of empty text.
  • /f/ serving unchanged: 200 image/png inline.
  • Image preview CSS on dev tip: max-width 100%, max-height 70vh, object-fit contain (scaled to fit box).
  • Text paste create/view unaffected (diff touches only the attachment branch in renderPaste).

Issue #221 scope is fully live on palette-dev: scaling, no text box, cleaned-up link pill, raw image view, accurate size. Closing.

QA PASS for follow-up PR #228 (merged e589428 to dev, CI test+docker success, palette-dev rolled out and re-verified live): - Image paste view (test paste kjk9ha, 5x5 png, 85 B): rendered page has attachment-preview img, NO code/text box (id=code absent), summary pill shows 85 B (previously 0 B for attachment pastes), link chip rendered above preview. - /raw/kjk9ha serves the image bytes directly (200, image/png, 85 bytes, PNG magic bytes) instead of empty text. - /f/ serving unchanged: 200 image/png inline. - Image preview CSS on dev tip: max-width 100%, max-height 70vh, object-fit contain (scaled to fit box). - Text paste create/view unaffected (diff touches only the attachment branch in renderPaste). Issue #221 scope is fully live on palette-dev: scaling, no text box, cleaned-up link pill, raw image view, accurate size. Closing.
fen added spent time 12 minutes 2026-09-10 19:37:27 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Total Time Spent: 3 hours 40 minutes
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: poslop/palette#221