diff --git a/mobile/android/android-components/components/compose/base/src/main/java/mozilla/components/compose/base/SelectableChip.kt b/mobile/android/android-components/components/compose/base/src/main/java/mozilla/components/compose/base/SelectableChip.kt index a899e4c4186b7..d3ab06cd02e09 100644 --- a/mobile/android/android-components/components/compose/base/src/main/java/mozilla/components/compose/base/SelectableChip.kt +++ b/mobile/android/android-components/components/compose/base/src/main/java/mozilla/components/compose/base/SelectableChip.kt @@ -4,7 +4,6 @@ package mozilla.components.compose.base -import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth @@ -31,12 +30,9 @@ import mozilla.components.ui.icons.R as iconsR * Default layout of a selectable chip. * * @param text [String] displayed in this chip. - * @param selected Whether this chip should be shown as selected. + * @param selected Whether this should be shown as selected. * @param modifier [Modifier] used to be applied to the layout of the chip. - * @param enabled Whether this chip is enabled. - * @param showIcon Whether to show an icon at the beginning of the chip. - * @param colors The color set defined by [SelectableChipColors] used to style the chip. - * @param border The border to draw around the container of this chip. + * @param selectableChipColors The color set defined by [SelectableChipColors] used to style the chip. * @param onClick Callback for when the user taps this chip. */ @Composable @@ -44,10 +40,7 @@ fun SelectableChip( text: String, selected: Boolean, modifier: Modifier = Modifier, - enabled: Boolean = true, - showIcon: Boolean = true, colors: SelectableChipColors = FilterChipDefaults.filterChipColors(), - border: BorderStroke? = FilterChipDefaults.filterChipBorder(enabled, selected), onClick: () -> Unit, ) { FilterChip( @@ -60,7 +53,7 @@ fun SelectableChip( style = if (selected) AcornTheme.typography.headline8 else AcornTheme.typography.body2, ) }, - leadingIcon = if (showIcon && selected) { + leadingIcon = if (selected) { { Icon( painter = painterResource(id = iconsR.drawable.mozac_ic_checkmark_16), @@ -70,9 +63,8 @@ fun SelectableChip( } else { null }, - shape = RoundedCornerShape(16.dp), colors = colors, - border = border, + shape = RoundedCornerShape(16.dp), ) } diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/ui/BrowserModeSelector.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/ui/BrowserModeSelector.kt deleted file mode 100644 index 60d9d602a6233..0000000000000 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/ui/BrowserModeSelector.kt +++ /dev/null @@ -1,93 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -package org.mozilla.fenix.components.toolbar.ui - -import androidx.compose.foundation.background -import androidx.compose.foundation.border -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.FilterChipDefaults -import androidx.compose.material3.MaterialTheme -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.tooling.preview.PreviewParameter -import androidx.compose.ui.unit.dp -import mozilla.components.compose.base.SelectableChip -import org.mozilla.fenix.browser.browsingmode.BrowsingMode -import org.mozilla.fenix.theme.FirefoxTheme -import org.mozilla.fenix.theme.PreviewThemeProvider -import org.mozilla.fenix.theme.Theme - -/** - * A selector to switch between Private and Standard browsing modes. - * - * @param selectedMode The currently selected [BrowsingMode]. - * @param onModeSelected Callback invoked when a new mode is selected. - * @param modifier [Modifier] to be applied to the selector. - */ -@Composable -fun BrowserModeSelector( - selectedMode: BrowsingMode, - onModeSelected: (BrowsingMode) -> Unit, - modifier: Modifier = Modifier, -) { - Row( - modifier = modifier - .background( - color = MaterialTheme.colorScheme.surface, - shape = RoundedCornerShape(20.dp), - ) - .border( - width = 1.dp, - color = MaterialTheme.colorScheme.outlineVariant, - shape = RoundedCornerShape(20.dp), - ) - .padding(horizontal = FirefoxTheme.layout.space.static100), - verticalAlignment = Alignment.CenterVertically, - ) { - val chipColors = FilterChipDefaults.filterChipColors( - containerColor = Color.Transparent, - labelColor = MaterialTheme.colorScheme.onSurfaceVariant, - selectedContainerColor = MaterialTheme.colorScheme.primaryContainer, - selectedLabelColor = MaterialTheme.colorScheme.onPrimaryContainer, - ) - - SelectableChip( - text = "Private", - selected = selectedMode == BrowsingMode.Private, - showIcon = false, - colors = chipColors, - border = null, - onClick = { onModeSelected(BrowsingMode.Private) }, - ) - - SelectableChip( - text = "Standard", - selected = selectedMode == BrowsingMode.Normal, - showIcon = false, - colors = chipColors, - border = null, - onClick = { onModeSelected(BrowsingMode.Normal) }, - ) - } -} - -@Preview -@Composable -private fun BrowserModeSelectorPreview( - @PreviewParameter(PreviewThemeProvider::class) theme: Theme, -) { - FirefoxTheme(theme = theme) { - BrowserModeSelector( - selectedMode = BrowsingMode.Normal, - onModeSelected = {}, - modifier = Modifier.padding(16.dp), - ) - } -} diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/ui/SearchSuggestionsContainer.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/ui/SearchSuggestionsContainer.kt deleted file mode 100644 index 913d8fcad080c..0000000000000 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/ui/SearchSuggestionsContainer.kt +++ /dev/null @@ -1,84 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -package org.mozilla.fenix.components.toolbar.ui - -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.ColumnScope -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.padding -import androidx.compose.material3.Surface -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.tooling.preview.PreviewParameter -import androidx.compose.ui.unit.dp -import org.mozilla.fenix.browser.browsingmode.BrowsingMode -import org.mozilla.fenix.theme.FirefoxTheme -import org.mozilla.fenix.theme.PreviewThemeProvider -import org.mozilla.fenix.theme.Theme - -/** - * Container for search suggestions content, optionally displaying a [BrowserModeSelector] at the - * bottom. - * - * @param selectedMode The currently selected [BrowsingMode]. - * @param showBrowserModeToggle Whether to display the [BrowserModeSelector]. - * @param onModeSelected Callback invoked when a new browsing mode is selected via the selector. - * @param searchSuggestionsContent The composable content for search suggestions, receiving a [Modifier] - * to fill the available space. - * @param modifier [Modifier] to be applied to the container. - * @param browserModeSelectorModifier [Modifier] to be applied to the [BrowserModeSelector]. - */ -@Composable -internal fun ColumnScope.SearchSuggestionsContainer( - selectedMode: BrowsingMode, - showBrowserModeToggle: Boolean, - onModeSelected: (BrowsingMode) -> Unit, - searchSuggestionsContent: @Composable (Modifier) -> Unit, - modifier: Modifier = Modifier, - browserModeSelectorModifier: Modifier = Modifier, -) { - Box( - modifier = modifier - .fillMaxWidth() - .weight(1f), - ) { - searchSuggestionsContent(Modifier.fillMaxSize()) - - if (showBrowserModeToggle) { - BrowserModeSelector( - selectedMode = selectedMode, - onModeSelected = onModeSelected, - modifier = browserModeSelectorModifier.align(Alignment.BottomCenter), - ) - } - } -} - -@Preview -@Composable -private fun SearchSuggestionsContainerPreview( - @PreviewParameter(PreviewThemeProvider::class) theme: Theme, -) { - FirefoxTheme(theme) { - Column(modifier = Modifier.fillMaxSize()) { - SearchSuggestionsContainer( - selectedMode = BrowsingMode.Normal, - showBrowserModeToggle = true, - onModeSelected = {}, - searchSuggestionsContent = { - Surface(modifier = Modifier.fillMaxSize()) { - Text(text = "Search Suggestions Content") - } - }, - browserModeSelectorModifier = Modifier.padding(bottom = 16.dp), - ) - } - } -} diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt index 09af093172d17..3e14efea2fd6f 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt @@ -668,8 +668,8 @@ class HomeFragment : Fragment() { toolbarStore = toolbarStore, appStore = activity.components.appStore, browserStore = activity.components.core.store, + browsingModeManager = activity.browsingModeManager, settings = activity.settings(), - browsingModeManager = browsingModeManager, directToSearchConfig = DirectToSearchConfig( startSearch = bundleArgs.getBoolean(FOCUS_ON_ADDRESS_BAR) || FxNimbus.features.oneClickSearch.value().enabled, diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/toolbar/HomeToolbarComposable.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/toolbar/HomeToolbarComposable.kt index b9a96d429670d..721a7c13d482c 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/toolbar/HomeToolbarComposable.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/toolbar/HomeToolbarComposable.kt @@ -13,9 +13,6 @@ import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.imePadding -import androidx.compose.foundation.layout.padding import androidx.compose.material3.DividerDefaults import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable @@ -24,7 +21,6 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.platform.ComposeView import androidx.compose.ui.res.colorResource -import androidx.compose.ui.unit.dp import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.core.view.updateLayoutParams import androidx.navigation.NavController @@ -53,7 +49,6 @@ import org.mozilla.fenix.components.appstate.AppAction.SearchAction.SearchStarte import org.mozilla.fenix.components.metrics.MetricsUtils import org.mozilla.fenix.components.toolbar.ToolbarPosition.BOTTOM import org.mozilla.fenix.components.toolbar.ToolbarPosition.TOP -import org.mozilla.fenix.components.toolbar.ui.SearchSuggestionsContainer import org.mozilla.fenix.databinding.FragmentHomeBinding import org.mozilla.fenix.theme.FirefoxTheme import org.mozilla.fenix.utils.Settings @@ -69,8 +64,9 @@ import org.mozilla.fenix.wallpapers.Wallpaper * @param toolbarStore [BrowserToolbarStore] containing the composable toolbar state. * @param appStore [AppStore] to sync from. * @param browserStore [BrowserStore] to sync from. + * @param browsingModeManager [BrowsingModeManager] Manager holding current state of whether + * the browser is in private mode or not. * @param settings [Settings] for querying various application settings. - * @param browsingModeManager [BrowsingModeManager] used to read/update the current [BrowsingMode]. * @param directToSearchConfig [DirectToSearchConfig] configuration for starting with the toolbar in search mode. * @param tabStripContent [Composable] as the tab strip content to be displayed together with this toolbar. * @param searchSuggestionsContent [Composable] as the search suggestions content to be displayed @@ -85,8 +81,8 @@ internal class HomeToolbarComposable( private val toolbarStore: BrowserToolbarStore, private val appStore: AppStore, private val browserStore: BrowserStore, - private val settings: Settings, private val browsingModeManager: BrowsingModeManager, + private val settings: Settings, private val directToSearchConfig: DirectToSearchConfig, private val tabStripContent: @Composable () -> Unit, private val searchSuggestionsContent: @Composable (Modifier) -> Unit, @@ -116,7 +112,6 @@ internal class HomeToolbarComposable( val isSearchEmpty = toolbarStore.observeAsComposableState { it.editState.query.current.isEmpty() }.value val shouldShowTabStrip: Boolean = remember { settings.isTabStripEnabled } - val shouldShowBrowserModeToggle: Boolean = remember { settings.enableBrowserModeToggle } val isAddressBarVisible = remember { addressBarVisibility } BackInvokedHandler(isSearching) { @@ -134,31 +129,15 @@ internal class HomeToolbarComposable( tabStripContent() } - val isSearchActive = appStore.state.searchState.isSearchActive - val showBrowserModeToggle = - shouldShowBrowserModeToggle && isSearchActive && !isSearchEmpty - if (settings.shouldUseBottomToolbar) { - SearchSuggestionsContainer( - selectedMode = browsingModeManager.mode, - showBrowserModeToggle = showBrowserModeToggle, - onModeSelected = { newMode -> - browsingModeManager.mode = newMode - }, - searchSuggestionsContent = { - searchSuggestionsContent(Modifier.fillMaxSize()) - }, - browserModeSelectorModifier = Modifier.padding(bottom = 16.dp), - ) + searchSuggestionsContent(Modifier.weight(1f)) } - Box { if (settings.enableHomepageSearchBar) { BrowserSimpleToolbar(toolbarStore, appStore) } - this@Column.AnimatedVisibility( - visible = isAddressBarVisible.value || isSearchActive, + visible = isAddressBarVisible.value || appStore.state.searchState.isSearchActive, enter = fadeIn( animationSpec = tween( durationMillis = 250, @@ -173,7 +152,7 @@ internal class HomeToolbarComposable( ), ) { val (backgroundColor, outlineColor) = - if (browsingModeManager.mode.isPrivate) { + if (browsingModeManager.mode == BrowsingMode.Private) { MaterialTheme.colorScheme.surface to colorResource(R.color.homepage_tab_edge_to_edge_private_toolbar_outline) } else if (isEdgeToEdgeBackgroundEnabled && isSearchEmpty) { @@ -190,28 +169,15 @@ internal class HomeToolbarComposable( ) } } - if (settings.toolbarPosition == BOTTOM) { navigationBarContent?.invoke() } - if (!settings.shouldUseBottomToolbar) { - SearchSuggestionsContainer( - selectedMode = browsingModeManager.mode, - showBrowserModeToggle = showBrowserModeToggle, - onModeSelected = { newMode -> - browsingModeManager.mode = newMode - }, - searchSuggestionsContent = { - searchSuggestionsContent(Modifier.fillMaxSize()) - }, - browserModeSelectorModifier = Modifier.imePadding(), - ) + searchSuggestionsContent(Modifier.weight(1f)) } } } } - translationZ = context.resources.getDimension(R.dimen.browser_fragment_above_toolbar_panels_elevation) homeBinding.homeLayout.addView(this) } diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/search/awesomebar/AwesomeBarComposable.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/search/awesomebar/AwesomeBarComposable.kt index 8d9a26539ea29..995a36dcc9824 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/search/awesomebar/AwesomeBarComposable.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/search/awesomebar/AwesomeBarComposable.kt @@ -7,11 +7,9 @@ package org.mozilla.fenix.search.awesomebar import androidx.compose.foundation.background import androidx.compose.foundation.gestures.detectTapGestures import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.ExperimentalLayoutApi import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.WindowInsets -import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.isImeVisible import androidx.compose.material3.MaterialTheme @@ -142,61 +140,55 @@ class AwesomeBarComposable( } } - Column(modifier = modifier.fillMaxHeight()) { - if (isSearchActive && shouldShowClipboardBar && orientation == AwesomeBarOrientation.TOP) { - val url = components.clipboardHandler.extractURL() + if (isSearchActive && shouldShowClipboardBar && orientation == AwesomeBarOrientation.TOP) { + val url = components.clipboardHandler.extractURL() - ClipboardSuggestionBar( - shouldUseBottomToolbar = components.settings.shouldUseBottomToolbar, - onClick = { - url?.let { - toolbarStore.dispatch( - SearchQueryUpdated( - query = BrowserToolbarQuery(url), - isQueryPrefilled = false, - ), - ) - } + ClipboardSuggestionBar( + shouldUseBottomToolbar = components.settings.shouldUseBottomToolbar, + onClick = { + url?.let { + toolbarStore.dispatch( + SearchQueryUpdated(query = BrowserToolbarQuery(url), isQueryPrefilled = false), + ) + } + }, + ) + } + + if (isSearchActive) { + if (state.showSearchSuggestionsHint) { + PrivateSuggestionsCard( + onSearchSuggestionsInPrivateModeAllowed = { + activity.settings().shouldShowSearchSuggestionsInPrivate = true + activity.settings().showSearchSuggestionsInPrivateOnboardingFinished = true + searchStore.dispatch(SearchFragmentAction.SetShowSearchSuggestions(true)) + searchStore.dispatch(SearchFragmentAction.AllowSearchSuggestionsInPrivateModePrompt(false)) + searchStore.dispatch(SearchFragmentAction.PrivateSuggestionsCardAccepted) + }, + onSearchSuggestionsInPrivateModeBlocked = { + activity.settings().shouldShowSearchSuggestionsInPrivate = false + activity.settings().showSearchSuggestionsInPrivateOnboardingFinished = true + searchStore.dispatch( + SearchFragmentAction.AllowSearchSuggestionsInPrivateModePrompt(false), + ) + }, + onLearnMoreClick = { + components.useCases.fenixBrowserUseCases.loadUrlOrSearch( + searchTermOrURL = SupportUtils.getGenericSumoURLForTopic( + SupportUtils.SumoTopic.SEARCH_SUGGESTION, + ), + newTab = appStore.state.searchState.sourceTabId == null, + private = true, + ) + navController.navigate(R.id.browserFragment) }, ) } - - if (isSearchActive) { - if (state.showSearchSuggestionsHint) { - PrivateSuggestionsCard( - onSearchSuggestionsInPrivateModeAllowed = { - activity.settings().shouldShowSearchSuggestionsInPrivate = true - activity.settings().showSearchSuggestionsInPrivateOnboardingFinished = true - searchStore.dispatch(SearchFragmentAction.SetShowSearchSuggestions(true)) - searchStore.dispatch( - SearchFragmentAction.AllowSearchSuggestionsInPrivateModePrompt(false), - ) - searchStore.dispatch(SearchFragmentAction.PrivateSuggestionsCardAccepted) - }, - onSearchSuggestionsInPrivateModeBlocked = { - activity.settings().shouldShowSearchSuggestionsInPrivate = false - activity.settings().showSearchSuggestionsInPrivateOnboardingFinished = true - searchStore.dispatch( - SearchFragmentAction.AllowSearchSuggestionsInPrivateModePrompt(false), - ) - }, - onLearnMoreClick = { - components.useCases.fenixBrowserUseCases.loadUrlOrSearch( - searchTermOrURL = SupportUtils.getGenericSumoURLForTopic( - SupportUtils.SumoTopic.SEARCH_SUGGESTION, - ), - newTab = appStore.state.searchState.sourceTabId == null, - private = true, - ) - navController.navigate(R.id.browserFragment) - }, - ) - } - + if (state.shouldShowSearchSuggestions) { Box( - modifier = Modifier - .weight(1f) + modifier = modifier .background(MaterialTheme.colorScheme.surface) + .fillMaxSize() .pointerInput(WindowInsets.isImeVisible) { detectTapGestures( // Hide the keyboard for any touches in the empty area of the awesomebar @@ -208,55 +200,59 @@ class AwesomeBarComposable( ) }, ) { - if (state.shouldShowSearchSuggestions) { - AwesomeBar( - text = state.query, - providers = state.searchSuggestionsProviders, - hiddenSuggestions = state.hiddenSuggestions, - orientation = orientation, - onSuggestionClicked = { suggestion -> - searchStore.dispatch(SuggestionClicked(suggestion)) - }, - onAutoComplete = { suggestion -> - searchStore.dispatch(SuggestionSelected(suggestion)) - }, - onRemoveClicked = { suggestion -> - deleteHistoryDelegate?.handleDeletingHistoryEntry(suggestion) - }, - onVisibilityStateUpdated = { - browserStore.dispatch(AwesomeBarAction.VisibilityStateUpdated(it)) - }, - onScroll = { view.hideKeyboard() }, - profiler = components.core.engine.profiler, - ) - } else if (showScrimWhenNoSuggestions) { - Spacer( - modifier = Modifier - .background(Color(MATERIAL_DESIGN_SCRIM.toColorInt())) - .fillMaxSize(), - ) - } + AwesomeBar( + text = state.query, + providers = state.searchSuggestionsProviders, + hiddenSuggestions = state.hiddenSuggestions, + orientation = orientation, + onSuggestionClicked = { suggestion -> + searchStore.dispatch(SuggestionClicked(suggestion)) + }, + onAutoComplete = { suggestion -> + searchStore.dispatch(SuggestionSelected(suggestion)) + }, + onRemoveClicked = { suggestion -> + deleteHistoryDelegate?.handleDeletingHistoryEntry(suggestion) + }, + onVisibilityStateUpdated = { + browserStore.dispatch(AwesomeBarAction.VisibilityStateUpdated(it)) + }, + onScroll = { view.hideKeyboard() }, + profiler = components.core.engine.profiler, + ) } - } - - if (isSearchActive && shouldShowClipboardBar && orientation == AwesomeBarOrientation.BOTTOM) { - val url = components.clipboardHandler.extractURL() - - ClipboardSuggestionBar( - shouldUseBottomToolbar = components.settings.shouldUseBottomToolbar, - onClick = { - url?.let { - toolbarStore.dispatch( - SearchQueryUpdated( - query = BrowserToolbarQuery(url), - isQueryPrefilled = false, - ), + } else if (showScrimWhenNoSuggestions) { + Spacer( + modifier = modifier + .background(Color(MATERIAL_DESIGN_SCRIM.toColorInt())) + .fillMaxSize() + .pointerInput(WindowInsets.isImeVisible) { + detectTapGestures( + onPress = { + focusManager.clearFocus() + keyboardController?.hide() + appStore.dispatch(SearchEnded) + }, ) - } - }, + }, ) } } + + if (isSearchActive && shouldShowClipboardBar && orientation == AwesomeBarOrientation.BOTTOM) { + val url = components.clipboardHandler.extractURL() + + ClipboardSuggestionBar( + shouldUseBottomToolbar = components.settings.shouldUseBottomToolbar, + onClick = { + url?.let { + toolbarStore.dispatch( + SearchQueryUpdated(query = BrowserToolbarQuery(url), isQueryPrefilled = false), + ) + } + }, + ) + } } private fun initializeSearchStore() = fragment.fragmentStore(