Skip to content

Comments

add image preview#2783

Open
Alex2251 wants to merge 2 commits intoChainlit:mainfrom
Alex2251:add-image-preview
Open

add image preview#2783
Alex2251 wants to merge 2 commits intoChainlit:mainfrom
Alex2251:add-image-preview

Conversation

@Alex2251
Copy link

@Alex2251 Alex2251 commented Feb 17, 2026

Add image preview
image_preview


Summary by cubic

Added image preview in the chat composer so image attachments show a thumbnail before sending. Non-image files still show the file icon.

  • New Features
    • Display inline thumbnail with tooltip for image attachments using object URLs, with cleanup on unmount and URL change to prevent leaks.
    • Store and pass the original File in attachment state and components to generate previews.

Written for commit e72e504. Summary will update on new commits.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. frontend Pertains to the frontend. labels Feb 17, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 4 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="frontend/src/components/chat/MessageComposer/Attachment.tsx">

<violation number="1" location="frontend/src/components/chat/MessageComposer/Attachment.tsx:28">
P2: Object URLs created for image previews are never revoked, which can leak memory when files change or the component unmounts.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

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

Labels

frontend Pertains to the frontend. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants