Add pixel for max tab reuse distance - #9755
Merged
catalinradoiu merged 3 commits intoSep 11, 2026
Merged
Conversation
Reports, once per foreground session, the furthest a user went back in the tab activation order, bucketed, alongside a bucketed open tab count. That distance is the condition that decides whether a tab would still be retained at a given fragment limit, so it sizes the UX cost of lowering MAX_ACTIVE_TABS before the limit is changed. Gated behind the tabManager.tabMaxReuseDistancePixel sub-feature, off by default, with the parent toggle checked explicitly. https://app.asana.com/1/137249556945/project/1211724162604201/task/1214069186174646 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
Privacy Review task: https://app.asana.com/0/69071770703008/1218312506872025 |
0nko
approved these changes
Sep 9, 2026
0nko
left a comment
Member
There was a problem hiding this comment.
Things worked as expected when testing, but I did notice that opening any activity constitutes an "end of session" and the pixel is sent. There's an implication to this because the max distance counter is reset to 0, so if you keep moving between screens like the settings or the tab switcher, you're technically in the same "session" but the reported data is artificially lower.
However, I guess it really comes down to what a "session" means and if we accept this behavior then I guess it's fine, so I'll approve. Maybe we should update the pixel definition description to capture that, though.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Task/Issue URL: https://app.asana.com/1/137249556945/project/1211724162604201/task/1214069186174646
Tech Design URL (if applicable):
API Proposals URL(s) (if applicable): None
Description
Adds a pixel that reports, once per foreground session, the furthest a user went back in the tab activation order (the tab reuse distance), bucketed, alongside a bucketed count of currently open tabs. This distance is the condition that decides whether a given tab would still be retained if the fragment retention limit (
MAX_ACTIVE_TABS) were lowered, so the pixel sizes the UX cost of doing that before the limit is actually changed.The pixel is gated behind the
tabManager.tabMaxReuseDistancePixelsub-feature, off by default, with the parenttabManagertoggle checked explicitly at the call site.Steps to test this PR
Feature 1: Tab reuse distance pixel fires once per foreground session
tabManager.tabMaxReuseDistancePixelsub-feature (and ensure the parenttabManagerfeature is enabled)Feature 2: Pixel stays off when the sub-feature is disabled
tabManager.tabMaxReuseDistancePixeldisabled (default)UI changes
Note
Low Risk
Analytics-only path behind feature flags; tab pager wiring adds hooks on activation/pause with no user-facing behavior changes.
Overview
Adds
tab_max_reuse_distancetelemetry to measure how far users jump back in tab activation order before revisiting a tab—aligned with the same “distinct other tabs since last active” notion used for fragment retention underMAX_ACTIVE_TABS.A new activity-scoped
TabReuseDistanceReportertracks activations (viaonItemPlacedon the tab pager adapter), tab closes, and open-tab count; onBrowserActivity.onPauseit fires one bucketed pixel per foreground stretch (distance_bucket,tab_count_bucket) when the user actually returned to an earlier tab. Reporting is gated bytabManagerand the newtabMaxReuseDistancePixelsub-toggle (default off). Pixel schema,AppPixelName, and unit tests cover bucketing, session reset on pause, removals, and toggle behavior.Reviewed by Cursor Bugbot for commit 6763e10. Bugbot is set up for automated code reviews on this repo. Configure here.