Bug 1841274 - Add Param to Nimbus SearchExtraParams

fenix/117.0
sarah541 12 months ago committed by mergify[bot]
parent 6c5e8dbc95
commit c52cb4f227

@ -139,25 +139,31 @@ re-engagement-notification:
type:
type: int
description: The type of re-engagement notification that is shown to the inactive user.
search-term-groups:
description: A feature allowing the grouping of URLs around the search term that it came from.
search-extra-params:
description: A feature that provides additional args for search.
hasExposure: true
exposureDescription: ""
variables:
channel-id:
type: json
description: The channel Id param name with arg.
enabled:
type: boolean
description: "If true, the feature shows up on the homescreen and on the new tab screen."
search_extra_params:
description: A feature that provides a search engine name and a channel ID.
description: "If true, the feature is active."
feature-enabler:
type: json
description: "The feature enabler param name with arg, NOTE this map could be empty."
search-engine:
type: string
description: The search engine name.
search-term-groups:
description: A feature allowing the grouping of URLs around the search term that it came from.
hasExposure: true
exposureDescription: ""
variables:
enabled:
type: boolean
description: "If true, the feature is active."
search_name_channel_id:
type: json
description: The search engine name and the channel ID.
description: "If true, the feature shows up on the homescreen and on the new tab screen."
shopping-experience:
description: A feature that shows product review quality information.
hasExposure: true

@ -342,15 +342,23 @@ features:
value:
enabled: true
search_extra_params:
description: A feature that provides a search engine name and a channel ID.
search-extra-params:
description: A feature that provides additional args for search.
variables:
enabled:
description: If true, the feature is active.
type: Boolean
default: false
search_name_channel_id:
description: The search engine name and the channel ID.
search-engine:
description: The search engine name.
type: String
default: ""
feature-enabler:
description: The feature enabler param name with arg, NOTE this map could be empty.
type: Map<String, String>
default: {}
channel-id:
description: The channel Id param name with arg.
type: Map<String, String>
default: {}
types:

@ -248,6 +248,16 @@ class Core(
* The [BrowserStore] holds the global [BrowserState].
*/
val store by lazyMonitored {
val searchExtraParamsNimbus = FxNimbus.features.searchExtraParams.value()
val searchExtraParams = searchExtraParamsNimbus.takeIf { it.enabled }?.run {
SearchExtraParams(
searchEngine,
featureEnabler.keys.firstOrNull(),
featureEnabler.values.firstOrNull(),
channelId.keys.first(),
channelId.values.first(),
)
}
val middlewareList =
mutableListOf(
LastAccessMiddleware(),
@ -262,14 +272,7 @@ class Core(
context = context,
additionalBundledSearchEngineIds = listOf("reddit", "youtube"),
migration = SearchMigration(context),
searchExtraParams =
FxNimbus.features.searchExtraParams.value().searchNameChannelId
.firstNotNullOfOrNull {
SearchExtraParams(
it.key,
it.value,
)
},
searchExtraParams = searchExtraParams,
),
RecordingDevicesMiddleware(context, context.components.notificationsDelegate),
PromptMiddleware(),

Loading…
Cancel
Save