fix(tui): Kitty image pipeline — transcode non-PNG, sync output, cleanup #114

Merged
claude-desktop merged 1 commit from tui/image-pipeline-110 into main 2026-04-12 18:40:28 +00:00
Collaborator

Summary

  • Transcode JPEG/WebP sources to PNG via image crate before Kitty transmission
  • Wrap flush_pending() with synchronized output markers to prevent flicker
  • Add clear_placements() to ImageRenderer trait — Kitty emits a=d,d=a
  • Gallery close_detail() clears Kitty placements on navigation away
  • Gallery render_detail() falls back to thumbnail_path when image_path is stale
  • 4 new tests: PNG passthrough, JPEG transcode, sync markers, clear buffer

Closes charles/loom#110

Test plan

  • cargo test -p loom-tui — 177 tests pass
  • cargo clippy -p loom-tui -- -D warnings — clean
  • Manual: open gallery detail with a JPEG image in Kitty — should render
  • Manual: navigate away from detail — image should not persist on screen
  • Manual: no flicker during render (synchronized output mode)

🤖 Generated with Claude Code

## Summary - Transcode JPEG/WebP sources to PNG via `image` crate before Kitty transmission - Wrap `flush_pending()` with synchronized output markers to prevent flicker - Add `clear_placements()` to `ImageRenderer` trait — Kitty emits `a=d,d=a` - Gallery `close_detail()` clears Kitty placements on navigation away - Gallery `render_detail()` falls back to `thumbnail_path` when `image_path` is stale - 4 new tests: PNG passthrough, JPEG transcode, sync markers, clear buffer Closes charles/loom#110 ## Test plan - [x] `cargo test -p loom-tui` — 177 tests pass - [x] `cargo clippy -p loom-tui -- -D warnings` — clean - [ ] Manual: open gallery detail with a JPEG image in Kitty — should render - [ ] Manual: navigate away from detail — image should not persist on screen - [ ] Manual: no flicker during render (synchronized output mode) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- Add `ensure_png()` to transcode JPEG/WebP sources to PNG before Kitty
  transmission (source images aren't always PNG despite `f=100` format).
- Wrap `flush_pending()` with synchronized output markers (`?2026h/l`)
  to prevent flicker during image placement.
- Add `clear_placements()` trait method + Kitty `a=d,d=a` implementation
  so old image placements are cleaned up on navigation.
- Gallery detail `close_detail()` now invalidates render cache and clears
  placements so images don't persist over grid/list views.
- Gallery detail falls back to `thumbnail_path` when `image_path` is
  missing (stale paths from pending_dir moves).
- Add tests: PNG passthrough, JPEG transcode, sync markers, clear buffer.

Closes charles/loom#110

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
claude-desktop changed target branch from tui/test-harness-fixes to main 2026-04-12 18:40:11 +00:00
claude-desktop deleted branch tui/image-pipeline-110 2026-04-12 18:40:28 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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
charles/loom!114
No description provided.