From 55e60c86b79fc286b9bb951a70e8ba8e460313ef Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Fri, 9 Oct 2026 02:23:45 +0900 Subject: [PATCH] feat(chat): attach any file from the composer's button, not only images (#1101) On a phone there is no drag and drop, so the only way to give the chat a PDF or a log was the attach button, which took images only. The button's file input now has no accept list and hands the whole selection to ChatWindow, which runs it through the chat drop handler: images attach to the prompt as before (limits, compression, the image-support warning), other files are uploaded into the working directory with conflict=skip and mentioned, with the same notices, including the one when there is no working directory. No capture attribute, so phones still offer photos and the camera. The button reads "Attach files", and the no-directory notice says "adding" rather than "dropping" since it now covers both. Co-Authored-By: Claude Opus 5.5 --- components/ChatInput.test.mjs | 39 ++++++++- components/ChatInput.tsx | 23 ++++-- components/ChatWindow.attach-files.test.mjs | 90 +++++++++++++++++++++ components/ChatWindow.tsx | 8 +- docs/agents/files-and-access.md | 1 + lib/i18n/messages/en.ts | 4 +- lib/i18n/messages/zh-CN.ts | 4 +- lib/i18n/messages/zh-TW.ts | 4 +- 8 files changed, 157 insertions(+), 16 deletions(-) create mode 100644 components/ChatWindow.attach-files.test.mjs diff --git a/components/ChatInput.test.mjs b/components/ChatInput.test.mjs index 062aaf7424..509566b1af 100644 --- a/components/ChatInput.test.mjs +++ b/components/ChatInput.test.mjs @@ -400,7 +400,44 @@ test("renders the compact composer with the standard Send button and no session assert.match(html, /