Add ad-blocking browser menu logic#9154
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. |
ef14862 to
8889335
Compare
109762a to
6357404
Compare
cmonfortep
left a comment
There was a problem hiding this comment.
LGTM
I've additionally tested the menu on duck.ai and custom tab.
6357404 to
08f2bda
Compare
e0694b3 to
264b921
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 264b921. Configure here.
| when (menuState) { | ||
| AdBlockingMenuState.Disabled -> menuController.enable() | ||
| else -> showMenuBottomSheet() | ||
| } |
There was a problem hiding this comment.
Stale menu state misroutes clicks
Medium Severity
menuState defaults to Hidden and the click handler treats anything that is not Disabled as “show the bottom sheet.” Until the first observe emission updates menuState, a tap on “Enable YouTube Ad Blocking” can open the disable sheet instead of calling menuController.enable(), and a briefly visible row can accept taps when the item should stay hidden.
Reviewed by Cursor Bugbot for commit 264b921. Configure here.



Task/Issue URL:
Tech Design URL (if applicable):
Description
Add logic to browser menu entry
Steps to test this PR
UX improvements RC flag disabled - no menu entry
adBlockingExtension RC flag disabled, UX improvements RC flag enabled - no menu entry
adBlockingExtensionand enableadBlockingUXImprovementsflagsUX improvements RC flag enabled - menu entry on YT pages - test enable
adBlockingExtensionandadBlockingUXImprovementsRC flagUX improvements RC flag enabled - menu entry on YT pages - test disable until relaunch
UX improvements RC flag enabled - menu entry on YT pages - test disable
UX improvements RC flag enabled - no menu entry on non-YT pages
UI changes
Note
Medium Risk
Changes when ad blocking injects and how user vs session overrides interact with persisted settings; mistakes could leave blocking on/off unexpectedly, though scope is limited to the ad-blocking module with solid test coverage.
Overview
Adds YouTube browser menu behavior: when ad blocking is off, a tap turns it on without a sheet; when on, a bottom sheet offers Always On, Disable Until Relaunch, and Always Off, with checkmarks for the active option.
Disable until relaunch is a new in-memory
AdBlockingSessionStoreoverride that turns off injection for the current process without changing persisted settings; it clears on app kill or when the user picks Always On/Off or toggles in settings.AdBlockingStatenow distinguishes permanent disable vs until relaunch, andAdBlockingStatusChecker/ injection gating honor that session flag ahead of stored prefs.Settings v2 swaps to a two-line toggle with “Disabled until relaunch” while the session override is active, and
AdBlockingMenuControllercentralizes applying menu choices to the repository and session store.Reviewed by Cursor Bugbot for commit 264b921. Bugbot is set up for automated code reviews on this repo. Configure here.