Report the toggle's default side on unified input submissions - #9467
Conversation
3b0bb7a to
9990897
Compare
9990897 to
4df9d5e
Compare
|
Privacy Review task: https://app.asana.com/0/69071770703008/1217412308253518 |
malmstein
left a comment
There was a problem hiding this comment.
Reviewed statically, stacked PR so no CI APK and the change is telemetry only.
Clean and well-tested. The Flow to StateFlow narrowing through the datastore and repository is the right enabler for a synchronous read, and resolvedTogglePosition() collapses the default plus last-used resolution that NativeInputModeWidget was duplicating inline. Verified the definitions line up: default_mode and toggle_visible on m_aichat_experimental_omnibar_query_submitted_count, default_mode on both unified input prompt pixels, nothing declared for the daily omnibar pixel which fires without params. Both params are bounded, no PII or high cardinality. Good call gating default_mode to the address bar surface, with a test and a comment saying why.
Two non-blocking things inline, the more interesting one being that toggle_visible is derived from a looser predicate than the toggle's own visibility rule.
8d8b148 to
43e0447
Compare
4df9d5e to
c915451
Compare
5a49c9e to
c57bbe5
Compare
43e0447 to
b01daee
Compare
c57bbe5 to
fd1766d
Compare
b01daee to
344781c
Compare
fd1766d to
ee8d10a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 ee8d10a. Configure here.


Task/Issue URL: https://app.asana.com/1/137249556945/task/1217374913029750?focus=true
Tech Design URL (if applicable):
API Proposals URL(s) (if applicable):
Description
Adds
default_modeto the prompt and query submission pixels, andtoggle_visibleto the query pixel, so when the user stays on the default tab and submits, it can be told apart from a switch tab before submission.Also fixes a bug where the configured default was not applying properly in some cases because the resolver was reading from a cache and not from the repository.
m_aichat_unified_input_prompt_submitted_count/_dailydefault_modem_aichat_experimental_omnibar_query_submitted_count/_dailydefault_mode,toggle_visibledefault_modeissearchorduck_ai, and is omitted when no toggle was offered;toggle_visible=falsemarks those. Comparingdefault_modeagainst which pixel fired gives accepted-versus-switched graph.DuckChatInternal.resolvedTogglePosition()is the single definition resolved on which side the input opens on. Thepixel layer reads it, and the widget now calls the same method to pick its initial tab.
Steps to test this PR
Enable Search + Duck.ai so the unified input shows both tabs, and watch logcat filtered on
Pixel sent:.Accepting the default
m_aichat_experimental_omnibar_query_submitted_countcarriesdefault_mode=search,toggle_visible=truem_aichat_unified_input_prompt_submitted_countcarriesdefault_mode=duck_aiSwitching from the default
m_aichat_experimental_omnibar_query_submitted_countmust carrydefault_mode=duck_aisince that was the defaultdefault_mode=searchLast used
default_mode=duck_ai(It was the last used so the default)No toggle offered
nativeInputSearchOnlyfeature flagtoggle_visible=falseand nodefault_modeNothing else changed
text_length_bucket,selected_tool,model_idand the attachment params are unchangedUI changes
None
Note
Low Risk
Changes are limited to analytics parameters and toggle-default resolution for UI/pixels; no auth, sync, or submission behavior changes beyond where pixels fire.
Overview
Adds analytics on unified native input submissions so product can see whether users stayed on the Search/Duck.ai default tab or switched before submitting.
Pixels:
default_mode(search/duck_ai) is added to omnibar query and unified prompt submission events; omnibar query also getstoggle_visible. Both are omitted when the toggle is hidden (toggle_visible=false);default_modeis only sent for the address-bar surface on prompt submission.Resolution:
DuckChatInternal.resolvedTogglePosition()centralizes resolving user settings (including Last used) to a concrete side. Toggle position observers now exposeStateFlowso resolution reads live repository values instead of stale cache. The omnibar widget uses the same resolver for its initial tab instead of duplicating flow logic.Telemetry routing: Omnibar query pixels fire from the widget/view model path (removed from
MetricsNativeInputEventListener.onSearchSubmitted).Reviewed by Cursor Bugbot for commit 85ce321. Bugbot is set up for automated code reviews on this repo. Configure here.