Skip to content

Conversation

rachelmcr
Copy link
Contributor

@rachelmcr rachelmcr commented Oct 13, 2025

Task/Issue URL: https://app.asana.com/1/137249556945/project/1209825025475019/task/1211397736375307?focus=true
Tech Design URL:
CC: @diegoreymendez

Description

This adds a “Duck.ai chats” toggle to the new fire dialog, so Duck.ai chats can be cleared when using the fire button or deleting history:

  • The toggle is only visible when:
    • The “Everything” scope is selected (from the fire button) or All History is being deleted
    • Duck.ai has been used before
    • Duck.ai features are enabled in Settings > AI Features.
  • The toggle defaults to off, but remembers your selection when you reopen the dialog.
  • This toggle is not yet functional (chat history clearing will be in another PR).

If the new fire dialog is not enabled (a fallback in case fireDialog feature flag is disabled):

  • Duck.ai chats will be cleared when using the fire button if the setting to auto-clear them is enabled (Settings > Data Clearing > Auto-Clear > “Delete Duck.ai chat history ...”).
  • The delete history dialog shows a checkbox to delete Duck.ai chats (defaulted to off).

⚠️ Do not merge until #2059 and #2194 are merged (relies on changes from both PRs) ⚠️

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. Confirm the “Duck.ai chats” toggle appears, defaulted to off.

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. Confirm the “Duck.ai chats” toggle appears, defaulted to off.

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. 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 copy mentions clearing Duck.ai chat history.

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. Go to Settings > Data Clearing > Auto-Clear and enable the “Delete Duck.ai chat history” setting (auto-clear also needs to be enabled).
  4. Select Main menu > History > Delete All History or view all history and select “Delete All.”
  5. Confirm the “Also delete Duck.ai chats” checkbox appears, defaulted to off.

Optional testing scenarios:

  • Enable the toggle and confirm your selection is remembered when you click the fire button again.
  • Disable all other toggles, enable the “Duck.ai chats” toggle, and confirm the Delete button is enabled (can be clicked).
  • Disable the feature flag under Debug > Feature Flag Overrides > Duck.ai > clearAIChatHistory, click the fire button, and confirm the toggle is not visible.
  • Disable AI features under Settings > AI Features, click the fire button, and confirm the toggle is not visible.
  • Run the terminal command defaults delete com.duckduckgo.macos.browser.debug featureUsedBefore_aiChat to simulate a user who hasn’t used Duck.ai before, click the fire button, and confirm the toggle is not visible.

Impact and Risks

Low: Minor visual changes, small bug fixes, improvement to existing features

What could go wrong?

Toggle is non-functional but could show up to users; it is feature flagged and has been manually tested.

Quality Considerations

Notes to Reviewer

New dialog Production dialog
Screenshot 2025-10-13 at 15 27 36 Screenshot 2025-10-13 at 17 06 27
Screenshot 2025-10-13 at 16 08 40 Screenshot 2025-10-13 at 17 08 55

Internal references:

Definition of Done | Engineering Expectations | Tech Design Template


Note

Adds a feature-flagged Duck.ai chats clearing option (UI + settings) on macOS, wires visibility via a new AIChatHistoryCleaner and FeatureDiscovery notifications, updates strings/UI, and expands tests and project wiring.

  • macOS:
    • Fire Dialog & Popover: Add Duck.ai chats toggle; include in FireDialogResult and flow; update labels (e.g., active tabs info) and dynamic sizing.
    • History Delete Dialog: Add checkbox to also delete Duck.ai chats (All History scope).
    • Settings: New Auto-Clear setting to delete Duck.ai chat history on quit; warning dialog text updates accordingly.
    • Coordinator/Preferences: Wire AIChatHistoryCleaner into AppDelegate, DataClearingPreferences, FireCoordinator, and FirePopoverViewController.
  • Core/Flags:
    • New AIChatHistoryCleaner determines visibility (depends on usage, AI Chat visibility, and clearAIChatHistory feature flag).
    • Add FeatureFlag.clearAIChatHistory; expose WasUsedBeforeFeature.storageKey and post .featureDiscoverySetWasUsedBefore notification in DefaultFeatureDiscovery.
    • Add AIChatSubfeature.clearAIChatHistory (BrowserServicesKit).
  • UX/Strings: Update UserText and NSAlert.autoClearAlert(...) to reflect chat deletion scenarios.
  • iOS ancillary: SwitchBar metrics now uses FeatureDiscovery; imports updated.
  • Tests/Build: Add/adjust unit tests and mocks (incl. AIChatHistoryCleanerTests, DefaultFeatureDiscoveryTests); migrate to BrowserServicesKitTestsUtils; project files updated.

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

Copy link

github-actions bot commented Oct 13, 2025

Messages
📖

You seem to be updating localized strings. Make sure that you request translations and include translated strings before you ship your change. See iOS and macOS localization guidelines for more information.

Generated by 🚫 dangerJS against 3f752dd

cursor[bot]

This comment was marked as outdated.

@rachelmcr rachelmcr changed the title macOS: Add Duck.ai chats toggle to new fire dialog macOS: Add Duck.ai chats toggle to fire button dialog Oct 13, 2025
@rachelmcr rachelmcr changed the title macOS: Add Duck.ai chats toggle to fire button dialog macOS: Add Duck.ai chats toggle UI to fire button and history dialogs Oct 13, 2025
@rachelmcr rachelmcr requested a review from mallexxx October 13, 2025 16:20
@rachelmcr rachelmcr changed the base branch from rachel/chat-history-setting-changes to alex/cohesive-fire-dialog October 14, 2025 15:17
@rachelmcr
Copy link
Contributor Author

Apologies, I messed up the commits here; I’ll get them fixed ASAP

@rachelmcr rachelmcr force-pushed the rachel/chat-history-fire-dialog branch from 440589e to 3f752dd Compare October 14, 2025 15:56
@rachelmcr rachelmcr changed the base branch from alex/cohesive-fire-dialog to rachel/chat-history-merged-changes October 14, 2025 15:56
@rachelmcr
Copy link
Contributor Author

Ok, this branch is fixed and the PR includes only the new commits.

@rachelmcr rachelmcr requested review from diegoreymendez and removed request for mallexxx October 15, 2025 15:04
Copy link
Contributor

@diegoreymendez diegoreymendez left a comment

Choose a reason for hiding this comment

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

Only comment is this isn't clearing - but we spoke via DM and that's expected as this is only UI.

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