-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: Replace image-only attachment with general file attachment support (#5532) #5908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add comprehensive file processing system with MIME type detection - Support multiple file categories (images, documents, code, data, archives, config) - Implement 10MB file size limit and intelligent text/binary handling - Replace camera icon with paperclip icon in chat interface - Add selectFiles message types and handlers - Update translations for attachFiles across all languages - Maintain backward compatibility with existing image functionality Resolves #5532
| "selectApiConfig": "選取 API 設定", | ||
| "enhancePrompt": "使用額外內容增強提示", | ||
| "addImages": "新增圖片到訊息中", | ||
| "attachFiles": "Attach files to message", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'attachFiles' key still contains English text ('Attach files to message'). Please provide a proper Traditional Chinese translation (e.g., '將檔案附加到訊息') to maintain consistency with the localized content.
| "attachFiles": "Attach files to message", | |
| "attachFiles": "將檔案附加到訊息", |
| "selectApiConfig": "Seleccioneu la configuració de l'API", | ||
| "enhancePrompt": "Millora la sol·licitud amb context addicional", | ||
| "addImages": "Afegeix imatges al missatge", | ||
| "attachFiles": "Attach files to message", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that the new key "attachFiles" still uses an English phrase ('Attach files to message') in a Catalan locale file. Please update it to a Catalan translation.
| "attachFiles": "Attach files to message", | |
| "attachFiles": "Adjunta fitxers al missatge", |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
| "selectApiConfig": "API-Konfiguration auswählen", | ||
| "enhancePrompt": "Prompt mit zusätzlichem Kontext verbessern", | ||
| "addImages": "Bilder zur Nachricht hinzufügen", | ||
| "attachFiles": "Attach files to message", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typographical Note: The value for the key "attachFiles" is in English, which is inconsistent with the rest of the German locale file. Consider providing the correct German translation, e.g., "Dateien zur Nachricht anhängen".
| "attachFiles": "Attach files to message", | |
| "attachFiles": "Dateien zur Nachricht anhängen", |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
| "selectApiConfig": "Sélectionner la configuration de l'API", | ||
| "enhancePrompt": "Améliorer la requête avec un contexte supplémentaire", | ||
| "addImages": "Ajouter des images au message", | ||
| "attachFiles": "Attach files to message", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new key 'attachFiles' has an English string in a French localization file. Consider translating it to French (e.g. "Joindre des fichiers au message") for consistency.
| "attachFiles": "Attach files to message", | |
| "attachFiles": "Joindre des fichiers au message", |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
| "description": "Gespecialiseerde persona's die het gedrag van Roo aanpassen." | ||
| }, | ||
| "addImages": "Afbeeldingen toevoegen aan bericht", | ||
| "attachFiles": "Attach files to message", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The translation for 'attachFiles' is still in English ('Attach files to message') while the rest of the file is in Dutch. Please verify if this is intentional or if it should be translated (e.g., "Bestanden toevoegen aan bericht").
| "attachFiles": "Attach files to message", | |
| "attachFiles": "Bestanden toevoegen aan bericht", |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
| "selectApiConfig": "Wybierz konfigurację API", | ||
| "enhancePrompt": "Ulepsz podpowiedź dodatkowym kontekstem", | ||
| "addImages": "Dodaj obrazy do wiadomości", | ||
| "attachFiles": "Attach files to message", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new entry, "Attach files to message," appears in English in a Polish locale file. This seems out of place given the other translations. Please consider providing the appropriate Polish translation (e.g., "Załącz pliki do wiadomości").
| "attachFiles": "Attach files to message", | |
| "attachFiles": "Załącz pliki do wiadomości", |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
| "selectApiConfig": "Selecionar configuração da API", | ||
| "enhancePrompt": "Aprimorar prompt com contexto adicional", | ||
| "addImages": "Adicionar imagens à mensagem", | ||
| "attachFiles": "Attach files to message", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typographical note: The value for attachFiles is in English ('Attach files to message') while the rest of the translations are in Portuguese. Consider translating it (e.g., 'Anexar arquivos à mensagem') for language consistency.
| "attachFiles": "Attach files to message", | |
| "attachFiles": "Anexar arquivos à mensagem", |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
| "selectApiConfig": "API yapılandırmasını seçin", | ||
| "enhancePrompt": "Ek bağlamla istemi geliştir", | ||
| "addImages": "Mesaja resim ekle", | ||
| "attachFiles": "Attach files to message", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new translation for "attachFiles" is in English. Considering this file is for Turkish locales, please provide a Turkish translation for consistency (e.g., "Mesaja dosya ekle").
| "attachFiles": "Attach files to message", | |
| "attachFiles": "Mesaja dosya ekle", |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
|
Closing, see #5570 (comment) |
This PR implements general file attachment support to replace the current image-only attachment system while maintaining full backward compatibility.
🎯 Overview
Replaces the camera icon with a paperclip icon and extends file support beyond images to include documents, code files, data files, archives, and configuration files.
✨ Key Features
process-files.tsmodule with intelligent MIME type detection🔧 Technical Implementation
selectFilesmessage types to WebviewMessage.ts and ExtensionMessage.ts🧪 Testing
📝 Files Changed
src/integrations/misc/process-files.ts(new)src/shared/WebviewMessage.tssrc/shared/ExtensionMessage.tssrc/core/webview/webviewMessageHandler.tswebview-ui/src/components/chat/ChatTextArea.tsxwebview-ui/src/components/chat/ChatView.tsxResolves #5532
Important
This PR replaces image-only attachment with general file attachment support, updates UI components, and adds internationalization for file attachments.
ChatTextArea.tsxandChatView.tsx.attachFilestranslation key.process-files.tsfor file processing with MIME type detection.webviewMessageHandler.tsto handle file selection.selectFilesmessage types toWebviewMessage.tsandExtensionMessage.ts.This description was created by
for 53422d3. You can customize this summary. It will automatically update as commits are pushed.