Skip to content

Conversation

rachelmcr
Copy link
Contributor

@rachelmcr rachelmcr commented Oct 14, 2025

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:

  • Burning data with or without burning chat history
  • Deleting history with or without burning chat history

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).

⚠️ Relies on changes from #2195 ⚠️

Testing Steps

With new fire dialog:

  1. Build the app and enable Debug > Feature Flag Overrides > Other > fireDialog.
  2. Visit Duck.ai (so it is set as used before).
  3. Click the fire button and select “Everything.”
  4. Toggle “Duck.ai chats” on or off and click “Delete."
  5. Confirm the console logs include *** AIChatHistoryCleaner: cleaning chat history *** only when the chat toggle was on.

With new history dialog:

  1. Build the app and enable Debug > Feature Flag Overrides > Other > fireDialog.
  2. Visit Duck.ai (so it is set as used before).
  3. Select Main menu > History > Delete All History or view all history and select “Delete All.”
  4. Toggle “Duck.ai chats” on or off and click “Delete."
  5. Confirm the console logs include *** AIChatHistoryCleaner: cleaning chat history *** only when the chat toggle was on.

With production fire dialog:

  1. Build the app and disable Debug > Feature Flag Overrides > Other > fireDialog.
  2. Visit Duck.ai (so it is set as used before).
  3. Optional: Go to Settings > Data Clearing > Auto-Clear and enable the “Delete Duck.ai chat history” setting (auto-clear also needs to be enabled).
  4. Click the fire button and ensure “All sites” is selected.
  5. Confirm the console logs include *** AIChatHistoryCleaner: cleaning chat history *** only when the chat auto-clear setting was on.

With production history dialog:

  1. Build the app and disable Debug > Feature Flag Overrides > Other > fireDialog.
  2. Visit Duck.ai (so it is set as used before).
  3. Select Main menu > History > Delete All History or view all history and select “Delete All.”
  4. Enable or disable “Also delete Duck.ai chats” in the history dialog.
  5. Confirm the console logs include *** 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.

  • Fire/Engine:
    • Extend FireProtocol/Fire to support chat cleanup: add includingChatHistory to burnEntity/burnVisits, new burnChatHistory(), and inject AIChatHistoryCleaning.
    • Invoke cleanAIChatHistory() on burnAll and conditionally during scoped burns.
  • Dialogs/UI:
    • Fire Dialog and History Delete Dialog surface a toggle for Duck.ai chats; enable only for “All” scope.
    • Update HistoryViewDeleteDialogModel to persist chat option (keys renamed) and return responses with includeChats.
  • History layer:
    • Add chat-handling to HistoryViewDataProvider and HistoryViewActionsHandler: propagate includeChats and call HistoryBurning.burnChats() / route to Fire when appropriate.
    • Extend HistoryBurning with burnChats() and plumb through FireHistoryBurner.
  • Wiring/Main menu:
    • Main menu “Clear All History” flows pass chat option to Fire.
  • Tests/Mocks:
    • Add AIChatHistoryCleanerMock; update FireMock, History providers, and tests to cover chat-clear paths.
  • Project:
    • Add test utils (BrowserServicesKitTestsUtils) and file references to Xcode project.

Written by Cursor Bugbot for commit 9171209. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

@rachelmcr rachelmcr force-pushed the rachel/chat-history-burn-logic branch from c9a5040 to 9171209 Compare October 14, 2025 16:08
Copy link
Contributor

@jotaemepereira jotaemepereira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great @rachelmcr 👏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants