Skip to content

Duck.Ai/ChatHistory: Add context menu - #9760

Open
karlenDimla wants to merge 5 commits into
feature/karl/duckai-sidebar/re-routefrom
feature/karl/duckai-sidebar/history-context-menu
Open

Duck.Ai/ChatHistory: Add context menu#9760
karlenDimla wants to merge 5 commits into
feature/karl/duckai-sidebar/re-routefrom
feature/karl/duckai-sidebar/history-context-menu

Conversation

@karlenDimla

@karlenDimla karlenDimla commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Task/Issue URL: https://app.asana.com/1/137249556945/task/1218238186970938?focus=true
Tech Design URL (if applicable):
API Proposals URL(s) (if applicable):

Description

  • Chat history screen gains an overflow menu (gated by the flag) with Select chats and Chats protection actions; Chats protection opens the Duck.ai chat-protection URL (new RealDuckChat.getChatProtectionUrl()), in a new tab unless already on a chat tab.

Steps to test this PR

Setup

  • Internal build installed
  • At least three saved chat exists in history

nativeDuckAiSidebar enabled, default

  • Open the native chat history screen (Duck.ai sidebar button with nativeDuckAiSidebar on) from a duck.ai chat tab
  • Overflow (⋮) icon IS visible in the chat history toolbar
  • Tapping ⋮ opens a popup with Select chats and *Chats protection
  • Tapping Select chats enters selection mode (toolbar switches to select-mode actions)
  • Verify items are selectable, selecting/deselecting ALL works and Overflow (⋮) icon and search icon are NOT visible
  • Press back and verify you exit the select state
  • Tapping Overflow (⋮) icon and select Chat protection from the menu
  • Verify that history screen is dismissed and on the previously opened tab, the chat protection sheet becomes visible
  • Go to New Tab Page
  • Select menu and press "Chats"
  • Tapping Overflow (⋮) icon and select Chat protection from the menu
  • Verify a new duck.ai chat tab opens and the chat protection sheet becomes visible

nativeDuckAiSidebar disabled (via FF inventory)

  • Go to New Tab Page
  • Select menu and press "Chats"
  • Verify that Overflow (⋮) icon is NOT visible while the history search bar is showing

Note

Low Risk
UI and navigation-only changes behind an existing feature flag, with URL construction centralized in RealDuckChat.

Overview
Adds a feature-flagged (nativeDuckAiSidebar) overflow (⋮) menu on the native Duck.ai chat history toolbar with Select Chats (enters existing bulk-select mode when history is loaded) and Chat Protection.

Chat Protection is wired through a new DuckChatInternal.getChatProtectionUrl() in RealDuckChat, which appends chatProtection=open (plus native-input query params when applicable). The view model opens that URL in the current tab when the selected tab is already a Duck.ai chat URL, otherwise in a new tab; the fragment handles the new OpenChatProtection navigation event accordingly.

Toolbar behavior hides the overflow icon in select mode and respects the flag when applying the default toolbar. Supporting UI includes the overflow menu item, popup layout, shield icon, and strings; test fakes implement the new URL helper.

Reviewed by Cursor Bugbot for commit 1f24033. Bugbot is set up for automated code reviews on this repo. Configure here.

karlenDimla commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@karlenDimla
karlenDimla force-pushed the feature/karl/duckai-sidebar/history-context-menu branch from c0ea2e3 to 3165abd Compare September 10, 2026 11:02

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3165abd. Configure here.

Comment thread duckchat/duckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/RealDuckChat.kt Outdated
karlenDimla and others added 3 commits September 10, 2026 13:34
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes test module compilation broken when getChatProtectionUrl was added
to the DuckChatInternal interface without updating the test fake.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
reduce() stays on Empty when there are no chats, so entering select mode
from the empty state was a no-op. Only offer Select Chats when chats are
present; Chat Protection remains available regardless.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@malmstein malmstein left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm, one suggestion: the new chat-tab vs new-tab branch has no test, and ChatHistoryViewModelTest already has the pattern for it.

controls.update { it.copy(mode = Mode.Selecting(emptySet())) }
}

fun onChatsProtectionClicked() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: the inNewTab decision here isn't covered, and the fixture is already in place since FakeDuckChatInternal stubs getChatProtectionUrl. two cases worth pinning with the existing navigationEvents pattern: selected tab is a duck.ai chat so we reuse it, and anything else so we open a new one.

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