← Back to PRs

#6663: Web UI: handle drag-drop image attachments

by mar0der open 2026-02-01 22:54 View on GitHub →
app: web-ui
What’s in this PR Treat drag‑and‑drop images in WebChat as attachments instead of navigating away. Reuse the same attachment pipeline as paste. Add changelog entry for #6525. Why Dragging images into the chat currently triggers browser navigation (opens the image). This blocks the intended attachment workflow. Testing Manual: WebChat drag‑drop image shows attachment preview and can be sent. Issue #6525 <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR updates the Web UI chat view to treat dragged-and-dropped images as chat attachments rather than allowing the browser’s default navigation behavior. It refactors the existing paste-image handling into shared helpers (`readFileAsDataUrl`, file extraction helpers, and `appendImageAttachments`), adds drop/dragover listeners on the chat container to intercept file drops, and documents the change in the changelog (#6525). <h3>Confidence Score: 4/5</h3> - This PR is generally safe to merge; main risk is cross-browser drag/drop behavior. - The change is localized to the chat UI event handlers and reuses the existing attachment pipeline, so blast radius is small. The one notable concern is browser inconsistencies around `DataTransfer.types`, which could prevent `dragover.preventDefault()` and reintroduce navigation in some environments. - ui/src/ui/views/chat.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs