Optimize oversized screenshots before mobile capture #495

Closed
opened 2026-08-10 15:49:11 +00:00 by timmy · 0 comments
Owner

Problem

Modern phone screenshots can exceed the dashboard's 2 MiB boundary. frontend/issue-attachment.js rejects them before preview even though valid PNG, JPEG, and WebP images can be resized locally. This interrupts both new-issue and comment capture and is not covered by any of the 250 historical issue titles or recent commits through 37aa2dd.

Product slice

Optimize oversized screenshots on-device before preview and durable offline storage. Keep already-valid files byte-for-byte unchanged, preserve drafts on failures, and retain server-side signature/type/size validation.

Acceptance

  • A valid PNG/JPEG/WebP over 2 MiB is decoded and iteratively resized/encoded to at most 2 MiB instead of rejected.
  • A valid image at or below 2 MiB is returned unchanged.
  • New-issue and comment capture both consume the optimized Blob/File.
  • Offline persistence stores the optimized bytes once for deterministic retries.
  • Decode/encode failure preserves the draft and shows actionable guidance.
  • Behavioral tests cover optimization, unchanged files, integration, and failure; full suite passes.
## Problem Modern phone screenshots can exceed the dashboard's 2 MiB boundary. `frontend/issue-attachment.js` rejects them before preview even though valid PNG, JPEG, and WebP images can be resized locally. This interrupts both new-issue and comment capture and is not covered by any of the 250 historical issue titles or recent commits through `37aa2dd`. ## Product slice Optimize oversized screenshots on-device before preview and durable offline storage. Keep already-valid files byte-for-byte unchanged, preserve drafts on failures, and retain server-side signature/type/size validation. ## Acceptance - A valid PNG/JPEG/WebP over 2 MiB is decoded and iteratively resized/encoded to at most 2 MiB instead of rejected. - A valid image at or below 2 MiB is returned unchanged. - New-issue and comment capture both consume the optimized Blob/File. - Offline persistence stores the optimized bytes once for deterministic retries. - Decode/encode failure preserves the draft and shows actionable guidance. - Behavioral tests cover optimization, unchanged files, integration, and failure; full suite passes.
timmy self-assigned this 2026-08-10 15:49:11 +00:00
timmy closed this issue 2026-08-10 15:58:36 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
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: stackchain/stackchain-dashboard#495
No description provided.