From 0383499ca585127610abc030dabffb4c566499f7 Mon Sep 17 00:00:00 2001 From: Minidoracat Date: Tue, 3 Jun 2025 01:14:17 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E5=A2=9E=E5=8A=A0=E5=9B=9E?= =?UTF-8?q?=E9=A5=8B=E6=8F=90=E4=BA=A4=E6=99=82=E7=9A=84=E7=A9=BA=E5=85=A7?= =?UTF-8?q?=E5=AE=B9=E6=AA=A2=E6=9F=A5=EF=BC=8C=E4=B8=A6=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=9B=B8=E6=87=89=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mcp_feedback_enhanced/feedback_ui.py | 15 ++++++++++++++- .../locales/en/translations.json | 4 +++- .../locales/zh-CN/translations.json | 4 +++- .../locales/zh-TW/translations.json | 4 +++- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/mcp_feedback_enhanced/feedback_ui.py b/src/mcp_feedback_enhanced/feedback_ui.py index 2393a90..77460a3 100644 --- a/src/mcp_feedback_enhanced/feedback_ui.py +++ b/src/mcp_feedback_enhanced/feedback_ui.py @@ -1422,8 +1422,21 @@ class FeedbackWindow(QMainWindow): def _submit_feedback(self) -> None: """提交回饋""" + feedback_text = self.feedback_input.toPlainText().strip() + + # 檢查回饋內容是否為空 + if not feedback_text: + QMessageBox.information( + self, + t('feedback.emptyTitle'), + t('feedback.emptyMessage') + ) + # 將焦點設置到回饋輸入框 + self.feedback_input.setFocus() + return + self.result = { - "interactive_feedback": self.feedback_input.toPlainText(), + "interactive_feedback": feedback_text, "command_logs": self.command_output.toPlainText(), "images": self.image_upload.get_images_data() } diff --git a/src/mcp_feedback_enhanced/locales/en/translations.json b/src/mcp_feedback_enhanced/locales/en/translations.json index cc91807..d918714 100644 --- a/src/mcp_feedback_enhanced/locales/en/translations.json +++ b/src/mcp_feedback_enhanced/locales/en/translations.json @@ -22,7 +22,9 @@ "feedback": { "title": "Your Feedback", "description": "Please describe your thoughts, suggestions, or modifications needed for the AI's work.", - "placeholder": "Please enter your feedback, suggestions, or questions here...\n\n💡 Tips:\n• Press Ctrl+Enter (numpad supported) to submit quickly\n• Press Ctrl+V to paste images from clipboard" + "placeholder": "Please enter your feedback, suggestions, or questions here...\n\n💡 Tips:\n• Press Ctrl+Enter (numpad supported) to submit quickly\n• Press Ctrl+V to paste images from clipboard", + "emptyTitle": "Feedback Content Empty", + "emptyMessage": "Please enter feedback content before submitting. You can describe your thoughts, suggestions, or areas that need modification." }, "command": { "title": "Command Execution", diff --git a/src/mcp_feedback_enhanced/locales/zh-CN/translations.json b/src/mcp_feedback_enhanced/locales/zh-CN/translations.json index eb1d8e6..a26f2a6 100644 --- a/src/mcp_feedback_enhanced/locales/zh-CN/translations.json +++ b/src/mcp_feedback_enhanced/locales/zh-CN/translations.json @@ -22,7 +22,9 @@ "feedback": { "title": "您的反馈", "description": "请描述您对 AI 工作结果的想法、建议或需要修改的地方。", - "placeholder": "请在这里输入您的反馈、建议或问题...\n\n💡 小提示:\n• 按 Ctrl+Enter(支持数字键盘)可快速提交反馈\n• 按 Ctrl+V 可直接粘贴剪贴板图片" + "placeholder": "请在这里输入您的反馈、建议或问题...\n\n💡 小提示:\n• 按 Ctrl+Enter(支持数字键盘)可快速提交反馈\n• 按 Ctrl+V 可直接粘贴剪贴板图片", + "emptyTitle": "反馈内容为空", + "emptyMessage": "请先输入反馈内容再提交。您可以描述想法、建议或需要修改的地方。" }, "command": { "title": "命令执行", diff --git a/src/mcp_feedback_enhanced/locales/zh-TW/translations.json b/src/mcp_feedback_enhanced/locales/zh-TW/translations.json index 5f3f4ce..91bdb74 100644 --- a/src/mcp_feedback_enhanced/locales/zh-TW/translations.json +++ b/src/mcp_feedback_enhanced/locales/zh-TW/translations.json @@ -22,7 +22,9 @@ "feedback": { "title": "您的回饋", "description": "請描述您對 AI 工作結果的想法、建議或需要修改的地方。", - "placeholder": "請在這裡輸入您的回饋、建議或問題...\n\n💡 小提示:\n• 按 Ctrl+Enter(支援數字鍵盤)可快速提交回饋\n• 按 Ctrl+V 可直接貼上剪貼簿圖片" + "placeholder": "請在這裡輸入您的回饋、建議或問題...\n\n💡 小提示:\n• 按 Ctrl+Enter(支援數字鍵盤)可快速提交回饋\n• 按 Ctrl+V 可直接貼上剪貼簿圖片", + "emptyTitle": "回饋內容為空", + "emptyMessage": "請先輸入回饋內容再提交。您可以描述想法、建議或需要修改的地方。" }, "command": { "title": "命令執行",