Skip to content

feat(session-ui): render ordered tool media - #39817

Closed
EugeneChan00 wants to merge 1 commit into
anomalyco:devfrom
EugeneChan00:aes29-tool-media
Closed

EugeneChan00 wants to merge 1 commit into
anomalyco:devfrom
EugeneChan00:aes29-tool-media

Conversation

@EugeneChan00

@EugeneChan00 EugeneChan00 commented Jul 31, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #39815

Linear surface: AES-29

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Renders supported tool-result images in provider order, opens them in the existing image preview, and gives unsupported media a labeled fallback. It covers both normal tools and context-grouped read tools.

Related: #38846 covers clickable tool image thumbnails. This patch additionally preserves provider ordering, renders unsupported attachments as labeled fallbacks, supports top-level assistant file parts, and adds deterministic coverage.

How did you verify your code works?

Ran the session-ui typecheck and focused tests (9 passing), plus the workspace typecheck (30 packages). In Storybook, verified ordered image/fallback rendering, preview open/close, and a 480px viewport without horizontal overflow.

Screenshots / recordings

Validated in the visible Browser against a real OpenCode web session and backend. The included Playground/Timeline story lets reviewers reproduce the image, fallback, and preview states locally.

Real OpenCode chat rendering an ordered tool image

Real OpenCode image preview

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search results, I found one potentially related PR:

PR #38846: feat(ui): display image attachments from tool results
#38846

This PR appears to be related as it also handles displaying tool result images in the UI. Since PR #39817 focuses on rendering ordered tool media with support for images and fallbacks, it's worth checking if #38846 addresses similar functionality or if they complement each other.

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Render ordered tool media in chat

1 participant