Show the collected content: thumbnails and a gallery

Until now a collected image was a row of text, and after a restart it was not
visible at all. The collect list gains a row thumbnail, and a Gallery page
browses the whole store with filters by source, format and address, paged at
120 tiles, with a built-in viewer showing the full size beside its provenance.

Thumbnails decode straight to the width they are drawn at. That is the whole
memory story: a 4000x3000 JPEG is about 48 MB once decoded, so decoding full
size and scaling afterwards runs out of memory long before the user finishes
scrolling. The cache is bounded and owns its bitmaps, which means its capacity
has to comfortably exceed a page - a bitmap evicted while still on screen would
be disposed out from under the renderer.

Paged rather than infinite-scrolled for the same reason: how much to decode is a
decision the page should make, not one the archive's size makes for it.

Video is not previewed and will not be. Extracting a first frame means FFmpeg,
which is a media stack in exchange for one picture per tile; those tiles show a
format badge instead. The refusal happens before touching the disk, because
attempting it would be an exception per tile.

Rendering the page caught the viewer overlay being see-through: it named a brush
that does not exist, and an unresolved DynamicResource fails silently - the
property just keeps its default. That is the second silent-reference bug to
reach a screenshot, so both kinds now have guards: one resolves every
{DynamicResource} in the XAML against both themes, the other checks every
{l:Loc} key exists. Both were confirmed to fail before being kept.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Leonid Pershin
2026-08-13 22:55:28 +03:00
co-authored by Claude Opus 5
parent f8744c930a
commit ceacec79e2
25 changed files with 1706 additions and 2 deletions
+16
View File
@@ -241,6 +241,21 @@ throttle 250 мс — пул дёргается на каждый исход л
свежая CVE не роняла сборку кода, который никто не трогал.
- Тестовые послабления анализаторов — в `tests/Directory.Build.props`, не в самих тестах.
## Отображение медиа
- **Миниатюры декодируются в нужную ширину**, а не декодируются целиком и потом масштабируются.
На архиве это разница между «работает» и «кончилась память».
- **Кэш владеет своими `Bitmap` и удаляет их при вытеснении**, поэтому вызывающий не должен их
освобождать — и поэтому ёмкость кэша обязана заметно превышать страницу галереи: вытесненная
картинка, которая ещё на экране, освободилась бы под рендерером.
- **Видео не декодируется**, и попытка была бы исключением на каждой плитке. `MediaKinds.IsImage`
отсекает это до всякого обращения к диску.
- **`{DynamicResource}` с несуществующим ключом молча не срабатывает** — свойство остаётся со
значением по умолчанию, фон не красится, кисть прозрачная. Это уже дважды доезжало до
скриншота; ловит `ResourceKeyTests` в обеих темах.
- **`{l:Loc}` с ключом, которого нет в обоих resx, тест паритета не поймает** — файлы согласованы
между собой. Ловит `LocalizationCoverageTests`.
## Границы, выбранные намеренно
- **robots.txt не читается.** Оба источника v1 либо принадлежат пользователю, либо введены им
@@ -254,3 +269,4 @@ throttle 250 мс — пул дёргается на каждый исход л
- **SVG не поддерживается сознательно** — это текст, он умеет исполнять скрипты и несёт XXE.
BMP/ICO/HEIC/JPEG-XL просто отложены.
- **Перцептивных хешей нет.** Дедуп точный, по SHA-256; «похожие» картинки — отдельная задача.
- **Кадры из видео не извлекаются.** Это FFmpeg целиком ради одной картинки в плитке.