Commit 2908a38
authored
Fire Mode: Add BrowserMode with plumbing (#8478)
Task/Issue URL:
https://app.asana.com/1/137249556945/project/1207418217763355/task/1214579513091724?focus=true
### Description
This PR adds the new `BrowserMode` and the related interfaces and their
concrete implementations:
- `BrowserModeStateHolder` that exposes enum class `BrowserMode {
REGULAR, FIRE }`, which is the single source of truth for current mode.
Theming overlay, tab switcher VM, mode-toggle pill, sync entry points,
repository providers — all observe this Flow.
- Adds `FireModeAvailability` that checks the feature flag and the
WebView feature support
- Adds `BrowserMode` plumbing to the main entry points
Related API proposal:
https://app.asana.com/1/137249556945/project/1207418217763355/task/1214579944546013?focus=true
### Steps to test this PR
Smoke testing that the app is launched correctly and opening an external
link works as expected is sufficient.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Touches core `BrowserActivity` intent processing and tab creation,
adding mode-based recreation and deferred-intent handling which could
affect external link/widget/shortcut launches. New mode plumbing is
guarded by availability checks but has broad surface area across entry
points.
>
> **Overview**
> Introduces a new cross-module `BrowserMode` concept (`REGULAR`/`FIRE`)
with a `BrowserModeStateHolder` source-of-truth and an app
implementation (`RealBrowserModeStateHolder`).
>
> Updates `BrowserActivity` and tab creation to be mode-aware
(adapter/`BrowserTabFragment` arguments, DuckChat fragment args), and
recreates the activity on mode changes; external entry-point intents can
now be stamped as `LAUNCH_REQUIRES_REGULAR_MODE` and, if received while
in `FIRE`, are deferred across a FIRE→REGULAR switch before processing.
>
> Adds a new `fire-mode-api`/`fire-mode-impl` with
`FireModeAvailability` (feature flag + WebView MultiProfile capability),
wires it into `BrowserViewModel.switchToMode`, and updates numerous
launch points (widgets, shortcuts, onboarding/settings/internal screens,
tests) to pass a `BrowserLaunchSource` and correctly stamp intents.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
2f0669e. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 74936c7 commit 2908a38
45 files changed
Lines changed: 823 additions & 40 deletions
File tree
- app
- src
- androidTest/java/com/duckduckgo/espresso
- privacy
- internal/java/com/duckduckgo/app
- audit
- dev/settings
- main/java/com/duckduckgo
- app
- about
- browser
- mode
- shortcut
- tabs/adapter
- webview
- dispatchers
- fire
- global/shortcut
- launch
- notification/model
- onboarding/ui
- settings
- systemsearch
- widget
- test/java/com/duckduckgo/app/browser
- mode
- browser-api/src/main/java/com/duckduckgo/browser/api/mode
- duckchat/duckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/ui
- fire-mode
- fire-mode-api
- src/main/java/com/duckduckgo/firemode/api
- fire-mode-impl
- src
- main/java/com/duckduckgo/firemode/impl
- test/kotlin/com/duckduckgo/firemode/impl
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| 423 | + | |
423 | 424 | | |
424 | 425 | | |
425 | 426 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | | - | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
142 | | - | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
0 commit comments