Replace clear messages with new chat (#38621)

This commit is contained in:
Saxon Fletcher authored and GitHub committed 2025-09-11 19:03:21 +10:00
1 parent c67d1ef2ee
commit 5fa0987a80
2 files changed
+13 -13

No files matched your search

@@ -394,7 +394,7 @@ export const AIAssistant = ({ className }: AIAssistantProps) => {
<Conversation className={cn('flex-1')}>
<AIAssistantHeader
isChatLoading={isChatLoading}
onClearMessages={handleClearMessages}
onNewChat={snap.newChat}
onCloseAssistant={snap.closeAssistant}
showMetadataWarning={showMetadataWarning}
updatedOptInSinceMCP={updatedOptInSinceMCP}
@@ -1,4 +1,4 @@
import { Eraser, Settings, X } from 'lucide-react'
import { Plus, Settings, X } from 'lucide-react'
import { useState } from 'react'
import { AiIconAnimation, Button } from 'ui'
@@ -9,7 +9,7 @@ import { AIOptInModal } from './AIOptInModal'
interface AIAssistantHeaderProps {
isChatLoading: boolean
onClearMessages: () => void
onNewChat: () => void
onCloseAssistant: () => void
showMetadataWarning: boolean
updatedOptInSinceMCP: boolean
@@ -19,7 +19,7 @@ interface AIAssistantHeaderProps {
export const AIAssistantHeader = ({
isChatLoading,
onClearMessages,
onNewChat,
onCloseAssistant,
showMetadataWarning,
updatedOptInSinceMCP,
@@ -51,6 +51,15 @@ export const AIAssistantHeader = ({
</div>
<div className="flex items-center gap-x-4">
<div className="flex items-center">
<ButtonTooltip
type="text"
size="tiny"
icon={<Plus strokeWidth={1.5} />}
onClick={onNewChat}
className="h-7 w-7 p-0"
disabled={isChatLoading}
tooltip={{ content: { side: 'bottom', text: 'New chat' } }}
/>
<ButtonTooltip
type="text"
size="tiny"
@@ -62,15 +71,6 @@ export const AIAssistantHeader = ({
content: { side: 'bottom', text: 'Permission settings' },
}}
/>
<ButtonTooltip
type="text"
size="tiny"
icon={<Eraser strokeWidth={1.5} />}
onClick={onClearMessages}
className="h-7 w-7 p-0"
disabled={isChatLoading}
tooltip={{ content: { side: 'bottom', text: 'Clear messages' } }}
/>
<ButtonTooltip
type="text"
className="w-7 h-7"