mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-21 14:07:20 +08:00
fix(vscode): disable send button while question tool is pending (#7181)
* fix(vscode): disable send button while question tool is pending * feat(vscode): add tooltip explaining why send is disabled during pending question Show 'Answer or dismiss the pending question first' on the send button tooltip when a question or permission dock is active. Translated to all 16 supported locales.
This commit is contained in:
@@ -134,7 +134,7 @@ export const ChatView: Component<ChatViewProps> = (props) => {
|
||||
</div>
|
||||
</Show>
|
||||
<Show when={!props.readonly}>
|
||||
<PromptInput />
|
||||
<PromptInput blocked={blocked} />
|
||||
</Show>
|
||||
</div>
|
||||
</Show>
|
||||
|
||||
@@ -41,7 +41,11 @@ function mergeReviewComments(current: ReviewComment[], incoming: ReviewComment[]
|
||||
return [...map.values()]
|
||||
}
|
||||
|
||||
export const PromptInput: Component = () => {
|
||||
interface PromptInputProps {
|
||||
blocked?: () => boolean
|
||||
}
|
||||
|
||||
export const PromptInput: Component<PromptInputProps> = (props) => {
|
||||
const session = useSession()
|
||||
const server = useServer()
|
||||
const language = useLanguage()
|
||||
@@ -172,7 +176,7 @@ export const PromptInput: Component = () => {
|
||||
const isBusy = () => session.status() === "busy"
|
||||
const isDisabled = () => !server.isConnected()
|
||||
const hasInput = () => text().trim().length > 0 || imageAttach.images().length > 0 || reviewComments().length > 0
|
||||
const canSend = () => hasInput() && !isDisabled()
|
||||
const canSend = () => hasInput() && !isDisabled() && !props.blocked?.()
|
||||
const showStop = () => isBusy() && !hasInput()
|
||||
const placeholder = () => {
|
||||
switch (server.connectionState()) {
|
||||
@@ -450,7 +454,7 @@ export const PromptInput: Component = () => {
|
||||
const pending = reviewComments()
|
||||
const review = pending.length > 0 ? formatReviewCommentsMarkdown(pending) : ""
|
||||
const message = draft && review ? `${review}\n\n${draft}` : draft || review
|
||||
if ((!message && imgs.length === 0) || isDisabled()) return
|
||||
if ((!message && imgs.length === 0) || isDisabled() || props.blocked?.()) return
|
||||
|
||||
const mentionFiles = mention.parseFileAttachments(draft)
|
||||
const imgFiles = imgs.map((img) => ({ mime: img.mime, url: img.dataUrl, filename: img.filename }))
|
||||
@@ -639,7 +643,10 @@ export const PromptInput: Component = () => {
|
||||
<Show
|
||||
when={showStop()}
|
||||
fallback={
|
||||
<Tooltip value={language.t("prompt.action.send")} placement="top">
|
||||
<Tooltip
|
||||
value={props.blocked?.() ? language.t("prompt.action.send.blocked") : language.t("prompt.action.send")}
|
||||
placement="top"
|
||||
>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="small"
|
||||
|
||||
@@ -229,6 +229,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "إرفاق ملف",
|
||||
"prompt.attachment.remove": "إزالة المرفق",
|
||||
"prompt.action.send": "إرسال",
|
||||
"prompt.action.send.blocked": "أجب عن السؤال المعلق أو تجاهله أولاً",
|
||||
"prompt.action.stop": "توقف",
|
||||
"prompt.action.enhance": "تحسين النص",
|
||||
"prompt.action.resetModel": "إعادة تعيين النموذج إلى الافتراضي",
|
||||
|
||||
@@ -230,6 +230,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "Anexar arquivo",
|
||||
"prompt.attachment.remove": "Remover anexo",
|
||||
"prompt.action.send": "Enviar",
|
||||
"prompt.action.send.blocked": "Responda ou feche a pergunta pendente primeiro",
|
||||
"prompt.action.stop": "Parar",
|
||||
"prompt.action.enhance": "Melhorar prompt",
|
||||
"prompt.action.resetModel": "Redefinir modelo para o padrão",
|
||||
|
||||
@@ -231,6 +231,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "Priloži datoteku",
|
||||
"prompt.attachment.remove": "Ukloni prilog",
|
||||
"prompt.action.send": "Pošalji",
|
||||
"prompt.action.send.blocked": "Prvo odgovorite ili odbacite pitanje na čekanju",
|
||||
"prompt.action.stop": "Zaustavi",
|
||||
"prompt.action.enhance": "Poboljšaj prompt",
|
||||
"prompt.action.resetModel": "Resetuj model na zadani",
|
||||
|
||||
@@ -230,6 +230,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "Vedhæft fil",
|
||||
"prompt.attachment.remove": "Fjern vedhæftning",
|
||||
"prompt.action.send": "Send",
|
||||
"prompt.action.send.blocked": "Besvar eller afvis det afventende spørgsmål først",
|
||||
"prompt.action.stop": "Stop",
|
||||
"prompt.action.enhance": "Forbedr prompt",
|
||||
"prompt.action.resetModel": "Nulstil model til standard",
|
||||
|
||||
@@ -234,6 +234,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "Datei anhängen",
|
||||
"prompt.attachment.remove": "Anhang entfernen",
|
||||
"prompt.action.send": "Senden",
|
||||
"prompt.action.send.blocked": "Beantworten oder verwerfen Sie zuerst die ausstehende Frage",
|
||||
"prompt.action.stop": "Stopp",
|
||||
"prompt.action.enhance": "Prompt verbessern",
|
||||
"prompt.action.resetModel": "Modell auf Standard zurücksetzen",
|
||||
|
||||
@@ -231,6 +231,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "Attach file",
|
||||
"prompt.attachment.remove": "Remove attachment",
|
||||
"prompt.action.send": "Send",
|
||||
"prompt.action.send.blocked": "Answer or dismiss the pending question first",
|
||||
"prompt.action.stop": "Stop",
|
||||
"prompt.action.enhance": "Enhance prompt",
|
||||
"prompt.action.resetModel": "Reset model to default",
|
||||
|
||||
@@ -230,6 +230,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "Adjuntar archivo",
|
||||
"prompt.attachment.remove": "Eliminar adjunto",
|
||||
"prompt.action.send": "Enviar",
|
||||
"prompt.action.send.blocked": "Responda o descarte la pregunta pendiente primero",
|
||||
"prompt.action.stop": "Detener",
|
||||
"prompt.action.enhance": "Mejorar prompt",
|
||||
"prompt.action.resetModel": "Restablecer modelo al predeterminado",
|
||||
|
||||
@@ -231,6 +231,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "Joindre un fichier",
|
||||
"prompt.attachment.remove": "Supprimer la pièce jointe",
|
||||
"prompt.action.send": "Envoyer",
|
||||
"prompt.action.send.blocked": "Répondez ou rejetez d'abord la question en attente",
|
||||
"prompt.action.stop": "Arrêter",
|
||||
"prompt.action.enhance": "Améliorer le prompt",
|
||||
"prompt.action.resetModel": "Réinitialiser le modèle par défaut",
|
||||
|
||||
@@ -229,6 +229,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "ファイルを添付",
|
||||
"prompt.attachment.remove": "添付ファイルを削除",
|
||||
"prompt.action.send": "送信",
|
||||
"prompt.action.send.blocked": "最初に保留中の質問に答えるか、閉じてください",
|
||||
"prompt.action.stop": "停止",
|
||||
"prompt.action.enhance": "プロンプトを改善",
|
||||
"prompt.action.resetModel": "モデルをデフォルトにリセット",
|
||||
|
||||
@@ -233,6 +233,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "파일 첨부",
|
||||
"prompt.attachment.remove": "첨부 파일 제거",
|
||||
"prompt.action.send": "전송",
|
||||
"prompt.action.send.blocked": "먼저 대기 중인 질문에 답하거나 닫아주세요",
|
||||
"prompt.action.stop": "중지",
|
||||
"prompt.action.enhance": "프롬프트 개선",
|
||||
"prompt.action.resetModel": "모델을 기본값으로 재설정",
|
||||
|
||||
@@ -233,6 +233,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "Legg ved fil",
|
||||
"prompt.attachment.remove": "Fjern vedlegg",
|
||||
"prompt.action.send": "Send",
|
||||
"prompt.action.send.blocked": "Svar på eller avvis det ventende spørsmålet først",
|
||||
"prompt.action.stop": "Stopp",
|
||||
"prompt.action.enhance": "Forbedre prompt",
|
||||
"prompt.action.resetModel": "Tilbakestill modell til standard",
|
||||
|
||||
@@ -230,6 +230,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "Załącz plik",
|
||||
"prompt.attachment.remove": "Usuń załącznik",
|
||||
"prompt.action.send": "Wyślij",
|
||||
"prompt.action.send.blocked": "Najpierw odpowiedz na oczekujące pytanie lub je odrzuć",
|
||||
"prompt.action.stop": "Zatrzymaj",
|
||||
"prompt.action.enhance": "Ulepsz prompt",
|
||||
"prompt.action.resetModel": "Zresetuj model do domyślnego",
|
||||
|
||||
@@ -230,6 +230,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "Прикрепить файл",
|
||||
"prompt.attachment.remove": "Удалить вложение",
|
||||
"prompt.action.send": "Отправить",
|
||||
"prompt.action.send.blocked": "Сначала ответьте на ожидающий вопрос или отклоните его",
|
||||
"prompt.action.stop": "Остановить",
|
||||
"prompt.action.enhance": "Улучшить промпт",
|
||||
"prompt.action.resetModel": "Сбросить модель на значение по умолчанию",
|
||||
|
||||
@@ -230,6 +230,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "แนบไฟล์",
|
||||
"prompt.attachment.remove": "เอาไฟล์แนบออก",
|
||||
"prompt.action.send": "ส่ง",
|
||||
"prompt.action.send.blocked": "โปรดตอบหรือข้ามคำถามที่รอดำเนินการก่อน",
|
||||
"prompt.action.stop": "หยุด",
|
||||
"prompt.action.enhance": "ปรับปรุงพรอมต์",
|
||||
"prompt.action.resetModel": "รีเซ็ตโมเดลเป็นค่าเริ่มต้น",
|
||||
|
||||
@@ -230,6 +230,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "附加文件",
|
||||
"prompt.attachment.remove": "移除附件",
|
||||
"prompt.action.send": "发送",
|
||||
"prompt.action.send.blocked": "请先回答或忽略待处理的问题",
|
||||
"prompt.action.stop": "停止",
|
||||
"prompt.action.enhance": "优化提示词",
|
||||
"prompt.action.resetModel": "重置模型为默认值",
|
||||
|
||||
@@ -230,6 +230,7 @@ export const dict = {
|
||||
"prompt.action.attachFile": "附加檔案",
|
||||
"prompt.attachment.remove": "移除附件",
|
||||
"prompt.action.send": "傳送",
|
||||
"prompt.action.send.blocked": "請先回答或忽略待處理的問題",
|
||||
"prompt.action.stop": "停止",
|
||||
"prompt.action.enhance": "改善提示詞",
|
||||
"prompt.action.resetModel": "重置模型為預設值",
|
||||
|
||||
Reference in New Issue
Block a user