feat: add streaming state to markdown quick actions

- Pass isStreaming prop through message components to disable actions during streaming
- Improve action button styling with icons and better spacing
- Disable buttons while streaming to prevent concurrent actions
This commit is contained in:
KevIsDev
2025-05-26 17:57:10 +01:00
parent 74605e96e3
commit de0a41b5f1
3 changed files with 30 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ interface AssistantMessageProps {
append?: (message: Message) => void;
chatMode?: 'discuss' | 'build';
setChatMode?: (mode: 'discuss' | 'build') => void;
isStreaming?: boolean;
}
function openArtifactInWorkbench(filePath: string) {
@@ -43,7 +44,17 @@ function normalizedFilePath(path: string) {
}
export const AssistantMessage = memo(
({ content, annotations, messageId, onRewind, onFork, append, chatMode, setChatMode }: AssistantMessageProps) => {
({
content,
annotations,
messageId,
onRewind,
onFork,
append,
chatMode,
setChatMode,
isStreaming,
}: AssistantMessageProps) => {
const filteredAnnotations = (annotations?.filter(
(annotation: JSONValue) =>
annotation && typeof annotation === 'object' && Object.keys(annotation).includes('type'),
@@ -141,7 +152,7 @@ export const AssistantMessage = memo(
</div>
</div>
</>
<Markdown append={append} chatMode={chatMode} setChatMode={setChatMode} html>
<Markdown append={append} chatMode={chatMode} setChatMode={setChatMode} isStreaming={isStreaming} html>
{content}
</Markdown>
</div>