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
Telemetry-only changes with no user-facing behavior beyond firing analytics when selections are added or removed; selection limits and deduplication logic are unchanged.

Overview
Adds telemetry for contextual “Ask Duck.ai” text selections: four new count/daily pixels (attach, limit hit, remove, prompt submitted with bucketed selection_count) in duck_chat.json5, wired through DuckChatPixels and RealTextSelectionRepository.

Introduces the duckai-selection-journey wide event (definition + JSON schema) and RealDuckAiSelectionJourneyWideEvent, which starts when the first selection is attached and finishes on submit, clearing all selections, new chat, fire/clear chat, sheet dismiss counts, suggestion usage (summarize/translate), or a 5‑minute stale timeout. Hooks live in the contextual sheet ViewModel, suggestions ViewModel, and text-selection repository.

Tests are extended to assert pixel and journey callbacks on attach/remove/limit paths.

Reviewed by Cursor Bugbot for commit f3c8db0. 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 from 73352a5 to af941cf Compare September 9, 2026 23:30
@joshliebe
joshliebe force-pushed the feature/josh/ask-duck-ai-pixels branch from af941cf to f3c8db0 Compare September 9, 2026 23:47
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