Skip to content

Conversation

@0nko
Copy link
Member

@0nko 0nko commented Dec 15, 2025

Task/Issue URL: https://app.asana.com/1/137249556945/project/1207418217763355/task/1212229354973651?focus=true

Description

This PR adds a new granular fire bottom sheets, which shows the new granular option toggles allowing to select what data to clear.

Steps to test this PR

Feature flag disabled

  • On a fresh install, the feature flag is disabled by default
  • Launch the fire dialog
  • Verify the old fire dialog is displayed
  • Verify it works

For the following test steps, make sure you enable the moreGranularDataClearingOptions flag in the developer settings!

Tab Count Display

  • Open several tabs (e.g., 5 tabs)
  • Open the fire dialog
  • Verify the Tabs subtitle shows "Close all 5 tabs"
  • Select the tabs for clearing
  • Clear the data
  • After data is cleared open the fire dialog
  • Verify the subtitle says "Close 1 tab"

Data/History Count Display

With History Enabled:

  • Make sure history is enabled (Settings -> General -> Recently visited sites enabled)
  • Visit 2 different websites
  • Open the fire dialog
  • Verify the Data option shows site count 3
  • Clear your history and verify it shows "0 sites visited"

With History Disabled:

  • Make sure history is disabled (Settings -> General -> Recently visited sites disabled)
  • Open the fire dialog
  • Verify the Data subtitle shows "May sign you out of accounts."

With no History:

  • Make sure history is enabled (Settings -> General -> Recently visited sites enabled)
  • With no history, open the fire dialog
  • Verify the Data subtitle shows "None"

Duck.ai Chats Option Visibility

When DuckAI was never opened:

  • On a fresh install or cleared state, open the fire dialog
  • Verify the "Duck.ai Chats" option is NOT visible

When Duck.ai was opened before:

  • Open DuckAI chat at least once
  • Open the fire dialog
  • Verify the "Duck.ai Chats" option IS visible

Feature 6: Selective Data Clearing

Tabs Only:

  • Open 3-5 tabs
  • Open the fire dialog, select only "Tabs", click Delete
  • Open the fire dialog again and check that only tabs were cleared
  • Verify all tabs are closed
  • Verify other data (cookies, history) remains intact

Data Only:

  • Visit several websites
  • Open the fire dialog, select only "Data", click Delete
  • Verify app restarts
  • Verify browsing data is cleared (cookies, cache, history)
  • Verify tabs remain open

Duck.ai Chats Only:

  • Have some Duck.ai chat history
  • Open the fire dialog, select only "Duck.ai Chats", click Delete
  • Verify app restarts
  • Verify Duck.ai chat history is cleared
  • Verify tabs and browsing data remain

Choice Preservation

  • Open the fire dialog and select all options
  • Close the fire dialog and reopen it
  • Verify all options remain preselected
  • Uncheck all options, close and open the fire dialog again
  • Verify all options remain unselected

Other Launch Points

  • Launch the fire dialog from the Tab switcher
  • Verify the new dialog is shown
  • Launch the fire dialog from the Data Clearing settings
  • Verify the new dialog is shown

UI changes

Before After
image image

Note

Adds a fragment-based Fire dialog with granular clearing options (Tabs/Data/Duck.ai) selected via feature flag, refactors legacy dialog, updates activities to use it, and adds resources and tests.

  • Fire Dialog architecture:
    • Introduce FireDialog interface and FireDialogProviderImpl that picks GranularFireDialog or LegacyFireDialog via moreGranularDataClearingOptions.
    • Migrate dialogs to BottomSheetDialogFragment with fragment result events (onShow, onCancel, onClearStarted).
  • Granular clearing UI/logic:
    • Add GranularFireDialog and layout sheet_fire_clear_data_granular.xml with toggles for Tabs, Cookies and Site Data, and Duck.ai Chats.
    • Add GranularFireDialogViewModel handling option state, history/site counts, Duck.ai visibility, pixels, and clearing flow.
    • Add LegacyFireDialog fragment (parity with old behavior), now emitting events and handling animation/restart.
  • Call site updates:
    • Update BrowserActivity, FireButtonActivity, and TabSwitcherActivity to create dialogs via fireDialogProvider.createFireDialog() and show with supportFragmentManager; add event listener in BrowserActivity.
  • Storage/utility:
    • Extend WebLocalStorageManager with boolean-based clearWebLocalStorage(shouldClearBrowserData, shouldClearDuckAiData); legacy path now delegates with defaults.
    • Add DateProvider for daily pixel timestamping.
  • Resources/Assets:
    • Add drawables (img_fire_96, rounded_top_corners_bottom_sheet_background, background_large_rounded_surface, ic_cookie_24) and strings/plurals for granular UI.
  • Tests:
    • Add GranularFireDialogViewModelTest covering state, commands, pixels, and clearing order.

Written by Cursor Bugbot for commit d169c4f. This will update automatically on new commits. Configure here.

Copy link
Member Author

0nko commented Dec 15, 2025

@0nko 0nko mentioned this pull request Dec 15, 2025
1 task
@0nko 0nko requested review from CDRussell and removed request for malmstein and mikescamell December 15, 2025 23:00
@0nko 0nko force-pushed the feature/ondrej/fire-dialog-bottom-sheet branch from 8f77f12 to 90c83b6 Compare December 15, 2025 23:33
@0nko 0nko force-pushed the feature/ondrej/fire-dialog-bottom-sheet branch from 90c83b6 to be6aad9 Compare December 16, 2025 00:31
@CDRussell CDRussell self-assigned this Dec 16, 2025
@CDRussell
Copy link
Member

CDRussell commented Dec 16, 2025

@0nko, flagging some discrepencies between testing steps expectations and what I see:

Verify the Tabs subtitle shows "Clear all 5 tabs"
it shows "Close all 5 tabs" (just checking that's the desired outcome)

Verify the subtitle says "Clear 1 tab"
it shows "Close 1 tab"

@CDRussell
Copy link
Member

There are some failing checks, but overall works well and looks good to me! 👍

@0nko 0nko force-pushed the feature/ondrej/fire-dialog-bottom-sheet branch from be6aad9 to 3e4ca6f Compare December 16, 2025 12:31
@0nko 0nko force-pushed the feature/ondrej/fire-dialog-data-clearing-interface branch from 9a4ca65 to 920fef0 Compare December 16, 2025 12:31
@0nko 0nko force-pushed the feature/ondrej/fire-dialog-bottom-sheet branch from 3e4ca6f to 75d9559 Compare December 17, 2025 15:15
@0nko 0nko force-pushed the feature/ondrej/fire-dialog-data-clearing-interface branch from 920fef0 to 86ce114 Compare December 17, 2025 15:15
@0nko 0nko force-pushed the feature/ondrej/fire-dialog-bottom-sheet branch from fa87264 to fd2d97e Compare December 17, 2025 18:34
@0nko 0nko force-pushed the feature/ondrej/fire-dialog-data-clearing-interface branch from 86ce114 to 1a61594 Compare December 17, 2025 18:34
@0nko 0nko mentioned this pull request Dec 17, 2025
1 task
Base automatically changed from feature/ondrej/fire-dialog-data-clearing-interface to develop December 18, 2025 13:00
@0nko 0nko force-pushed the feature/ondrej/fire-dialog-bottom-sheet branch from 1aba857 to 4ad8d08 Compare December 18, 2025 13:05
@0nko 0nko merged commit 849f5cd into develop Dec 18, 2025
10 checks passed
@0nko 0nko deleted the feature/ondrej/fire-dialog-bottom-sheet branch December 18, 2025 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants