+ {composerAttachments.map((attachment) => {
+ const sizeLabel = formatAttachmentSize(attachment.size);
+ const statusLabel =
+ attachment.status === "uploading"
+ ? "Uploading to issue"
+ : attachment.status === "error"
+ ? attachment.error ?? "Upload failed"
+ : attachment.inline
+ ? "Inserted inline"
+ : "Attached to issue";
+ return (
+
+ {attachment.status === "uploading" ? (
+
+ ) : attachment.status === "attached" ? (
+
+ ) : (
+
+ )}
+
+ {attachment.name}
+
+ {sizeLabel ? (
+
{sizeLabel}
+ ) : null}
+
{statusLabel}
+
+ );
+ })}
+
+ ) : null}
+
{(onImageUpload || onAttachImage) ? (
diff --git a/ui/src/pages/IssueDetail.tsx b/ui/src/pages/IssueDetail.tsx
index a4345e0a616..45f13050d92 100644
--- a/ui/src/pages/IssueDetail.tsx
+++ b/ui/src/pages/IssueDetail.tsx
@@ -578,7 +578,7 @@ type IssueDetailChatTabProps = {
) => Promise;
onAdd: (body: string, reopen?: boolean, reassignment?: CommentReassignment) => Promise;
onImageUpload: (file: File) => Promise;
- onAttachImage: (file: File) => Promise;
+ onAttachImage: (file: File) => Promise;
onInterruptQueued: (runId: string) => Promise;
onCancelQueued: (commentId: string) => void;
interruptingQueuedRunId: string | null;
@@ -2543,7 +2543,7 @@ export function IssueDetail() {
return attachment.contentPath;
}, [uploadAttachment]);
const handleCommentAttachImage = useCallback(async (file: File) => {
- await uploadAttachment.mutateAsync(file);
+ return uploadAttachment.mutateAsync(file);
}, [uploadAttachment]);
const handleInterruptQueuedRun = useCallback(async (runId: string) => {
await interruptQueuedComment.mutateAsync(runId);