Repository navigation
Closed
Labels
area:desktopTauri desktop apparea:uxUser experience / copydifficulty:2Half a day - 1 dayenhancementNew feature or requesthelp wantedExtra attention is needed
Description
Problem
Images attached in the desktop chat are handled at their original size, and the message bubble shows them as large preview cards. This makes a conversation with a few screenshots noisy. Claude Code shows a short [Image #1] chip instead.
What the code does today
- Paste and file pick.
handlePasteindesktop/src/components/chat/ChatInput.tsxandfilesToComposerAttachmentsindesktop/src/lib/composerAttachments.tsread the file withFileReader.readAsDataURL. The data URL is used as both the preview and the payload. There is no downscaling and no re-encoding on the client, so a full-resolution screenshot goes over the connection unchanged. - Message bubble.
AttachmentGallery(desktop/src/components/chat/AttachmentGallery.tsx) renders each image in a message asmax-h-[340px] w-full max-w-[360px] object-cover. Every image becomes a card up to 360 x 340, andobject-covercrops wide screenshots. Several images stack into a large block above the text. - Composer. Thumbnails are 64 x 64, which is fine.
- CLI. The CLI already downsamples images before they reach the API (
maybeResizeAndDownsampleImageBlockinsrc/utils/imageResizer.ts, called fromsrc/utils/processUserInput/processUserInput.ts, limits insrc/constants/apiLimits.ts: 2000 x 2000, about 3.75 MB). So the model input is bounded, but the copy the desktop app holds and displays is the original. I read this in the code and did not trace it in--printstream-json mode.
Proposal
- Small fixed-size thumbnail per image in a sent message, the same size as the composer thumbnail, cropped with
object-cover. Clicking opens the existing gallery modal. No large cards in the message list. A text chip such as[Image #1]was considered and rejected: with several images in one message it does not say which is which. - Downscale on the client before the data URL is stored or sent, with the same rule as the CLI: an image within the limits (2000 x 2000 and about 3.75 MB) is kept as is and is not re-encoded; only an image over a limit is resized or compressed. This keeps the app from holding full-resolution copies that the model never sees.
- The modal shows the downscaled image. No second full-size copy is kept. The user sees what the model received.
- Images from the browser panel (page screenshots and picked elements) go through the same attachment path, so they get the same treatment.
Notes on the limits
- The CLI limits are in
src/constants/apiLimits.ts. A comment there says the API also downscales images above 1568 px on the server side. I did not verify that, so the model may see an even smaller image than the 2000 px one.
Not verified
I did not measure payload sizes or transcript growth. The numbers above are the code's limits, not measurements.
Metadata
Metadata
Assignees
Labels
area:desktopTauri desktop apparea:uxUser experience / copydifficulty:2Half a day - 1 dayenhancementNew feature or requesthelp wantedExtra attention is needed
Activity
henricop commentedon Nov 1, 2026
I'd like to work on this. I'll route pasted, picked, and browser-panel images through one client-side limit path aligned with the existing CLI bounds, keep in-limit images unchanged, and change sent-message previews to compact thumbnails that still open the gallery. I'll add focused tests for the resize/no-reencode boundary and the compact attachment rendering, then run the desktop lint, typecheck, and test suites required by
AGENTS.md.