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.
This commit is contained in:
Mortdecai
2026-04-07 21:04:27 -04:00
parent 9fd718b2ae
commit 20161fedeb
2 changed files with 80 additions and 15 deletions
+5 -2
View File
@@ -186,13 +186,16 @@ func (cc *compositeContent) CleanupFiles() {
}
// Draw renders the composite content into the given UI context.
// scroll is the row offset from the top.
func (cc *compositeContent) Draw(ctx *ui.Context, scroll int) {
// scroll is the row offset from the top. style is the default text style.
func (cc *compositeContent) Draw(ctx *ui.Context, scroll int, style ...vaxis.Style) {
width := ctx.Width()
height := ctx.Height()
row := -scroll // start above viewport if scrolled
defaultStyle := vaxis.Style{}
if len(style) > 0 {
defaultStyle = style[0]
}
for _, b := range cc.blocks {
switch b.blockType {