Fire Mode: Toggle switch#8606
Conversation
|
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
27e1503 to
a162357
Compare
d3785f2 to
851fb5d
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 851fb5d. Configure here.
| firstTimeLoadingTabsList = false | ||
| scrollToActiveTab() | ||
| scrollToActiveTabOnNextUpdate = false | ||
| scrollToActiveTab(it.tabSwitcherItems) |
There was a problem hiding this comment.
Race between mode and viewState collectors may skip scroll
Low Severity
The shouldScroll boolean is captured eagerly, but scrollToActiveTabOnNextUpdate is set in a separate coroutine (the browserMode collector). If viewState emits via collectLatest before the browserMode collector processes the same upstream mode change, shouldScroll captures false and the callback resets nothing. However, the opposite timing is also possible: the browserMode collector fires first, sets the flag to true, and then a stale viewState emission (from combine reacting to the tabSwitcherData input changing before tabSwitcherItemsFlow debounce completes) consumes the flag and scrolls using the old mode's item list — then the actual new-mode emission arrives with scrollToActiveTabOnNextUpdate already reset to false, missing the intended scroll.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 851fb5d. Configure here.
|
Shared details offline, but here too for tracking work to do. noticed a
|
CDRussell
left a comment
There was a problem hiding this comment.
Flagged a few things, approving on the assumption they are all addressed (and because it's still behind FF)





Task/Issue URL: https://app.asana.com/1/137249556945/project/1207418217763355/task/1214876625000225?focus=true
Description
Adds the Fire/Regular toggle to the tab switcher toolbar. The pill replaces the title, holds the regular tab count (∞ at 100+), slides on tap or drag, and switches
BrowserModeStateHolderon release.BrowserActivityreacts by recreating itself.Steps to test this PR
Toggling between modes
fireTabsFF in internal dev settingsBrowser vs tab switcher consistency
Selection
Scrolling
Tab count
Fallback
fireTabsin internal settings and relaunchNote
Medium Risk
Changes browser-mode switching and state restoration behavior by clearing/restoring fragment/ViewModel state on mode changes, which could impact tab/webview restoration and navigation edge cases.
Overview
Adds a new Fire/Regular segmented toggle to the tab switcher toolbar (tap or drag), including showing the regular tab count with an ∞ overflow display.
Tab switching no longer relies on a passed
selectedTabId; the tab switcher now auto-scrolls to the active tab on first load and after mode changes, andTabSwitcherViewModelcan switchBrowserModeStateHolderwhen the user toggles.Hardens
BrowserActivityrecreation on browser-mode changes by persisting the last saved mode, stripping restored tab pager state when the mode differs, and synchronously removing staleBrowserTabFragments after restore to prevent wrong-mode webviews from being shown.Reviewed by Cursor Bugbot for commit 851fb5d. Bugbot is set up for automated code reviews on this repo. Configure here.