From 521592a88282ba24524b44959d35cdef7970f488 Mon Sep 17 00:00:00 2001 From: Chenyme <118253778+chenyme@users.noreply.github.com> Date: Sat, 29 Aug 2026 17:23:20 +0800 Subject: [PATCH] fix: distinguish attachment upload and processing states --- .../chat/components/sections/chat-input.tsx | 25 +++++++++++-------- frontend/i18n/messages/en-US/chat.json | 1 + frontend/i18n/messages/zh-CN/chat.json | 1 + 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/frontend/features/chat/components/sections/chat-input.tsx b/frontend/features/chat/components/sections/chat-input.tsx index 936b6d814..cf372db3e 100644 --- a/frontend/features/chat/components/sections/chat-input.tsx +++ b/frontend/features/chat/components/sections/chat-input.tsx @@ -75,7 +75,7 @@ import { useDialogSnapshot } from "@/shared/hooks/use-dialog-snapshot"; import { useScrollFadeFallbackRef } from "@/shared/hooks/use-scroll-fade-fallback-ref"; import type { BillingDisplayCurrency } from "@/shared/lib/billing-display"; import { formatBytes, resolveFileExtension, resolveFileIcon } from "@/shared/lib/file-display"; -import { resolveFileProcessingBadge } from "@/shared/lib/file-processing"; +import { isFileProcessing, resolveFileProcessingBadge } from "@/shared/lib/file-processing"; import type { ModelOptionPolicy } from "@/shared/lib/model-option-policy"; import { isSendShortcutEvent } from "@/shared/lib/platform-shortcuts"; @@ -750,29 +750,32 @@ function ChatInputComponent({ const badge = resolveFileProcessingBadge(item, (key, values) => tFileStatus(key, values)); const FileIcon = resolveFileIcon(item); const failed = badge.tone === "danger" || badge.tone === "warning"; - const processing = !failed && badge.tone !== "success"; + const backgroundProcessing = !failed && isFileProcessing(item); const meta = formatAttachmentMeta(item.fileName, item.sizeBytes); return ( - {processing ? ( - - ) : ( - - )} + {item.fileName} - - {failed ? `${badge.label} · ${meta}` : meta} + {backgroundProcessing ? ( + + ) : null} + + {failed || backgroundProcessing ? `${badge.label} · ${meta}` : meta} {item.ragOptOut && item.fileCategory !== "image" ? ( - Uploading · {formatBytes(item.sizeBytes)} + {tComposer("uploading")} · {formatBytes(item.sizeBytes)} diff --git a/frontend/i18n/messages/en-US/chat.json b/frontend/i18n/messages/en-US/chat.json index 22e01118e..eac101662 100644 --- a/frontend/i18n/messages/en-US/chat.json +++ b/frontend/i18n/messages/en-US/chat.json @@ -449,6 +449,7 @@ "closeHint": "Close hint", "previewAttachment": "Preview attachment {name}", "removeAttachment": "Remove attachment {name}", + "uploading": "Uploading", "uploadingAttachment": "Uploading {name}", "ragDisabledTitle": "This file has RAG disabled and will be injected as full context. It may use more tokens.", "ragOff": "RAG off", diff --git a/frontend/i18n/messages/zh-CN/chat.json b/frontend/i18n/messages/zh-CN/chat.json index 82b419469..50bb56222 100644 --- a/frontend/i18n/messages/zh-CN/chat.json +++ b/frontend/i18n/messages/zh-CN/chat.json @@ -449,6 +449,7 @@ "closeHint": "关闭提示", "previewAttachment": "预览附件 {name}", "removeAttachment": "移除附件 {name}", + "uploading": "上传中", "uploadingAttachment": "上传中 {name}", "ragDisabledTitle": "该文件已关闭 RAG,将以全文注入(消耗更多 Token)", "ragOff": "RAG 关",