Skip to content

Fire Mode: Burn Fire mode after last tab#9105

Open
0nko wants to merge 4 commits into
developfrom
feature/ondrej/fire-mode-last-fire-tab-burn
Open

Fire Mode: Burn Fire mode after last tab#9105
0nko wants to merge 4 commits into
developfrom
feature/ondrej/fire-mode-last-fire-tab-burn

Conversation

@0nko

@0nko 0nko commented Jul 3, 2026

Copy link
Copy Markdown
Member

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

Description

This PR implements automatic Fire mode data clearing after the last Fire mode tab is closed.

Steps to test this PR

Burn Fire data when the last Fire tab is closed

  • Open the tab switcher and switch to Fire mode
  • Open one or more Fire tabs, log in to a site (or accept cookies), and send at least one Duck.ai message in Fire mode
  • Close Fire tabs until one remains, then close the last one (X button or swipe)
  • Confirm you return to Regular mode with the tab switcher still open (no undo snackbar)
  • Switch back to Fire mode and confirm there are no previous Fire tabs
  • Revisit the site (logged out, cookies gone) and open Duck.ai (previous Fire chat history gone)

Burn Fire data when closing all Fire tabs at once

  • In Fire mode with several tabs plus a site login and a Duck.ai chat, open the overflow menu and choose "Close all tabs", then confirm
  • Confirm you return to Regular mode with the tab switcher still open, and that Fire tabs, browsing data, and Duck.ai chats are all cleared

Regular data is untouched

  • Have Regular tabs open and be logged in to a site in Regular mode before burning Fire data
  • After the Fire burn, confirm the Regular tabs and the Regular login/cookies are still there

No burn on a manual mode switch

  • In Fire mode with tabs and data, manually switch Fire to Regular and back to Fire
  • Confirm the Fire tabs, browsing data, and Duck.ai chats are still present

No burn when closing a non-last Fire tab

  • In Fire mode with 2 or more tabs, close a tab that is not the last one
  • Confirm you stay in Fire mode and the remaining tabs and data are intact

Regular automatic clearing is not disturbed

  • In Settings, enable automatic data clearing
  • Trigger a Fire burn by closing the last Fire tab, then background and relaunch the app as required by the setting
  • Confirm the Regular automatic clear still runs as configured

Note

Medium Risk
Touches Fire-mode data deletion and automatic-clear flag timing; scope is limited to emptying Fire tabs and app-scope clearing, with tests covering manual toggle vs tab-empty paths.

Overview
When Fire mode has no tabs left because the user closed the last tab or confirmed close all, the tab switcher no longer only switches to Regular mode—it kicks off a Fire data burn (tabs, browsing data, Duck.ai chats for Fire), keeps the switcher open, and still issues SwitchToRegularMode (no undo snackbar on that path).

The burn runs on appCoroutineScope so it is not cancelled when the Fire→Regular switch recreates the activity. It is wrapped in DataClearingWideEvent with a new entry point FIRE_TABS_EMPTIED. onBrowserModeToggled is unchanged for clearing: toggling modes with Fire tabs still present does not burn.

DataClearing: setAppUsedSinceLastClearFlag now runs only on the Regular manual-clear branch, not after Fire manual clears (including restart and no-restart paths). Tests were updated for Fire burns and tab-switcher behavior.

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

0nko and others added 2 commits July 3, 2026 21:57
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

0nko commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@0nko 0nko requested a review from CDRussell July 3, 2026 20:27
NONGRANULAR_FIRE_DIALOG("nongranular_fire_dialog"),
SINGLE_TAB_FIRE_DIALOG("single_tab_fire_dialog"),
APP_SHORTCUT("app_shortcut"),
FIRE_TABS_EMPTIED("fire_tabs_emptied"),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmac012 There is a new "entry point" in data clearing when the last Fire tab causes a Fire mode data clearing. I added it to the wide event. What do you think?

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