Merged
Conversation
This was referenced Jan 19, 2026
Contributor
Author
17 tasks
ee8999d to
eb4c39d
Compare
299b90f to
cb97f02
Compare
bdc2bff to
552a005
Compare
0c907de to
5ee523e
Compare
Base automatically changed from
feature/david/01-19-duck.ai_automatic_context_setting
to
develop
January 23, 2026 12:46
423ee3c to
d608bfc
Compare
6dd66d9 to
f5200be
Compare
18 tasks
f5200be to
5b162d9
Compare
5b162d9 to
7c51d92
Compare
7 tasks
e1b038b to
327f4d8
Compare
Task/Issue URL: https://app.asana.com/1/137249556945/project/1174433894299346/task/1213004332490553?focus=true ### Description This PR adds support for adding / removing context from the web input ### Steps to test this PR _Automatic Context Attachment OFF_ - [x] Open app, Settings / AI Feature - [x] Ensure Automatic Context Attachment is disabled - [x] Open Contextual sheet - [x] Enter any prompt, ensure that no context is added - [x] Once Duck.ai is visible, tap on the clip icon on the web input - [x] Select Current Tab Content - [x] Verify context is added - [x] Tap on the new X button that appars - [x] Verify content is removed from the web input - [x] Add the context again and enter a prompt - [x] Verify context has been added and is showing at the top of Duck.ai _Automatic Context Attachment ON_ - [x] Open app, Settings / AI Feature - [x] Ensure Automatic Context Attachment is enabled - [x] Open Contextual sheet - [x] Enter any prompt, ensure that no context is added (you’ll have to remove it) - [x] Once Duck.ai is visible, verify that the context is now appearing in the web input - [x] Enter a prompt - [x] Verify context has been added and is showing at the top of Duck.ai <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Moderate risk: adds new JS bridge behavior and persists per-tab chat URLs in DataStore, which can affect contextual chat UX and state cleanup when tabs are deleted. > > **Overview** > Adds **contextual Duck.ai web-input context support** by extending `DuckChatJSHelper.processJsCallbackMessage` to handle a new `getAIChatPageContext` method and conditionally return the current page context (based on request reason and the *automatic context attachment* setting). > > Enhances **contextual sheet session behavior** by persisting/restoring a per-tab chat URL (including chat history detection via `chatID`), adding a native “new chat” action, and ensuring contextual chat state is cleared when tabs (or all tabs) are deleted via `TabDataRepository`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 69b0ded. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/1174433894299346/task/1212358379355429?focus=true
Description
This PR adds the ability to attach page context and prompt sending it
Steps to test this PR
-Enable contextualMode FF
Context refreshed
Prompt with context
Prompt without context
Note
Medium Risk
Adds new contextual-mode data flow (content-scope
pageContextmessages, new ViewModel/state, and per-tab URL persistence) that can affect Duck.ai navigation and JS/native messaging behavior. Risk is moderated by targeted unit/instrumentation test updates but touches several browser/chat integration points.Overview
Enables Duck.ai contextual mode to collect, display, and optionally attach the current page context (title/favicon/content) when sending a native prompt, with UI controls to remove/re-add the attachment.
Introduces a new content-scope
pageContextfeature (config/store/repository + JS message handler) and wires it throughBrowserTabViewModel.processJsCallbackMessagevia newCommand.PageContextReceived, whichBrowserTabFragmentforwards to a shared contextual ViewModel.Refactors the contextual bottom sheet to a new
DuckChatContextualViewModel, adds sidebar chat URL generation (DuckChat.getDuckChatUrl(..., sidebar)), supports JS requests forgetAIChatPageContext, and persists/clears per-tab contextual chat URLs viaDuckChatContextualDataStore(hooked into tab deletion/clear-all).Written by Cursor Bugbot for commit 4d18986. This will update automatically on new commits. Configure here.