authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-02 09:53:08-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-03-02 10:19:22-08:00
log4c846332c5c972b715862df9f19b6c095c76841b
tree064606ee80d6bf6472b4f42a451c20de66fb2cb7
parenta3a0cbf0f89ecc34168161f66c4901c922acb8d6

fix: align handoff preview URLs with image attachment index

collectUserMessageBlobPreviewUrls returns a compact array (image+blob only). Consumer now indexes by image position, not full attachment index, so blob URLs apply to the correct server attachments when some are skipped. Made-with: Cursor

1 files changed, 7 insertions(+), 2 deletions(-)

apps/web/src/components/ChatView.tsx+7-2
......@@ -710,8 +710,13 @@ export default function ChatView({ threadId }: ChatViewProps) {
710710 }
711711
712712 let changed = false;
713 const attachments = message.attachments.map((attachment, index) => {
714 const handoffPreviewUrl = handoffPreviewUrls[index];
713 let imageIndex = 0;
714 const attachments = message.attachments.map((attachment) => {
715 if (attachment.type !== "image") {
716 return attachment;
717 }
718 const handoffPreviewUrl = handoffPreviewUrls[imageIndex];
719 imageIndex += 1;
715720 if (!handoffPreviewUrl || attachment.previewUrl === handoffPreviewUrl) {
716721 return attachment;
717722 }