From 8ace54c358d8309a31a63554e056cac3514eb8d4 Mon Sep 17 00:00:00 2001 From: "detail-app[bot]" <180357370+detail-app[bot]@users.noreply.github.com> Date: Thu, 3 Sep 2026 13:48:38 +0000 Subject: [PATCH] chore: remove dead v2 branches from PromptImageAttachments --- packages/app/src/components/prompt-input.tsx | 1 - .../prompt-input/image-attachments.css | 43 ---- .../prompt-input/image-attachments.tsx | 191 +++++------------- 3 files changed, 48 insertions(+), 187 deletions(-) delete mode 100644 packages/app/src/components/prompt-input/image-attachments.css diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsx index f70cb3992896..4d0250f179dc 100644 --- a/packages/app/src/components/prompt-input.tsx +++ b/packages/app/src/components/prompt-input.tsx @@ -1493,7 +1493,6 @@ export const PromptInput: Component = (props) => { } onRemove={removeAttachment} removeLabel={language.t("prompt.attachment.remove")} - newLayoutDesigns={false} />
void onRemove: (id: string) => void removeLabel: string - newLayoutDesigns: boolean - comments?: PromptCommentItem[] - commentActive?: (item: PromptCommentItem) => boolean - onOpenComment?: (item: PromptCommentItem) => void - onRemoveComment?: (item: PromptCommentItem) => void } const fallbackClass = "size-16 rounded-md bg-surface-base flex items-center justify-center border border-border-base" const imageClass = "size-16 rounded-md object-cover border border-border-base hover:border-border-strong-base transition-colors" -const imageClassV2 = "w-[58px] h-[46px] rounded-[6px] object-cover" -// inset box-shadows do not paint over content, so the hairline is a separate overlay -const imageHairlineClassV2 = - "absolute inset-0 rounded-[6px] shadow-[inset_0_0_0_0.5px_var(--v2-border-border-base)] pointer-events-none" const removeClass = "absolute -top-1.5 -right-1.5 size-5 rounded-full bg-surface-raised-stronger-non-alpha border border-border-base flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity hover:bg-surface-raised-base-hover" -const removeClassV2 = - "absolute -top-1 -right-1 size-4 rounded-full bg-v2-icon-icon-muted outline-solid outline-1 outline-v2-icon-icon-contrast flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity" const nameClass = "absolute bottom-0 left-0 right-0 px-1 py-0.5 bg-black/50 rounded-b-md" export const PromptImageAttachments: Component = (props) => { return ( - 0 || (props.newLayoutDesigns && (props.comments?.length ?? 0) > 0)}> -
-
- - - {(item) => ( -
- - props.onOpenComment?.(item)} - /> - - -
- )} -
-
- - {(attachment) => { - const image = attachment.mime.startsWith("image/") - const media = () => ( - - -
- } - > - - {typeLabel(attachment.filename, attachment.mime)} - - - } - > - {attachment.filename} props.onOpen(attachment)} - /> - - ) - const name = () => ( -
- {attachment.filename} -
- ) - const remove = () => ( - - ) - // v2 keeps the remove button outside the tooltip trigger so hovering it dismisses the tooltip - return ( - -
- {media()} - {name()} - {remove()} -
- - } - > -
- - {media()} - -
- - - {remove()} + 0}> +
+ + {(attachment) => { + const image = attachment.mime.startsWith("image/") + const media = () => ( + +
-
- ) - }} - -
- -
-
- + } + > + {attachment.filename} props.onOpen(attachment)} + /> + + ) + const name = () => ( +
+ {attachment.filename} +
+ ) + const remove = () => ( + + ) + return ( + +
+ {media()} + {name()} + {remove()} +
+
+ ) + }} +
)