Commit Graph

13 Commits

Author SHA1 Message Date
Mortdecai 8e663b6e63 feat(composite): native Kitty graphics protocol for inline images
Use vaxis NewImage/Resize/Draw which auto-selects Kitty graphics protocol.
Images decode in background, vaxis handles async Kitty protocol encoding.
Removed halfblock fallback — Kitty only.
2026-04-07 22:12:06 -04:00
Mortdecai 8a19e0b95c feat(composite): halfblock image renderer — crash-proof, cross-terminal
Replace vaxis NewImage/Resize (which spawns goroutines that panic in
sixel encoder) with direct halfblock character rendering. Each terminal
cell uses upper-half-block with RGB fg/bg colors for 2x vertical
resolution. Pre-renders in background goroutine, Draw() just paints
pre-computed cells. Works in any 24-bit color terminal.
2026-04-07 22:03:34 -04:00
Mortdecai e6af1a6208 fix(composite): recover from sixel encoder panics, clean up debug logging
The go-sixel library panics on certain image dimensions during Resize().
Added panic recovery in drawImage() that falls back to alt text display.
Cleaned up all debug logging from the investigation.
2026-04-07 21:48:37 -04:00
Mortdecai 046ff03f8b fix(composite): async image decode, skip dead pager, prevent UI freeze
- Decode images in background goroutine, not in Draw()
- Show [loading image...] placeholder until decode completes
- Skip pv.term.Draw() when composite is active (pager got no input)
- Thread-safe access to decoded image cache via sync.Mutex
- Invalidate callback triggers redraw when images finish decoding
2026-04-07 21:11:44 -04:00
Mortdecai 20161fedeb feat(msgviewer): re-enable composite renderer with scroll support and inline images
Composite mode now handles j/k/g/G/PgUp/PgDown/mouse wheel for scrolling.
Text uses the configured default style. Images render inline via Vaxis.
Emails without images still use the standard pager path.
2026-04-07 21:04:27 -04:00
Mortdecai 9fd718b2ae fix(msgviewer): use pager for all text, replace image markers with readable placeholders
The composite renderer bypassed the pager (less) for any email with images,
losing colors, scrolling, and search. Now always forward to the pager with
[image: alt] text placeholders. Image refs are still extracted and stored
for future inline rendering.
2026-04-07 20:58:45 -04:00
Mortdecai abf8feb229 test: add end-to-end integration test for HTML filter to image extraction 2026-04-07 20:14:27 -04:00
Mortdecai b13bd1d71c feat(msgviewer): wire image extraction and composite rendering into PartViewer
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 20:10:45 -04:00
Mortdecai 9c7a770daa feat(app): add composite content model for text+image block rendering 2026-04-07 20:08:36 -04:00
Mortdecai 84018efbbf fix(parse): strip OSC escape sequences in StripAnsi for backwards compat 2026-04-07 20:05:16 -04:00
Mortdecai b3bbd55551 feat(parse): add ExtractImages stream scanner for OSC 9 markers
Implements ExtractImages() which scans filter stdout line-by-line,
extracts valid OSC 9 image markers into ImageRef structs, and replaces
marker lines with null-delimited placeholders (\x00IMG:N\x00). Invalid
markers (missing path) pass through unchanged. Also clarifies the Index
field comment in ImageRef to indicate it is set by ExtractImages, not
ParseImageOSC.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 20:03:53 -04:00
Mortdecai 00a6660db5 feat(parse): add ImageRef type and OSC 9 marker parser
Introduces ImageRef struct and ParseImageOSC() to parse OSC 9 image
markers (\033]9;image:path=...;alt=...\007) emitted by filters. Supports
BEL and ESC-backslash terminators, tolerates markers embedded in larger
lines, and rejects malformed or path-less markers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 19:57:17 -04:00
Mortdecai 083402a548 init: pristine aerc 0.20.0 source 2026-04-07 19:54:54 -04:00