Add reset context button to Screen Assistant

This commit is contained in:
AkhilKonduru1 2026-03-17 17:49:29 +00:00
commit 38f45e9386
2 changed files with 24 additions and 0 deletions

View file

@ -204,6 +204,24 @@ struct ChatMessagesView: View {
Spacer()
Button(action: {
screenAssistantManager.resetConversationContext()
}) {
HStack(spacing: 6) {
Image(systemName: "arrow.counterclockwise")
.font(.caption)
Text("Reset Context")
.font(.caption)
}
.foregroundColor(.secondary)
.padding(.horizontal, 8)
.padding(.vertical, 5)
.background(Color.gray.opacity(0.12))
.cornerRadius(8)
}
.buttonStyle(PlainButtonStyle())
.help("Clear conversation and attachments")
Button(action: {
screenAssistantManager.closePanels()
}) {

View file

@ -1103,7 +1103,13 @@ class ScreenAssistantManager: NSObject, ObservableObject {
}
func clearChat() {
resetConversationContext()
}
func resetConversationContext() {
isLoading = false
chatMessages.removeAll()
clearAllFiles()
}
private func addAssistantMessage(_ content: String) {