Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 27 additions & 16 deletions apps/frontend/components/chat/ProjectChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
MicOff,
RotateCcw,
SendIcon,
Square,
Volume2,
VolumeX,
X,
Expand Down Expand Up @@ -512,7 +513,7 @@ function ProjectChatSession({
}
}, [selectedModelId, selectableModels]);

const { messages, sendMessage, status, addToolOutput } = useChat<ChatUIMessage>({
const { messages, sendMessage, status, addToolOutput, stop } = useChat<ChatUIMessage>({
chat: entry.chat,
});

Expand Down Expand Up @@ -915,21 +916,31 @@ function ProjectChatSession({
{isRecording ? <MicOff className="h-4 w-4" /> : <Mic className="h-4 w-4" />}
</Button>
)}
<Button
size="icon"
onClick={() => void handleSendMessage()}
disabled={
!inputValue.trim() ||
isAssistantTyping ||
isRecording ||
!!pendingClarification ||
noModelsConfigured
}
className={isEmptyChat ? "h-10 w-10 shrink-0" : undefined}
>
<SendIcon className="h-4 w-4" />
<span className="sr-only">{t("send.message")}</span>
</Button>
{isAssistantTyping ? (
<Button
size="icon"
onClick={() => stop()}
className={isEmptyChat ? "h-10 w-10 shrink-0" : undefined}
>
<Square className="h-4 w-4" />
<span className="sr-only">{t("stop.response")}</span>
</Button>
) : (
<Button
size="icon"
onClick={() => void handleSendMessage()}
disabled={
!inputValue.trim() ||
isRecording ||
!!pendingClarification ||
noModelsConfigured
}
className={isEmptyChat ? "h-10 w-10 shrink-0" : undefined}
>
<SendIcon className="h-4 w-4" />
<span className="sr-only">{t("send.message")}</span>
</Button>
)}
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"copied.code": "Code kopiert",
"start.recording": "Spracheingabe starten",
"stop.recording": "Spracheingabe beenden",
"stop.response": "Antwort stoppen",
"play.message": "Abspielen",
"stop.speaking": "Stopp",
"deep.mode": "Tiefe Analyse",
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"copied.code": "Code copied",
"start.recording": "Start voice input",
"stop.recording": "Stop voice input",
"stop.response": "Stop response",
"play.message": "Play",
"stop.speaking": "Stop",
"deep.mode": "Deep Mode",
Expand Down