Skip to content

Ask Duck.ai pixels and wide event - #9766

Open
joshliebe wants to merge 10 commits into
feature/josh/ask-duck-aifrom
feature/josh/ask-duck-ai-pixels
Open

Ask Duck.ai pixels and wide event#9766
joshliebe wants to merge 10 commits into
feature/josh/ask-duck-aifrom
feature/josh/ask-duck-ai-pixels

Conversation

@joshliebe

@joshliebe joshliebe commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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

Description

Steps to test this PR

Feature 1

  • [ ]
  • [ ]

Note

Low Risk
Analytics-only changes with no auth, payment, or user-data handling beyond existing pixel/wide-event pipelines.

Overview
Adds telemetry for contextual “Ask Duck.ai” text selections: four new count/daily pixels (attach, max-limit refusal, remove, and prompt submit with bucketed selection_count), registered in duck_chat.json5 and implemented on DuckChatPixels.

Introduces the android-duckai-selection-journey wide event (definition + JSON schema) and DuckAiSelectionJourneyWideEvent, which tracks a funnel from the first successful attach through dismissals, selection suggestions (summarize/translate), and terminal outcomes (submitted, all selections removed, new chat, chat cleared, session expiry after 5 minutes).

Instrumentation is wired into RealTextSelectionRepository (attach/remove/limit pixels + journey start/update), DuckChatContextualWebViewViewModel (submit with selections, sheet dismiss, new chat, fire clear), and ContextualSuggestionsViewModel (selection suggestions shown/selected). Tests are extended to cover pixel and journey callbacks.

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

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.

@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 1aeef24. Configure here.

// so it isn't resumed, then let the dialog command hide the sheet. Mark the impending hide as a
// handoff so onSheetClosed doesn't revert the tab's contextual input state.
duckChatPixels.reportContextualSheetNewChatFromPopup()
selectionJourney.onJourneyEnded(SelectionTerminalReason.NEW_CHAT)

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.

New Chat ends journey too early

Medium Severity

onJourneyEnded runs on New Chat and chat-cleared while resetToNewChat leaves attached selections in TextSelectionStore. A later submit of those leftover selections calls onPromptSubmitted with no active journey, so a successful ask is recorded as cancelled.


Please tell me if this was useful or not with a 👍 or 👎.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1aeef24. Configure here.

return
}
duckChatPixels.reportContextualSheetDismissed()
selectionJourney.onSurfaceDismissed()

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.

Entry dismiss skips journey dismissal

Medium Severity

onSurfaceDismissed is only wired from sheet close. Ask Duck.ai opens the entry dialog first, and onDismiss there never notifies the journey, so dismissal_count and dismissed_before_submission miss the main surface people leave after attaching text.


Please tell me if this was useful or not with a 👍 or 👎.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1aeef24. Configure here.

@joshliebe
joshliebe force-pushed the feature/josh/ask-duck-ai-pixels branch 2 times, most recently from af941cf to f3c8db0 Compare September 9, 2026 23:47
@joshliebe
joshliebe force-pushed the feature/josh/ask-duck-ai branch from 99f7022 to 3e194f5 Compare September 10, 2026 14:55
@joshliebe
joshliebe force-pushed the feature/josh/ask-duck-ai-pixels branch from f3c8db0 to caf5d16 Compare September 10, 2026 14:56
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.

1 participant