Commit b5302d5
authored
SERP Settings Sync: Align feature flag names with other platforms (#7159)
Task/Issue URL:
https://app.asana.com/1/137249556945/project/1207908166761516/task/1211978534005008?focus=true
### Description
This pull request refactors feature flag usage across the browser and
DuckChat modules by replacing references to `SettingsPageFeature` with
the new `SerpSettingsFeature` interface, and introduces a new toggle for
controlling the visibility of the "Hide AI Generated Images" option in
DuckChat settings.
**Feature flag refactoring:**
* Replaced all usages of `SettingsPageFeature` with
`SerpSettingsFeature` in `BrowserTabViewModel`,
`DuckDuckGoRequestRewriter`, dependency injection (`BrowserModule`), and
related test files to standardize feature flag handling for SERP
settings.
* Updated constructor parameters and usages in affected classes and test
setups to use `SerpSettingsFeature` instead of `SettingsPageFeature`.
* Modified logic to use `storeSerpSettings()` from `SerpSettingsFeature`
in place of `serpSettingsSync()` from `SettingsPageFeature` for feature
checks.
**DuckChat settings improvements:**
* Added a new toggle `showHideAiGeneratedImages()` to `DuckChatFeature`
to control visibility of the "Hide AI Generated Images" option in AI
Features Settings. Updated `DuckChatSettingsViewModel` to use this
toggle for UI logic and navigation.
**Test updates:**
* Updated all affected unit tests to use `SerpSettingsFeature` for
feature flag mocking and assertions, ensuring consistency and coverage
for the new interface and toggle.
### Steps to test this PR
_Hide AI Generated Images Toggle_
- [x] Enable `showHideAiGeneratedImages` feature toggle
- [x] Open Settings -> AI Features
- [x] Check AI-Generated Images option is visible
- [x] Click it
- [x] SERP Settings should open
- [x] Disable `showHideAiGeneratedImages` feature toggle
- [x] Open Settings -> AI Features
- [x] Check AI-Generated Images option is **NOT** visible
_storeSerpSettings Toggle_
- [x] Clear data and launch app
- [x] Enable `storeSerpSettings` feature toggle
- [x] Navigate to "Duck AI Testing url" listed
[here](https://app.asana.com/1/137249556945/project/1207908166761516/task/1212002071627290?focus=true)
- [x] Do a search e.g. "FPL"
- [x] Filter logs for "SERP-SETTINGS"
- [x] Check `IsNativeDuckAiEnabledHandler` has fired
- [x] Open Settings
- [x] Press back
- [x] In the logs `SubscriptionEventData` should be sent
- [x] Click SERP settings cog
- [x] Click "Manage" by "AI Features"
- [x] Click "Open Duck.ai Settings"
- [x] Check logs for "OpenNativeSettingsHandler" and native AI Features
screen should open
- [x] Navigate to "SERP Settings Testing URL"
- [x] Do a search e.g. "FPL"
- [x] Check GetNativeSettingsHandler fires
- [x] Check UpdateNativeSettingsHandler fires
### UI changes
N/A1 parent 6b4648f commit b5302d5
File tree
23 files changed
+175
-97
lines changed- app/src
- androidTest/java/com/duckduckgo/app/browser
- main/java/com/duckduckgo/app/browser
- di
- test/java/com/duckduckgo/app/browser
- duckchat/duckchat-impl/src
- main/java/com/duckduckgo/duckchat/impl
- feature
- messaging
- ui/settings
- test/kotlin/com/duckduckgo/duckchat/impl
- messaging
- ui/settings
- settings
- settings-api/src/main/java/com/duckduckgo/settings/api
- settings-impl/src
- main/java/com/duckduckgo/settings/impl
- serpsettings
- messaging
- test/java/com/duckduckgo/settings/impl
- serpsettings/messaging
23 files changed
+175
-97
lines changedLines changed: 6 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
| |||
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
626 | | - | |
627 | 626 | | |
628 | 627 | | |
629 | | - | |
| 628 | + | |
630 | 629 | | |
631 | 630 | | |
632 | 631 | | |
| |||
864 | 863 | | |
865 | 864 | | |
866 | 865 | | |
867 | | - | |
| 866 | + | |
868 | 867 | | |
869 | 868 | | |
870 | 869 | | |
| |||
7924 | 7923 | | |
7925 | 7924 | | |
7926 | 7925 | | |
7927 | | - | |
| 7926 | + | |
7928 | 7927 | | |
7929 | 7928 | | |
7930 | 7929 | | |
| |||
7936 | 7935 | | |
7937 | 7936 | | |
7938 | 7937 | | |
7939 | | - | |
| 7938 | + | |
7940 | 7939 | | |
7941 | 7940 | | |
7942 | 7941 | | |
| |||
7973 | 7972 | | |
7974 | 7973 | | |
7975 | 7974 | | |
7976 | | - | |
| 7975 | + | |
7977 | 7976 | | |
7978 | 7977 | | |
7979 | 7978 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
| 355 | + | |
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| |||
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
498 | | - | |
| 498 | + | |
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
| |||
943 | 943 | | |
944 | 944 | | |
945 | 945 | | |
946 | | - | |
| 946 | + | |
947 | 947 | | |
948 | 948 | | |
949 | 949 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | | - | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
69 | | - | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
157 | 159 | | |
158 | 160 | | |
159 | 161 | | |
160 | | - | |
| 162 | + | |
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
| |||
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
47 | | - | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
56 | | - | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
119 | 125 | | |
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
Lines changed: 9 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
76 | | - | |
77 | | - | |
| 78 | + | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
84 | | - | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| |||
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
146 | | - | |
147 | | - | |
| 148 | + | |
| 149 | + | |
148 | 150 | | |
149 | 151 | | |
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
153 | | - | |
| 155 | + | |
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
158 | | - | |
| 160 | + | |
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
0 commit comments