Skip to content

fix: use optimized image components in ai chat#18

Merged
charlesrhoward merged 2 commits intomainfrom
codex/issue-9-chat-image-component
Feb 15, 2026
Merged

fix: use optimized image components in ai chat#18
charlesrhoward merged 2 commits intomainfrom
codex/issue-9-chat-image-component

Conversation

@charlesrhoward
Copy link
Contributor

@charlesrhoward charlesrhoward commented Feb 15, 2026

Summary

  • replace chat input preview img tags with next/image
  • replace chat message file-preview img tags with next/image
  • remove an any-cast in chat message tool-status detection

Fixes #9


Note

Low Risk
Small, UI-only rendering and typing changes; main risk is minor image display/layout or Next Image config regressions.

Overview
AI chat now renders uploaded image previews using next/image in both the input thumbnail strip and message file parts, adding explicit width/height, responsive classes, and unoptimized for these dynamic URLs.

Also replaces an any cast in tool-status detection with a minimal typed shape ({ state?: string }) when determining which tool is currently running.

Written by Cursor Bugbot for commit ecf987b. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Feb 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
drawit Ready Ready Preview, Comment Feb 15, 2026 8:04pm

Request Review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is ON. A Cloud Agent has been kicked off to fix the reported issue.

@cursor
Copy link

cursor bot commented Feb 15, 2026

Bugbot Autofix prepared fixes for 1 of the 1 bugs found in the latest run.

  • ✅ Fixed: Hardcoded width stretches small images in chat messages
    • I added an explicit w-auto class to the chat image so natural-width images no longer upscale while still respecting max-w-full constraints.

@charlesrhoward charlesrhoward force-pushed the codex/issue-9-chat-image-component branch from 96cd988 to ecf987b Compare February 15, 2026 20:03
@charlesrhoward charlesrhoward merged commit 4221d35 into main Feb 15, 2026
4 checks passed
@charlesrhoward charlesrhoward deleted the codex/issue-9-chat-image-component branch February 15, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use optimized image component in AI chat previews

2 participants

Comments