Pictures: one blob URL each, made once and let go with the picture #275

Merged
littlefox merged 2 commits from issue-227-images into main 2026-10-22 09:48:19 +00:00
Owner

Refs #227

ImageView base64-encoded the whole picture into a data: URL on every redraw, then used that string twice (the picture and "Spara bilden"). Each picture was held as its bytes plus two copies as text.

  • Browser: one blob: URL per picture. It is made when the picture is shown and revoked when it goes, for example when its post scrolls far away (#236). The picture and the save link share it.
  • Desktop: the app doesn't run in the webview there, so it keeps a data: URL, now made once per picture.

Verified:

  • images.spec.ts now checks that the src is a blob: URL and the save link uses the same one.
  • It checks that showing the picture at full size keeps the same URL, and that the URL still loads.
  • It checks that once the reader moves on, the picture is gone and its URL no longer loads.
  • The spec passes on desktop, iPhone and Android; the screenshot is unchanged; clippy passes all three ways.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8

Refs #227 `ImageView` base64-encoded the whole picture into a `data:` URL on every redraw, then used that string twice (the picture and "Spara bilden"). Each picture was held as its bytes plus two copies as text. - **Browser:** one `blob:` URL per picture. It is made when the picture is shown and revoked when it goes, for example when its post scrolls far away (#236). The picture and the save link share it. - **Desktop:** the app doesn't run in the webview there, so it keeps a `data:` URL, now made once per picture. Verified: - `images.spec.ts` now checks that the src is a `blob:` URL and the save link uses the same one. - It checks that showing the picture at full size keeps the same URL, and that the URL still loads. - It checks that once the reader moves on, the picture is gone and its URL no longer loads. - The spec passes on desktop, iPhone and Android; the screenshot is unchanged; clippy passes all three ways. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
ImageView base64-encoded the whole picture into a data: URL on every
redraw, and used the string twice (the picture and "Spara bilden"), so
each picture sat in memory as its bytes plus two copies as text. In the
browser it is now a blob: URL, made when the picture is shown and
revoked when it goes (its post scrolled away, #236); desktop keeps a
data: URL but makes it once.

Refs #227

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
Merge remote-tracking branch 'origin/main' into issue-227-images
All checks were successful
ci / check (push) Successful in 12m17s
packaging / arch (pull_request) Successful in 15m46s
ci / desktop (push) Successful in 17m55s
packaging / nix (pull_request) Successful in 28m17s
packaging / debian (pull_request) Successful in 29m30s
packaging / fedora (pull_request) Successful in 35m7s
packaging / release (pull_request) Has been skipped
ci / e2e (push) Successful in 36m31s
a6fc48e70e
littlefox referenced this pull request from a commit 2026-10-22 14:11:06 +00:00
Sign in to join this conversation.
No description provided.