Skip to content

Fire mode: Escape hatch#8917

Open
0nko wants to merge 12 commits into
feature/ondrej/fire-mode-dialogfrom
feature/ondrej/fire-mode-escape-hatch
Open

Fire mode: Escape hatch#8917
0nko wants to merge 12 commits into
feature/ondrej/fire-mode-dialogfrom
feature/ondrej/fire-mode-escape-hatch

Conversation

@0nko

@0nko 0nko commented Jun 18, 2026

Copy link
Copy Markdown
Member

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

Description

This PR adds the Fire mode support to escape hatch.

Steps to test this PR

Prerequisites

  • Internal build with androidBrowserConfig.showNTPAfterIdleReturn enabled (feature-flag inventory).
  • Settings → General → After inactivity → Choose an inactivity interval → Always (immediate), and set what you see to New Tab Page.
  • fireMode.fireTabs enabled for scenarios 1–5; disabled for scenario 6.
  • Cold-start note: a quick swipe-and-reopen often keeps the process alive (a warm start). For a true cold start, force-stop the app (App info → Force stop, or adb shell am force-stop com.duckduckgo.mobile.android.debug) before relaunching.

1. Cold start — last tab was a Regular tab

  • Open a Regular tab on a real site (e.g. example.com); background it.
  • Cold start the app.
  • Expect: opens in Regular mode on the NTP with a "Return to… <site>" hatch; tapping it returns to that tab.

2. Cold start — last tab was a Fire tab

  • Enter Fire mode, open a Fire tab on a site / Duck.ai chat.
  • Cold start the app.
  • Expect: opens in Regular mode; the hatch shows "Last used Fire Tab" with the fire placeholder icon, and never the Fire tab's real title/URL/favicon (privacy).
  • Tap the hatch → switches into Fire mode and opens that exact Fire tab — not a new/blank Fire tab.

2b. Cold start — Fire tab, returned from the search / input screen

  • Repeat scenario 2's setup (cold start with the last-used tab being a Fire tab).
  • On the Regular-mode NTP, tap the address bar / search to open the input screen — the same "Last used Fire Tab" hatch appears there.
  • Tap it → switches into Fire mode and opens that exact Fire tab (not a new/blank Fire tab).

3. Hot start in Fire mode

  • In Fire mode, background the app, then reopen (warm — don't kill the process).
  • Expect: a new Fire tab opens, with no escape hatch.

4. Hot start in Regular mode

  • In Regular mode, background the app, then reopen.
  • Expect: existing behavior — the hatch returns to the last Regular tab.

5. Fire-target hatch controls

  • On the Fire-target hatch (scenario 2), overflow ⋮ → Close Tab removes the Fire tab; Undo restores it. (Known: the 🔥 burn button is a no-op for Fire tabs for now, pending cross-mode single-tab clearing.)

6. fireTabs OFF reverts cleanly

  • Disable the flag in the internal feature-flag inventory (dev settings → Feature flags → fireMode → turn off fireTabs), then fully restart the app (Fire-mode availability is cached per process).
  • Repeat scenario 2's setup.
  • Expect: the hatch behaves like the previous Regular-only escape hatch — no "Last used Fire Tab"; only Regular tabs are offered.

Note

Medium Risk
Changes browser mode switching, first-screen/launch behavior after activity recreate, and cross-repo tab lifecycle; privacy behavior for Fire targets is intentional but must stay correct under edge cases (flag off, Fire mode active, stale idle state).

Overview
Extends the after-idle “Return to…” escape hatch so it can offer the user’s most recently used tab across Regular and Fire (when fireTabs is available), not just the last Regular tab.

A new EscapeHatchTargetResolver picks the winner by last-access time and returns tab id + owning BrowserMode. The hatch UI shows “Last used Fire Tab” with a fire placeholder for Fire targets and does not surface Fire tab title, URL, or favicon in Regular-mode UI. Close/undo/commit for the hatch routes tab mutations to the correct mode’s TabRepository.

Tapping the hatch (NTP or input screen) now goes through openExistingTabInMode, which stashes PendingAction.OpenExistingTab across activity recreate via the existing switchModeThen / PendingModeSwitch bundle path. The input screen result adds TAB_MODE_PARAM alongside tab id.

ModeSwitchRecreateSignal marks programmatic mode-switch recreates so FirstScreenHandler skips launch/inactivity handling that would otherwise inject an extra NTP and override the deferred open-tab action. ShowOnAppLaunchOptionHandler is updated to respect current mode (e.g. no Regular-only “specific page” / LUT analytics in Fire; NTP-after-idle hatch classification only in Regular).

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

0nko and others added 10 commits June 18, 2026 10:09
…s-mode tab opening

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…get tab mode

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…o the right tab database

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ns to its target tab

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

0nko commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

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.
Learn more

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 f5eb9c6. Configure here.

Comment thread app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
@0nko 0nko requested a review from CDRussell June 18, 2026 20:27
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