[Feature]: Keep pasted images viewable in the transcript after submit
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 54/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
- 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().imagesreports no image protocol or when decode fails, so the card never changes height unpredictably. - Reuse the composer's loader so limits and normalization stay identical in one place:
loadTuiImagePreviewalready 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. - 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.
- 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.
- 主要语言
- TypeScript
- 星标
- 2.3k
- 派生
- 315
- 平均合并
- 3 小时 54 分钟
- 30 天内合并 PR
- 9
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MiniMax-AI/minimax-code 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
MiniMax-AI/minimax-code#639 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
MiniMax-AI/minimax-code#636 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
MiniMax-AI/minimax-code#615 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
MiniMax-AI/minimax-code#556 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
MiniMax-AI/minimax-code#507 ·
维护者通常 1 天内回复
查看 MiniMax-AI/minimax-code 的全部 Issue
相似的 Issue
-
area:api bug good first issue priority:high
难度 2/5 1-3 小时 新手友好度 78/100
Doezer/Questarr#1486 · 1 条评论 ·
维护者通常 1 天内回复
-
area:import difficulty:good-first good first issue help wanted priority:P1 roadmap size:S type:test
难度 2/5 1-3 小时 新手友好度 88/100
Sergey-Bar/Penny#245 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
Approve the Cloudflare agent plugin for harness sessions可能已有人在做 @joshtsch 今天认领。 未关闭enhancement ready-for-agent
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复