The open-source app everyone uses to manage agents at work
TypeScript acpxagent-orchestrationagent-skillsagentic-aiai-agentsai-engineeringai-governanceai-toolsautonomous-agentsclaudeclaude-codeclaude-skillscodexhermesllmmcpmulti-agentopenclawproject-managementworkflow-automation
Align attachment video detection with server
Dotta0da56d780f02
diff --git a/ui/src/components/IssueAttachmentsSection.test.tsx b/ui/src/components/IssueAttachmentsSection.test.tsxindex 23be53b081..6fca448a89 100644--- a/ui/src/components/IssueAttachmentsSection.test.tsx+++ b/ui/src/components/IssueAttachmentsSection.test.tsx@@ -207,6 +207,35 @@ describe("IssueAttachmentsSection", () => {expect(fetchSpy).not.toHaveBeenCalled();});+ it("does not promote specific non-video content types by filename alone", async () => {+ const attachment = makeAttachment({+ id: "zip-mp4",+ originalFilename: "bundle.mp4",+ contentType: "application/zip",+ contentPath: "/api/attachments/zip-mp4/content",+ openPath: "/api/attachments/zip-mp4/content",+ downloadPath: "/api/attachments/zip-mp4/content?download=1",+ });++ await act(async () => {+ root.render(+ <QueryClientProvider client={queryClient}>+ <IssueAttachmentsSection+ attachments={[attachment]}+ onDelete={vi.fn()}+ onImageClick={vi.fn()}+ />+ </QueryClientProvider>,+ );+ });+ await flushReact();++ expect(container.querySelector("video")).toBeNull();+ expect(container.textContent).toContain("bundle.mp4");+ expect(container.textContent).toContain("application/zip");+ expect(fetchSpy).not.toHaveBeenCalled();+ });+it("keeps generic attachments as compact file rows with open and download actions", async () => {const attachment = makeAttachment({id: "pdf-attachment",diff --git a/ui/src/lib/issue-attachments.ts b/ui/src/lib/issue-attachments.tsindex 29219c4628..39534d483b 100644--- a/ui/src/lib/issue-attachments.ts+++ b/ui/src/lib/issue-attachments.ts@@ -1,6 +1,12 @@import type { IssueAttachment } from "@paperclipai/shared";import { isVideoContentType } from "./issue-output";+const GENERIC_ATTACHMENT_CONTENT_TYPES = new Set([+ "application/octet-stream",+ "binary/octet-stream",+ "application/x-binary",+]);+function normalizedContentType(attachment: Pick<IssueAttachment, "contentType">) {return attachment.contentType.toLowerCase().split(";")[0]?.trim() ?? "";}@@ -28,7 +34,9 @@ export function isImageAttachment(attachment: Pick<IssueAttachment, "contentTypeexport function isVideoAttachment(attachment: Pick<IssueAttachment, "contentType" | "originalFilename">,) {- if (isVideoContentType(normalizedContentType(attachment))) return true;+ const contentType = normalizedContentType(attachment);+ if (isVideoContentType(contentType)) return true;+ if (!GENERIC_ATTACHMENT_CONTENT_TYPES.has(contentType)) return false;const filename = (attachment.originalFilename ?? "").toLowerCase();return (