fix search start for weblibre search bang

This commit is contained in:
Fabian Freund
2026-05-24 10:30:50 +02:00
parent 0b0ef38636
commit 46a3b250c2
7 changed files with 65 additions and 2 deletions
@@ -91,6 +91,8 @@ class SearchRoute extends GoRouteData with $SearchRoute {
final bool launchedFromIntent;
final bool autoSubmitSearch;
/// When provided, the search screen will load URLs into this existing tab
/// instead of creating a new tab. This also changes the UI to show
/// site-specific bangs instead of the tab type selector.
@@ -100,6 +102,7 @@ class SearchRoute extends GoRouteData with $SearchRoute {
required this.tabType,
this.searchText = SearchRoute.emptySearchText,
this.launchedFromIntent = false,
this.autoSubmitSearch = false,
this.tabId,
});
@@ -111,6 +114,7 @@ class SearchRoute extends GoRouteData with $SearchRoute {
? null
: searchText,
launchedFromIntent: launchedFromIntent,
autoSubmitSearch: autoSubmitSearch,
tabId: tabId,
);
}
@@ -632,6 +632,13 @@ mixin $SearchRoute on GoRouteData {
_$boolConverter,
) ??
false,
autoSubmitSearch:
_$convertMapValue(
'auto-submit-search',
state.uri.queryParameters,
_$boolConverter,
) ??
false,
tabId: state.uri.queryParameters['tab-id'],
);
@@ -643,6 +650,8 @@ mixin $SearchRoute on GoRouteData {
queryParams: {
if (_self.launchedFromIntent != false)
'launched-from-intent': _self.launchedFromIntent.toString(),
if (_self.autoSubmitSearch != false)
'auto-submit-search': _self.autoSubmitSearch.toString(),
if (_self.tabId != null) 'tab-id': _self.tabId,
},
);