macOS: Add logic for clearing chat history with Fire actions #2201
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Task/Issue URL: https://app.asana.com/1/137249556945/project/1209825025475019/task/1211467830189072
Tech Design URL:
CC: @diegoreymendez
Description
This adds the logic to clear chat history with Fire actions. Note: The data is not actually cleared (this is implemented in another PR).
From the fire button dialog and the delete history dialog, we now handle the following actions:
Note that we only support burning chat history when the largest scope is selected for burning/deleting (all windows are burned, all history is deleted).
Testing Steps
With new fire dialog:
*** AIChatHistoryCleaner: cleaning chat history ***
only when the chat toggle was on.With new history dialog:
*** AIChatHistoryCleaner: cleaning chat history ***
only when the chat toggle was on.With production fire dialog:
*** AIChatHistoryCleaner: cleaning chat history ***
only when the chat auto-clear setting was on.With production history dialog:
*** AIChatHistoryCleaner: cleaning chat history ***
only when the chat option was enabled.Impact and Risks
Medium: Could disrupt specific features or user flows
What could go wrong?
Chat history could be cleared/not cleared unexpectedly (data clearing not yet implemented, but this contains the logic for whether to clear it). Logic has been manually tested and covered by unit tests.
Quality Considerations
Notes to Reviewer
Internal references:
Definition of Done | Engineering Expectations | Tech Design Template
Note
Add Duck.ai chat history clearing across Fire and History flows with new flags, UI options, and wiring into Fire/History layers.
FireProtocol
/Fire
to support chat cleanup: addincludingChatHistory
toburnEntity
/burnVisits
, newburnChatHistory()
, and injectAIChatHistoryCleaning
.cleanAIChatHistory()
onburnAll
and conditionally during scoped burns.Duck.ai
chats; enable only for “All” scope.HistoryViewDeleteDialogModel
to persist chat option (keys renamed) and return responses withincludeChats
.HistoryViewDataProvider
andHistoryViewActionsHandler
: propagateincludeChats
and callHistoryBurning.burnChats()
/ route toFire
when appropriate.HistoryBurning
withburnChats()
and plumb throughFireHistoryBurner
.Fire
.AIChatHistoryCleanerMock
; updateFireMock
, History providers, and tests to cover chat-clear paths.BrowserServicesKitTestsUtils
) and file references to Xcode project.Written by Cursor Bugbot for commit 9171209. This will update automatically on new commits. Configure here.