Skip to content

Pixels: Add unified_input_surface to unified input action pixels - #9306

Merged
karlenDimla merged 1 commit into
developfrom
feature/karl/contextual-nativeinput/new-pixels
Jul 28, 2026
Merged

Pixels: Add unified_input_surface to unified input action pixels#9306
karlenDimla merged 1 commit into
developfrom
feature/karl/contextual-nativeinput/new-pixels

Conversation

@karlenDimla

@karlenDimla karlenDimla commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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

Description

Adds a surface parameter (unifiedInputSurface) to the contextual Unified Input UTI pixels, distinguishing where each pixel was fired from: address_bar, duck_ai, or contextual_chat.

  • Introduces a DuckChatPixelSurface enum with a from(NativeInputState.InputContext) mapping (BROWSER → address_bar, DUCK_AI → duck_ai, DUCK_AI_CONTEXTUAL → contextual_chat).
  • Threads the surface through all Unified Input pixel firing methods (tool select/deselect/submit, model & reasoning pickers, attachments, stop generation, customize responses) so callers pass the originating surface.
  • Registers the new unifiedInputSurface param in params_dictionary.json and adds it to the affected m_aichat_unified_input_* pixel definitions in duck_chat.json5.
  • Updates the ViewModels (attachments, native input mode widget, model/reasoning/options pickers) to supply the current surface when firing pixels.

Steps to test this PR

  1. Address bar (surface=address_bar)
  • Open the Unified Input from the address bar / omnibar
  • Toggle a tool (web search / image generation), open the model picker, and attach/remove an image
  • Each fired m_aichat_unified_input_* pixel includes surface=address_bar
  1. Duck.ai tab (surface=duck_ai)
  • Repeat the same interactions from the dedicated Duck.ai tab
  • Each fired pixel includes surface=duck_ai
  1. Contextual chat sheet (surface=contextual_chat)
  • Open the contextual chat sheet over a web page
  • Repeat the same interactions
  • Each fired pixel includes surface=contextual_chat

Note

Low Risk
Analytics-only pixel schema and firing changes with no auth, data handling, or user-facing behavior changes.

Overview
Unified Input analytics now record where an interaction happened by adding a surface parameter (address_bar, duck_ai, or contextual_chat) to the relevant m_aichat_unified_input_* pixel definitions and wiring it through the app.

A DuckChatPixelSurface enum maps NativeInputState.InputContext to those values; DuckChatPixels APIs for tools, prompts, model/reasoning pickers, attachments, stop generation, customize responses, and FE recovery flows now require a surface and send it as surface on the wire. ViewModels derive the current surface from native input state when firing pixels. unifiedInputSurface is registered in params_dictionary.json. Unit tests were updated to expect the new parameter.

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

Copy link
Copy Markdown
Contributor Author

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

@github-actions

Copy link
Copy Markdown
Contributor

Privacy Review task: https://app.asana.com/0/69071770703008/1216913713452942

Adds a `surface` parameter (address_bar / duck_ai / contextual_chat) to the
Unified Toggle Input telemetry pixels so usage in the contextual chat sheet
can be told apart from the Duck.ai tab and the address bar. The value is
derived from NativeInputState.InputContext at each firing site.

Ports the surface changes from apple-browsers#5779. Placeholder pixels are
kept (the Android placeholder chip still exists) and voice_tapped is left
unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@karlenDimla
karlenDimla force-pushed the feature/karl/contextual-nativeinput/new-pixels branch from f8141b0 to 3720d32 Compare July 27, 2026 16:24

@joshliebe joshliebe 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.

Tested! "surface" sent as expected ✅

@karlenDimla
karlenDimla merged commit ddd403c into develop Jul 28, 2026
40 of 44 checks passed
@karlenDimla
karlenDimla deleted the feature/karl/contextual-nativeinput/new-pixels branch July 28, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants