Skip to content

Attached images are kept at original size and shown as large cards in the chat #218

Closed

Description

@GoDiao

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. handlePaste in desktop/src/components/chat/ChatInput.tsx and filesToComposerAttachments in desktop/src/lib/composerAttachments.ts read the file with FileReader.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 as max-h-[340px] w-full max-w-[360px] object-cover. Every image becomes a card up to 360 x 340, and object-cover crops 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 (maybeResizeAndDownsampleImageBlock in src/utils/imageResizer.ts, called from src/utils/processUserInput/processUserInput.ts, limits in src/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 --print stream-json mode.

Proposal

  1. 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.
  2. 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.
  3. The modal shows the downscaled image. No second full-size copy is kept. The user sees what the model received.
  4. 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.

Activity

  1. added
    enhancement
    help wanted
    area:desktop
    area:ux
    difficulty:2
    on Oct 30, 2026
  2. henricop commented on Nov 1, 2026

    @henricop
    Contributor

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:desktoparea:uxdifficulty:2enhancementhelp wanted

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions