mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Merge pull request #347 from AkhilKonduru1/screen-assistant-reset-context
Add reset context button to Screen Assistant
This commit is contained in:
commit
3bbfe942b1
2 changed files with 24 additions and 0 deletions
|
|
@ -203,6 +203,24 @@ struct ChatMessagesView: View {
|
|||
.foregroundColor(.primary)
|
||||
|
||||
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()
|
||||
|
|
|
|||
|
|
@ -1103,7 +1103,13 @@ class ScreenAssistantManager: NSObject, ObservableObject {
|
|||
}
|
||||
|
||||
func clearChat() {
|
||||
resetConversationContext()
|
||||
}
|
||||
|
||||
func resetConversationContext() {
|
||||
isLoading = false
|
||||
chatMessages.removeAll()
|
||||
clearAllFiles()
|
||||
}
|
||||
|
||||
private func addAssistantMessage(_ content: String) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue