rcom/openspec/changes/add-image-previews/tasks.md

32 lines
4.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Tasks
## 1. Безопасное декодирование
- [x] 1.1 Добавить `image`/`ratatui-image` с минимальными features без default libchafa, обновить notices и реализовать content-magic classification для PNG/JPEG/GIF/BMP/WebP; generated in-memory tests не используют сеть или внешние assets.
- [x] 1.2 Реализовать bounded Local/SSH read с lookahead и лимиты 16 MiB/8192 axis/32M pixels/256 MiB max_alloc; tests покрывают exact cap, cap+1, checked overflow, corrupt/truncated input и fake-SSH без shell.
- [x] 1.3 Добавить animated→static behavior, checked geometry и aspect-fit Triangle без upscale/crop; tests на wide/tall/tiny/zero area доказывают отсутствие panic и animation timers.
## 2. Detection и async preparation
- [x] 2.1 Ввести at-most-once bounded `Picker::from_query_stdio` до EventStream только после images/terminal gates; до любого Picker constructor проверять tmux и создавать halfblocks напрямую через Resize/Halfblocks/Protocol без upstream side effects. Synthetic timeout/parser tests и substitute-tmux regression доказывают отсутствие probe/process/config mutation в disabled/tmux режимах.
- [x] 2.2 Добавить `images = true/false` в общий config и `--no-images`; CLI/startup tests проверяют defaults, precedence, отсутствие записей, а icons-off не отключает pixels.
- [x] 2.3 Реализовать один global blocking worker с cancellation checkpoints и prepared identity `(pane/generation/target/epoch/geometry/font/protocol/terminal epoch)`; tests доказывают max-active=1, отмену до blocking start и отсутствие прямых worker stdout writes.
- [x] 2.4 Реализовать bounded prepared cache вне Clone/Eq AppState и render context с accepted-current identity; tests покрывают stale generation/target/SessionEpoch/geometry и удаление старых entries.
## 3. Rendering и terminal lifecycle
- [x] 3.1 Подключить fixed prepared `Protocol`/`Image` к persistent preview и F3 без resize/encode в Frame; TestBackend доказывает реальные `▀`/`▄`, известные RGB, borders/neighbors и отсутствие metadata-only success.
- [x] 3.2 Добавить Kitty/iTerm2/Sixel structural shape tests без случайных IDs/base64 snapshots и отдельную real-terminal matrix; native support явно не выводится из headless tests.
- [x] 3.3 Реализовать resize coalescing, безопасный placeholder вместо oversized old protocol, image→text/no-selection/overlay cleanup и images-disabled/NO_COLOR/ASCII/dumb fallback; tests доказывают отсутствие payload за границами.
- [x] 3.4 Увеличивать terminal epoch и invalidировать/пересоздавать prepared images после editor resume; mock/PTY tests покрывают full redraw, Kitty already-transmitted state, отсутствие поздних writes и чистый exit.
## 4. Приёмка
- [x] 4.1 Обновить README, guideline, `docs/testing.md`, `docs/spec-matrix.md` и acceptance для всех десяти scenarios; strict OpenSpec, named-test traceability и отсутствие `.snap.new` должны пройти.
- [x] 4.2 Прогнать fmt, strict Clippy, полный tests/doc/PTY suite и зафиксировать 651/0/4; выполнен реальный Kitty visual review и PTY halfblock/tmux check без ложного универсального protocol claim.
- [ ] 4.4 Выполнить отдельную ручную iTerm2/Sixel и real-SSH visual matrix. Реальный tmux проверен на isolated server: halfblocks/RGB видны, `allow-passthrough` остаётся unset, quit чистый. iTerm2/Sixel недоступны и не заявляются; внешний acceptance gate остаётся открытым.
- [x] 4.3 Получить независимый verify через `rcom-tui-design` skill: финальный technical verdict 0 findings, 651/0/4; внешний manual gate вынесен в 4.4.
## Workflow follow-up
- После успешного verify синхронизировать ADDED `Предпросмотр изображений` в main `file-navigation`, выполнить `openspec archive add-image-previews` и проверить archived result.