Skip to content

[iOS] Implement pixels for fire mode#4437

Open
hassaanelgarem wants to merge 8 commits intomainfrom
hassaan/fire-mode/pixels
Open

[iOS] Implement pixels for fire mode#4437
hassaanelgarem wants to merge 8 commits intomainfrom
hassaan/fire-mode/pixels

Conversation

@hassaanelgarem
Copy link
Copy Markdown
Contributor

@hassaanelgarem hassaanelgarem commented Apr 11, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/project/72649045549333/task/1213299214394241

Description

  • Add 17 new pixels for Fire Mode: promotion shown/dismissed/engaged (NTP and menu), browsing mode switched with source attribution, tab switcher mode toggled (tap/swipe), fire/normal mode burn executed, data cleared (timed), last fire tab closed burn, empty state new tab, and link long-press actions (menu shown, new tab, background tab, fire tab)
  • Add browsing_mode parameter to existing data clearing pixels (forgetAllPressedBrowsing, forgetAllPressedTabSwitching, forgetAllExecuted, singleTabBurnExecuted, singleTabDataCleared and their daily variants) to distinguish fire vs normal mode usage
  • Add browsing_mode parameter to core tab switcher pixels (new tab, switch tabs, close tab, long press, opened daily) and address bar click pixels
  • Add FireModeSwitchSource enum to track how users enter Fire Mode (tab selection, long press tabs icon, NTP/menu promotion, long press link, browsing menu)
  • Add shared PixelParameters.browsingMode constant, BrowsingMode.pixelParamValue helper, and duration shared param in pixel definitions

Testing Steps

  1. Enable Fire Mode feature flag
  2. Open the tab switcher and toggle between Fire and Normal modes via tap — verify m_tab-switcher_mode-toggled fires with source=tap. Swipe between modes — verify same pixel fires with source=swipe
  3. Select a tab after switching modes — verify m_browsing-mode_switched fires with source=tab_selection
  4. Long press the tabs icon and tap "New Fire Tab" — verify m_browsing-mode_switched fires with source=long_press_tabs_icon
  5. Trigger the NTP promotion (burn a tab without having visited Fire Mode) — verify promotion shown/dismissed/engaged pixels fire
  6. Long press a link in normal mode and tap "Open in Fire Tab" — verify m_link-long-press_fire-tab fires
  7. Close the last Fire Tab — verify m_fire-mode_last-tab-closed_burn fires
  8. Tap "New Fire Tab" from the Fire Mode empty state — verify m_fire-mode_empty-state_new-tab fires
  9. Use the Fire button in both modes — verify browsing_mode param appears on mf_bp, mf, and scoped burn pixels

Impact and Risks

Low: Minor visual changes, small bug fixes, improvement to existing features

What could go wrong?

The PR only adds or modifies pixels. The only risk is incorrect mode sent with pixels.

Quality Considerations

N/A

Notes to Reviewer

N/A


Internal references:

Definition of Done | Engineering Expectations | Tech Design Template


Note

Medium Risk
Primarily telemetry changes, but it touches core browsing-mode switching APIs (TabManager.setBrowsingMode) and multiple user interaction paths, so incorrect parameterization or missed call sites could skew analytics or affect mode switching behavior.

Overview
Adds a new Fire Mode pixel set covering NTP/menu promotions, mode switching (with source attribution), tab switcher mode toggles (tap vs swipe), scoped burns/data-clearing, last-fire-tab auto-burn, Fire Mode empty-state actions, and link long-press actions.

Introduces a shared browsing_mode parameter (plus pixelParamValue helpers) and threads it through existing pixels (Fire button flows, tab switcher interactions, address bar click, etc.), while updating timed data-clearing pixels to use the shared durationSeconds/dur parameter definition.

Updates browsing-mode switching to require a FireModeSwitchSource, firing m_browsing-mode_switched whenever the mode actually changes, and adjusts call sites/tests/mocks accordingly.

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

@hassaanelgarem hassaanelgarem requested a review from dus7 April 11, 2026 01:56
@hassaanelgarem hassaanelgarem self-assigned this Apr 11, 2026
@hassaanelgarem hassaanelgarem added the do-not-autoclose Prevents auto-closing by stale PR workflow. label Apr 11, 2026
Comment thread iOS/DuckDuckGo/TabSwitcherViewController.swift
Comment thread iOS/PixelDefinitions/pixels/definitions/fire-mode.json5 Outdated
Comment thread iOS/PixelDefinitions/pixels/definitions/forget_all.json5
"owners": ["dus7", "hassaanelgarem"],
"triggers": ["other"],
"suffixes": ["platform", "form_factor"],
"parameters": ["appVersion", "burnSource", "tabType"]
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.

Boolean-typed params defined as string with enum

Low Severity

The m_automatic_data_clearing_options_updated definition (modified in this PR) has three inline parameters (tabs, data, chats) defined as "type": "string" with "enum": ["true", "false"]. Per review rules, parameters whose enum contains only "true" and/or "false" need to be "type": "boolean" with no enum.

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bugbot

Reviewed by Cursor Bugbot for commit 45b5379. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

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

Comment thread iOS/PixelDefinitions/pixels/params_dictionary.json5
Comment thread iOS/DuckDuckGo/TabManager.swift Outdated
Comment thread iOS/DuckDuckGo/MainViewController.swift
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

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 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

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 b4f9326. Configure here.

case false:
return "normal"
}
}
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.

Redundant Tab.pixelParamValue duplicates BrowsingMode.pixelParamValue

Low Severity

The new Tab.pixelParamValue computed property re-implements the same fireTab"fire"/"normal" mapping that BrowsingMode.pixelParamValue already provides. Since Tab already has a mode property (of type BrowsingMode), the extension body could simply delegate to mode.pixelParamValue instead of duplicating the switch logic. This avoids a maintenance risk if the set of modes ever changes.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b4f9326. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-autoclose Prevents auto-closing by stale PR workflow. privacy review required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant