Skip to content

[Enhancement] Render images inline in tool results and attachments with lightbox preview #508

@GeT-LeFt

Description

@GeT-LeFt

Description

Tool results (Read, Bash, Markdown, Generic views) currently render only text content. Any base64 image blocks returned by a tool are dropped silently. User-uploaded image attachments in assistant messages are also displayed as filename chips with no thumbnail or preview.

This means:

  • Screenshots read via the Read tool are invisible in the chat.
  • Commands that emit images (charts, screenshots) produce no visible output.
  • User-uploaded images can't be previewed without opening devtools.

Current behavior

  • web/src/components/ToolCard/views/_results.tsx only extracts text blocks from tool result content — image blocks are skipped.
  • web/src/components/AssistantChat/messages/MessageAttachments.tsx renders image attachments as plain filename chips.
  • No shared image viewer component exists.

Proposed enhancement

  1. Add a reusable ImageLightbox component (Portal overlay, ESC/backdrop close, open-in-new-tab).
  2. Extract and render base64 image blocks when parsing tool result content in _results.tsx.
  3. Wire click-to-preview into MessageAttachments for user-uploaded images.

I'll follow up with a PR. The change is additive — existing text-only tool results are unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions