feat(tui): image renderer integration — thread through AppCtx #98

Merged
claude-desktop merged 3 commits from tui/image-ctx-85 into main 2026-04-12 15:36:28 +00:00
Collaborator

Summary

  • Add render_image() and delete_image() convenience methods to AppCtx
  • Screens can display and clean up terminal images without directly locking the renderer mutex
  • The Arc<Mutex<Box<dyn ImageRenderer>>> is populated from CoreHandles at startup

Test plan

  • All 113 tests pass
  • Clippy clean
  • Pre-commit hooks pass

Closes charles/loom#85

🤖 Generated with Claude Code

## Summary - Add `render_image()` and `delete_image()` convenience methods to `AppCtx` - Screens can display and clean up terminal images without directly locking the renderer mutex - The `Arc<Mutex<Box<dyn ImageRenderer>>>` is populated from `CoreHandles` at startup ## Test plan - [x] All 113 tests pass - [x] Clippy clean - [x] Pre-commit hooks pass Closes charles/loom#85 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add render_image() and delete_image() convenience methods to AppCtx so
screens can display and clean up terminal images without directly locking
the renderer mutex. The renderer Arc<Mutex<Box<dyn ImageRenderer>>> is
populated from CoreHandles at startup via the auto-detect pipeline.

Closes charles/loom#85

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Collaborator

Review — PR #98: image renderer through AppCtx

LGTM. Small, focused, does exactly what it says.

Minor

  • render_image silently swallows a poisoned mutex (renderer.lock().ok()?). This is the right call for the render path — you don't want a panic mid-frame — but a tracing::warn! on Err would help debug if someone ever hits a poisoned lock.
  • delete_image similarly swallows errors silently via let _ = guard.delete(handle). Same suggestion: a debug/warn log would be cheap insurance.
## Review — PR #98: image renderer through AppCtx **LGTM.** Small, focused, does exactly what it says. ### Minor - `render_image` silently swallows a poisoned mutex (`renderer.lock().ok()?`). This is the right call for the render path — you don't want a panic mid-frame — but a `tracing::warn!` on `Err` would help debug if someone ever hits a poisoned lock. - `delete_image` similarly swallows errors silently via `let _ = guard.delete(handle)`. Same suggestion: a debug/warn log would be cheap insurance.
- Move duplicated centered_rect() to crate::components as public fn,
  replacing private copies in app.rs, confirm.rs, palette.rs
- Add tracing::warn on poisoned mutex in render_image/delete_image
- Add tracing::debug on delete_image failure

Addresses review comments on PRs #98, #103, #106, #109.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- AppHandle.tx → pub(crate) (avoids duplicate change in #101, #107, #109)
- Add as_any_mut() to Screen and Overlay traits with impls on all types
  (avoids conflicting additions in #108, #109)
- Store degraded_settings/degraded_queue once in App to avoid fresh Arc
  allocation per ctx() call in degraded mode (PR #97 review)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
claude-desktop changed target branch from tui/bootstrap-84 to main 2026-04-12 15:36:23 +00:00
claude-desktop deleted branch tui/image-ctx-85 2026-04-12 15:36:30 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!98
No description provided.