[Feature]: Keep pasted images viewable in the transcript after submit

Abierto
#609 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
54/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Start with packages/tui/src/tui/transcript/view.ts and renderUserAttachments, then read the composer preview in packages/tui/src/tui/features/composer/image-preview.ts and shared loader in packages/tui/src/host/image-preview.ts. Trace how TranscriptAttachment paths and preview URLs are restored, including packages/tui/src/acp/prompt-content.ts. Done when sent and restored image attachments show bounded previews where supported, fall back to metadata with a way to reach the file, and other attachment types keep their current rendering.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

tui
Product or interface

CLI - interactive TUI

Use case and problem

When I paste an image into the composer I can see it: TuiComposerImagePreview renders an inline preview through the terminal image protocol (packages/tui/src/tui/features/composer/image-preview.ts). The moment I press Enter, that same attachment collapses into a two-line metadata card in the transcript — Image <file name> / <mime type> · <size> — produced by renderUserAttachments (packages/tui/src/tui/transcript/view.ts:1465).

So when I scroll back through a session I can no longer tell which screenshot I sent, and I cannot look at it again. With several images in one session the cards are indistinguishable: same MIME type, similar size, names like image.png. After session restore / resume it is the same story. Reviewing an earlier turn ("did I actually attach the failing screenshot from the second attempt?") becomes guesswork, and my only fallbacks are re-pasting the image or hunting for the asset on disk.

The data needed to re-display it is already on the transcript cell: TranscriptAttachment carries filePath, assetId and previewUrl (packages/tui/src/tui/transcript/model.ts:49), and history replay already resolves the persisted Runtime Session asset path for ACP (readTuiAcpHistoryImages, packages/tui/src/acp/prompt-content.ts:124). Only the transcript renderer ignores those fields.

Desired behavior
  1. Render image attachments in the user turn card as a small inline preview (bounded rows and cells, aspect-preserving), the way the composer already does. Keep today's metadata card as the fallback when getCapabilities().images reports no image protocol or when decode fails, so the card never changes height unpredictably.
  2. Reuse the composer's loader so limits and normalization stay identical in one place: loadTuiImagePreview already caps at 20 MB / 25 MP and normalizes to PNG for Kitty (packages/tui/src/host/image-preview.ts:11). Cache the decoded preview per attachment so scrolling and re-render do not re-decode.
  3. On terminals without image support, keep a way to reach the file — show the resolved path, or offer an open-in-viewer affordance (keybinding/command on the focused attachment card) — so history stays inspectable.
  4. Never block input or stall scrolling while decoding; a slow or unreadable asset degrades to the metadata card, matching the composer's "Preview unavailable" state.

Acceptance criteria:

  • Paste an image, send, scroll back up: the thumbnail is visible in the user turn.
  • Restore the session and scroll up: the same preview appears, resolved from the persisted asset path.
  • Terminal without an image protocol: metadata card plus a way to open the file, with no layout break.
  • Non-image attachments (File, Video) render exactly as today.
  • A turn with 6+ attachments in a short, narrow terminal stays usable.
Platform

macOS

Alternatives and additional context

Today the only alternatives are re-pasting the image into a new turn, or reading the session asset path from disk outside the app.

Observed on version 0.7.2 in Ghostty (TERM=xterm-ghostty). That terminal does support inline images, so the composer preview works and the gap after submit sits in the transcript renderer rather than in terminal capability detection.

Lenguaje dominante
TypeScript
Estrellas
2.3k
Forks
315
Merge medio
3 h 54 min
PR fusionados (30 d)
9

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de MiniMax-AI/minimax-code

Todos los issues de MiniMax-AI/minimax-code

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.