Prefer full-res images/GIFs and promote leftover image enclosures in the Reader #38

Closed
opened 2026-08-03 18:57:12 +00:00 by TheAnachronism · 1 comment

Parent

Part of #30

Implements docs/specs/reader-media.md.

What to build

In the Reader, prefer a full-resolution image/GIF when a better URL is already present in the article HTML, sibling image links, or image enclosures — no scrapers. Present content images in a table-safe way so Reddit-style feed tables do not hide the picture. Promote leftover image/* enclosures (including image/generic) into inline media after the body, and suppress attachment chips for promoted or preference-consumed enclosures. Keep non-image attachments (including audio) as chips. Failed images show a visible failure state with Open media and Open original. List hub Article thumbnails stay unchanged.

Extract a pure Reader media planner as needed (preference + image promotion/dedupe + shared URL helpers) and cover it with fixture-oriented tests from .scratch/rss-examples/ (especially the Reddit example). Feel reference only: branch prototype/reader-media — do not merge the throwaway package.

Acceptance criteria

  • Reddit-style preview <img> upgrades to the full-resolution GIF/image when a same-basename / size-upgrade candidate is already in HTML, links, or image enclosures
  • Duplicate image enclosures that match a shown/preferred image suppress their attachment chips
  • Leftover image enclosures not already in the HTML appear as inline images after the body
  • Content images inside feed <table> markup still appear as full-width Reader media
  • Image load failure shows Open media + Open original (not a silent blank / bare broken icon only)
  • Non-image attachments (including audio) remain labeled chips; no in-app audio player
  • List hub Article thumbnail / flavor_image behavior is unchanged
  • Planner / preference+promotion behavior is covered by tests against the RSS fixtures (or equivalent article HTML + attachments inputs)

Blocked by

None — can start immediately.

## Parent Part of #30 Implements [`docs/specs/reader-media.md`](https://git.anachronis.dev/TheAnachronism/tt-rss-viewer/src/branch/master/docs/specs/reader-media.md). ## What to build In the **Reader**, prefer a full-resolution image/GIF when a better URL is already present in the article HTML, sibling image links, or image enclosures — no scrapers. Present content images in a table-safe way so Reddit-style feed tables do not hide the picture. Promote leftover `image/*` enclosures (including `image/generic`) into inline media after the body, and suppress attachment chips for promoted or preference-consumed enclosures. Keep non-image attachments (including audio) as chips. Failed images show a visible failure state with **Open media** and **Open original**. List hub Article thumbnails stay unchanged. Extract a pure Reader media planner as needed (preference + image promotion/dedupe + shared URL helpers) and cover it with fixture-oriented tests from `.scratch/rss-examples/` (especially the Reddit example). Feel reference only: branch `prototype/reader-media` — do not merge the throwaway package. ## Acceptance criteria - [ ] Reddit-style preview `<img>` upgrades to the full-resolution GIF/image when a same-basename / size-upgrade candidate is already in HTML, links, or image enclosures - [ ] Duplicate image enclosures that match a shown/preferred image suppress their attachment chips - [ ] Leftover image enclosures not already in the HTML appear as inline images after the body - [ ] Content images inside feed `<table>` markup still appear as full-width Reader media - [ ] Image load failure shows Open media + Open original (not a silent blank / bare broken icon only) - [ ] Non-image attachments (including audio) remain labeled chips; no in-app audio player - [ ] List hub Article thumbnail / `flavor_image` behavior is unchanged - [ ] Planner / preference+promotion behavior is covered by tests against the RSS fixtures (or equivalent article HTML + attachments inputs) ## Blocked by None — can start immediately.
Author
Owner

Resolution

Implemented on master (e45580849a):

  • Pure planner: lib/reader/reader_media_plan.dart — full-res image/GIF preference, image enclosure promote/dedupe, extractImgSrcs / stripImgs for table-safe hoist
  • Reader wiring: hoisted + promoted images with Open media / Open original failure card; remaining non-image attachments stay chips
  • Tests: test/reader/reader_media_plan_test.dart (Reddit fixture shape + promote + audio chip + hoist helpers)
  • List hub thumbnails untouched; no throwaway prototype merge; video/embeds left for #39/#40
## Resolution Implemented on `master` (`e45580849a`): - Pure planner: [`lib/reader/reader_media_plan.dart`](https://git.anachronis.dev/TheAnachronism/tt-rss-viewer/src/branch/master/lib/reader/reader_media_plan.dart) — full-res image/GIF preference, image enclosure promote/dedupe, `extractImgSrcs` / `stripImgs` for table-safe hoist - Reader wiring: hoisted + promoted images with **Open media** / **Open original** failure card; remaining non-image attachments stay chips - Tests: [`test/reader/reader_media_plan_test.dart`](https://git.anachronis.dev/TheAnachronism/tt-rss-viewer/src/branch/master/test/reader/reader_media_plan_test.dart) (Reddit fixture shape + promote + audio chip + hoist helpers) - List hub thumbnails untouched; no throwaway prototype merge; video/embeds left for #39/#40
Sign in to join this conversation.
No description provided.