From 0540618bbf1a759a1248fbe3813e0e45845c5bee Mon Sep 17 00:00:00 2001 From: Fabian Freund Date: Fri, 12 Jun 2026 06:00:10 +0200 Subject: [PATCH] format --- .../bangs/domain/services/reverse_match.dart | 22 +++++--- .../domain/providers/desktop_mode.dart | 13 ++--- .../quick_tab_switcher_chip.dart | 23 ++++---- .../sheets/gesture_exclusion_section.dart | 26 ++++----- .../tab_view/dialogs/tab_parent_picker.dart | 7 +-- .../widgets/tab_view/tab_tree_view.dart | 22 ++++---- .../dialogs/open_shared_content.dart | 8 +-- .../search/presentation/screens/search.dart | 3 +- .../screens/container_draft_suggestions.dart | 5 +- .../widgets/color_picker_dialog.dart | 14 ++--- .../screens/gesture_behavior_screen.dart | 4 +- .../screens/gesture_feedback_screen.dart | 5 +- .../widgets/gesture_action_picker.dart | 5 +- .../widgets/gesture_stroke_view.dart | 6 +-- .../widgets/toolbar_layout_content.dart | 11 ++-- .../presentation/widgets/toolbar_preview.dart | 3 +- .../widgets/web_search_infobox_card.dart | 9 +++- .../features/bangs/reverse_match_test.dart | 53 +++++-------------- .../lib/src/domain/services/gecko_event.dart | 3 +- 19 files changed, 100 insertions(+), 142 deletions(-) diff --git a/apps/weblibre/lib/features/bangs/domain/services/reverse_match.dart b/apps/weblibre/lib/features/bangs/domain/services/reverse_match.dart index 8d9a4f41..7e0492ca 100644 --- a/apps/weblibre/lib/features/bangs/domain/services/reverse_match.dart +++ b/apps/weblibre/lib/features/bangs/domain/services/reverse_match.dart @@ -145,8 +145,10 @@ class BangUrlPattern { if (value == null) return null; if (!value.startsWith(prefix)) return null; if (!value.endsWith(suffix)) return null; - final captured = - value.substring(prefix.length, value.length - suffix.length); + final captured = value.substring( + prefix.length, + value.length - suffix.length, + ); return captured.isEmpty ? null : captured; } @@ -155,8 +157,10 @@ class BangUrlPattern { final segment = segments[pathIndex!]; if (!segment.startsWith(prefix)) return null; if (!segment.endsWith(suffix)) return null; - final captured = - segment.substring(prefix.length, segment.length - suffix.length); + final captured = segment.substring( + prefix.length, + segment.length - suffix.length, + ); return captured.isEmpty ? null : captured; } @@ -238,8 +242,9 @@ class BangUrlPattern { final placeholderValue = scopeComponents.queryParams[sentinelParam]!; final sentinelStart = placeholderValue.indexOf(_sentinel); final prefix = placeholderValue.substring(0, sentinelStart); - final suffix = - placeholderValue.substring(sentinelStart + _sentinel.length); + final suffix = placeholderValue.substring( + sentinelStart + _sentinel.length, + ); // The other params in the same scope become required constants. final required = { @@ -327,8 +332,9 @@ bool _requiredQueryParamsMatch( /// duplicate-keyed query params (multi-map semantics aren't worth the /// complexity for our use case). _Components? _componentsFromUri(Uri uri) { - final segments = - uri.pathSegments.where((s) => s.isNotEmpty).toList(growable: false); + final segments = uri.pathSegments + .where((s) => s.isNotEmpty) + .toList(growable: false); final all = uri.queryParametersAll; final params = {}; for (final entry in all.entries) { diff --git a/apps/weblibre/lib/features/geckoview/domain/providers/desktop_mode.dart b/apps/weblibre/lib/features/geckoview/domain/providers/desktop_mode.dart index 50e8bf3b..aa7a93c8 100644 --- a/apps/weblibre/lib/features/geckoview/domain/providers/desktop_mode.dart +++ b/apps/weblibre/lib/features/geckoview/domain/providers/desktop_mode.dart @@ -64,14 +64,11 @@ class DesktopMode extends _$DesktopMode { // landing on a ruled host forces desktop on again, and leaving it reverts // to the browser-wide default. Watching only the host keeps in-page // navigations (path/query changes) from clobbering a manual override. - ref.listen( - tabStateProvider(tabId), - (previous, next) { - if (previous?.url.host != next?.url.host) { - state = _resolveForHost(next?.url); - } - }, - ); + ref.listen(tabStateProvider(tabId), (previous, next) { + if (previous?.url.host != next?.url.host) { + state = _resolveForHost(next?.url); + } + }); // Seed the initial value from the per-site rule (falling back to the // browser-wide default) so a newly opened tab's menu checkbox matches the diff --git a/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/browser_modules/quick_tab_switcher_chip.dart b/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/browser_modules/quick_tab_switcher_chip.dart index 71195e25..522e754b 100644 --- a/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/browser_modules/quick_tab_switcher_chip.dart +++ b/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/browser_modules/quick_tab_switcher_chip.dart @@ -168,20 +168,21 @@ buildQuickTabSwitcherChipDecoration( null => null, }, side: (item, isSelected) => switch (item.color) { - final color? when isSelected => thickContainerSelectedBorder - ? BorderSide( - color: ContainerColors.palette( + final color? when isSelected => + thickContainerSelectedBorder + ? BorderSide( + color: ContainerColors.palette( + context, + color, + useCustomColor: item.useCustomColor, + ).outlineColor, + width: 2.0, + ) + : ContainerColors.palette( context, color, useCustomColor: item.useCustomColor, - ).outlineColor, - width: 2.0, - ) - : ContainerColors.palette( - context, - color, - useCustomColor: item.useCustomColor, - ).selectedBorderSide, + ).selectedBorderSide, final color? => ContainerColors.palette( context, color, diff --git a/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/sheets/gesture_exclusion_section.dart b/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/sheets/gesture_exclusion_section.dart index 2c5328a1..fb2418fb 100644 --- a/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/sheets/gesture_exclusion_section.dart +++ b/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/sheets/gesture_exclusion_section.dart @@ -90,19 +90,19 @@ class GestureExclusionSection extends HookConsumerWidget { bool enabled, ) async { try { - await ref.read(gestureSettingsRepositoryProvider.notifier).updateSettings( - (current) { - final next = current.excludedSites.toList(); - if (enabled) { - // Enabling gestures here => remove the host from the exclusion list. - next.remove(host); - } else if (!next.contains(host)) { - // Disabling gestures here => add the host to the exclusion list. - next.add(host); - } - return current.copyWith.excludedSites(next); - }, - ); + await ref.read(gestureSettingsRepositoryProvider.notifier).updateSettings(( + current, + ) { + final next = current.excludedSites.toList(); + if (enabled) { + // Enabling gestures here => remove the host from the exclusion list. + next.remove(host); + } else if (!next.contains(host)) { + // Disabling gestures here => add the host to the exclusion list. + next.add(host); + } + return current.copyWith.excludedSites(next); + }); } catch (e, s) { logger.e('Failed to toggle gesture exclusion', error: e, stackTrace: s); if (context.mounted) { diff --git a/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/tab_view/dialogs/tab_parent_picker.dart b/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/tab_view/dialogs/tab_parent_picker.dart index df61ae6f..309091fe 100644 --- a/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/tab_view/dialogs/tab_parent_picker.dart +++ b/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/tab_view/dialogs/tab_parent_picker.dart @@ -136,9 +136,7 @@ class _TabParentPickerSheet extends HookConsumerWidget { child: ListTile( leading: const Icon(MdiIcons.fileTreeOutline), title: const Text('Make standalone'), - subtitle: const Text( - 'Detach from current parent', - ), + subtitle: const Text('Detach from current parent'), enabled: movingTab.parentId != null, onTap: () => Navigator.of( context, @@ -173,8 +171,7 @@ class _TabParentPickerSheet extends HookConsumerWidget { // the one you're currently nested under". return ListTabPreview( tabId: candidate.id, - isActive: - candidate.id == movingTab.parentId, + isActive: candidate.id == movingTab.parentId, onTap: () => Navigator.of( context, ).pop(_ParentPickerSelected(candidate.id)), diff --git a/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/tab_view/tab_tree_view.dart b/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/tab_view/tab_tree_view.dart index 7320cbfc..8750cabe 100644 --- a/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/tab_view/tab_tree_view.dart +++ b/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/tab_view/tab_tree_view.dart @@ -296,8 +296,7 @@ class _TabTreesGrid extends HookConsumerWidget { final row = index ~/ 2; final tabStart = row * itemSize.height; - final viewportDimension = - scrollController.position.viewportDimension; + final viewportDimension = scrollController.position.viewportDimension; final targetOffset = (tabStart - viewportDimension / 2 + itemSize.height / 2).clamp( @@ -324,17 +323,14 @@ class _TabTreesGrid extends HookConsumerWidget { }, [filteredTabEntities, activeTab]); final tabs = useMemoized(() { - return filteredTabEntities.value - .whereType() - .map((entity) { - return _TabTreePreview( - entity: entity, - activeTabId: activeTab, - onClose: onClose, - stackPadding: const Offset(8, 8), - ); - }) - .toList(); + return filteredTabEntities.value.whereType().map((entity) { + return _TabTreePreview( + entity: entity, + activeTabId: activeTab, + onClose: onClose, + stackPadding: const Offset(8, 8), + ); + }).toList(); }, [filteredTabEntities, activeTab]); return Padding( diff --git a/apps/weblibre/lib/features/geckoview/features/open_link_tools/presentation/dialogs/open_shared_content.dart b/apps/weblibre/lib/features/geckoview/features/open_link_tools/presentation/dialogs/open_shared_content.dart index accc09ae..c8a4165f 100644 --- a/apps/weblibre/lib/features/geckoview/features/open_link_tools/presentation/dialogs/open_shared_content.dart +++ b/apps/weblibre/lib/features/geckoview/features/open_link_tools/presentation/dialogs/open_shared_content.dart @@ -143,9 +143,7 @@ class OpenSharedContent extends HookConsumerWidget { unawaited( Future(() async { ContainerData? resolved; - final containerRepo = ref.read( - containerRepositoryProvider.notifier, - ); + final containerRepo = ref.read(containerRepositoryProvider.notifier); // Priority: explicit intent container (PWA shortcut) > site // assignment for the URL > mode default. @@ -160,9 +158,7 @@ class OpenSharedContent extends HookConsumerWidget { final siteAssignedId = await containerRepo .siteAssignedContainerId(Uri.parse(selectionUrlKey)); if (siteAssignedId != null) { - resolved = await containerRepo.getContainerData( - siteAssignedId, - ); + resolved = await containerRepo.getContainerData(siteAssignedId); } } diff --git a/apps/weblibre/lib/features/geckoview/features/search/presentation/screens/search.dart b/apps/weblibre/lib/features/geckoview/features/search/presentation/screens/search.dart index 6b51ea81..ef90bda0 100644 --- a/apps/weblibre/lib/features/geckoview/features/search/presentation/screens/search.dart +++ b/apps/weblibre/lib/features/geckoview/features/search/presentation/screens/search.dart @@ -631,8 +631,7 @@ class SearchScreen extends HookConsumerWidget { // Whether to surface an in-app close button so the page can be dismissed // without a system back button/gesture (opt-in, e.g. for e-ink devices). // Only meaningful when there is a route to pop back to. - final showCloseButton = - context.canPop() && settings.showSearchCloseButton; + final showCloseButton = context.canPop() && settings.showSearchCloseButton; return Scaffold( body: SafeArea( diff --git a/apps/weblibre/lib/features/geckoview/features/tabs/presentation/screens/container_draft_suggestions.dart b/apps/weblibre/lib/features/geckoview/features/tabs/presentation/screens/container_draft_suggestions.dart index 41524974..42450de3 100644 --- a/apps/weblibre/lib/features/geckoview/features/tabs/presentation/screens/container_draft_suggestions.dart +++ b/apps/weblibre/lib/features/geckoview/features/tabs/presentation/screens/container_draft_suggestions.dart @@ -62,10 +62,7 @@ class ContainerDraftSuggestionsScreen extends HookConsumerWidget { ); return math.max( - math.min( - calculatedCount, - selectedContainer.value?.tabIds.length ?? 0, - ), + math.min(calculatedCount, selectedContainer.value?.tabIds.length ?? 0), 2, ); }, [screenWidth, selectedContainer.value?.tabIds.length]); diff --git a/apps/weblibre/lib/features/geckoview/features/tabs/presentation/widgets/color_picker_dialog.dart b/apps/weblibre/lib/features/geckoview/features/tabs/presentation/widgets/color_picker_dialog.dart index ed0c7363..6874afce 100644 --- a/apps/weblibre/lib/features/geckoview/features/tabs/presentation/widgets/color_picker_dialog.dart +++ b/apps/weblibre/lib/features/geckoview/features/tabs/presentation/widgets/color_picker_dialog.dart @@ -77,10 +77,10 @@ class ColorPickerDialog extends HookWidget { child: const Text('Cancel'), ), TextButton( - onPressed: () => Navigator.pop( - context, - (color: selectedColor.value, useCustomColor: useCustom.value), - ), + onPressed: () => Navigator.pop(context, ( + color: selectedColor.value, + useCustomColor: useCustom.value, + )), child: const Text('Select'), ), ], @@ -191,11 +191,7 @@ class _CustomSwatch extends StatelessWidget { Widget build(BuildContext context) { final colorScheme = Theme.of(context).colorScheme; final palette = isSelected - ? ContainerColors.palette( - context, - selectedColor, - useCustomColor: true, - ) + ? ContainerColors.palette(context, selectedColor, useCustomColor: true) : null; return InkResponse( onTap: onTap, diff --git a/apps/weblibre/lib/features/gestures/presentation/screens/gesture_behavior_screen.dart b/apps/weblibre/lib/features/gestures/presentation/screens/gesture_behavior_screen.dart index 8f55ed7b..d20892c1 100644 --- a/apps/weblibre/lib/features/gestures/presentation/screens/gesture_behavior_screen.dart +++ b/apps/weblibre/lib/features/gestures/presentation/screens/gesture_behavior_screen.dart @@ -220,7 +220,9 @@ class _CooldownSection extends HookConsumerWidget { value: settings.intervalMs .clamp(minGestureIntervalMs, maxGestureIntervalMs) .toDouble(), - label: settings.intervalMs == 0 ? 'Off' : '${settings.intervalMs} ms', + label: settings.intervalMs == 0 + ? 'Off' + : '${settings.intervalMs} ms', onChanged: (value) async { await ref .read(gestureSettingsRepositoryProvider.notifier) diff --git a/apps/weblibre/lib/features/gestures/presentation/screens/gesture_feedback_screen.dart b/apps/weblibre/lib/features/gestures/presentation/screens/gesture_feedback_screen.dart index a73933f7..1c3528f5 100644 --- a/apps/weblibre/lib/features/gestures/presentation/screens/gesture_feedback_screen.dart +++ b/apps/weblibre/lib/features/gestures/presentation/screens/gesture_feedback_screen.dart @@ -141,8 +141,9 @@ class _SuggestAfterSection extends HookConsumerWidget { await ref .read(gestureSettingsRepositoryProvider.notifier) .updateSettings( - (current) => - current.copyWith.minSuggestionStroke(value.round()), + (current) => current.copyWith.minSuggestionStroke( + value.round(), + ), ); } : null, diff --git a/apps/weblibre/lib/features/gestures/presentation/widgets/gesture_action_picker.dart b/apps/weblibre/lib/features/gestures/presentation/widgets/gesture_action_picker.dart index d9ea150f..88c5e08a 100644 --- a/apps/weblibre/lib/features/gestures/presentation/widgets/gesture_action_picker.dart +++ b/apps/weblibre/lib/features/gestures/presentation/widgets/gesture_action_picker.dart @@ -78,10 +78,7 @@ class _GestureActionPicker extends StatelessWidget { padding: const EdgeInsets.fromLTRB(24, 0, 24, 8), child: Align( alignment: Alignment.centerLeft, - child: Text( - 'Choose action', - style: theme.textTheme.titleLarge, - ), + child: Text('Choose action', style: theme.textTheme.titleLarge), ), ), Expanded( diff --git a/apps/weblibre/lib/features/gestures/presentation/widgets/gesture_stroke_view.dart b/apps/weblibre/lib/features/gestures/presentation/widgets/gesture_stroke_view.dart index c976b5f1..da5179f3 100644 --- a/apps/weblibre/lib/features/gestures/presentation/widgets/gesture_stroke_view.dart +++ b/apps/weblibre/lib/features/gestures/presentation/widgets/gesture_stroke_view.dart @@ -65,11 +65,7 @@ class GestureStrokeView extends StatelessWidget { if (showQualifiers) ...[ Padding( padding: const EdgeInsets.only(right: 6), - child: Icon( - stroke.startPosition.icon, - size: 18, - color: foreground, - ), + child: Icon(stroke.startPosition.icon, size: 18, color: foreground), ), Padding( padding: const EdgeInsets.only(right: 6), diff --git a/apps/weblibre/lib/features/settings/presentation/widgets/toolbar_layout_content.dart b/apps/weblibre/lib/features/settings/presentation/widgets/toolbar_layout_content.dart index 44efc340..8a38b01b 100644 --- a/apps/weblibre/lib/features/settings/presentation/widgets/toolbar_layout_content.dart +++ b/apps/weblibre/lib/features/settings/presentation/widgets/toolbar_layout_content.dart @@ -334,9 +334,7 @@ class _TabBarStackingModeSection extends HookConsumerWidget { children: [ const ListTile( title: Text('Tab Stacking'), - subtitle: Text( - 'How the quick tab switcher bar arranges its tabs', - ), + subtitle: Text('How the quick tab switcher bar arranges its tabs'), leading: Icon(MdiIcons.folderSettings), contentPadding: EdgeInsets.zero, ), @@ -505,8 +503,7 @@ class _QuickTabSwitcherTitleWidthTile extends HookConsumerWidget { onChangeEnd: enabled ? (value) async { final normalized = - (value / quickTabSwitcherTitleWidthStep) - .round() * + (value / quickTabSwitcherTitleWidthStep).round() * quickTabSwitcherTitleWidthStep; sliderValue.value = normalized; await ref @@ -683,7 +680,9 @@ class _QuickTabSwitcherHierarchyGlyphsTile extends HookConsumerWidget { ) .save( (currentSettings) => currentSettings.copyWith - .quickTabSwitcherHierarchyGlyphs(normalized), + .quickTabSwitcherHierarchyGlyphs( + normalized, + ), ); } : null, diff --git a/apps/weblibre/lib/features/settings/presentation/widgets/toolbar_preview.dart b/apps/weblibre/lib/features/settings/presentation/widgets/toolbar_preview.dart index 60c006f3..7b0b98a2 100644 --- a/apps/weblibre/lib/features/settings/presentation/widgets/toolbar_preview.dart +++ b/apps/weblibre/lib/features/settings/presentation/widgets/toolbar_preview.dart @@ -64,8 +64,7 @@ class TabBarPreviewHeaderDelegate extends SliverPersistentHeaderDelegate { _ => 1, }; - return height + - BrowserTabBar.quickTabSwitcherHeight * quickTabSwitcherRows; + return height + BrowserTabBar.quickTabSwitcherHeight * quickTabSwitcherRows; } double get _baseHeight => diff --git a/apps/weblibre/lib/features/web_search/presentation/widgets/web_search_infobox_card.dart b/apps/weblibre/lib/features/web_search/presentation/widgets/web_search_infobox_card.dart index 79ea3fd2..66679698 100644 --- a/apps/weblibre/lib/features/web_search/presentation/widgets/web_search_infobox_card.dart +++ b/apps/weblibre/lib/features/web_search/presentation/widgets/web_search_infobox_card.dart @@ -58,7 +58,9 @@ class WebSearchInfoboxCard extends HookConsumerWidget { void toggle() { ref - .read(persistedBoolProvider(PersistedBoolKey.infoboxExpanded).notifier) + .read( + persistedBoolProvider(PersistedBoolKey.infoboxExpanded).notifier, + ) .toggle(); } @@ -347,7 +349,10 @@ class _InfoboxLinks extends StatelessWidget { ), style: TextButton.styleFrom( foregroundColor: colorScheme.primary, - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4), + padding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 4, + ), ), ), ), diff --git a/apps/weblibre/test/features/bangs/reverse_match_test.dart b/apps/weblibre/test/features/bangs/reverse_match_test.dart index 21570438..61fd314b 100644 --- a/apps/weblibre/test/features/bangs/reverse_match_test.dart +++ b/apps/weblibre/test/features/bangs/reverse_match_test.dart @@ -59,9 +59,7 @@ void main() { }); test('path segment: captures search term', () { - final p = BangUrlPattern.parse( - 'https://en.wikipedia.org/wiki/{{{s}}}', - ); + final p = BangUrlPattern.parse('https://en.wikipedia.org/wiki/{{{s}}}'); expect( p!.match(Uri.parse('https://en.wikipedia.org/wiki/Flutter')), 'Flutter', @@ -69,9 +67,7 @@ void main() { }); test('path segment: enforces non-placeholder segments', () { - final p = BangUrlPattern.parse( - 'https://www.ebay.com/sch/{{{s}}}/m.html', - ); + final p = BangUrlPattern.parse('https://www.ebay.com/sch/{{{s}}}/m.html'); expect( p!.match(Uri.parse('https://www.ebay.com/sch/toys/m.html')), 'toys', @@ -90,26 +86,17 @@ void main() { p!.match(Uri.parse('https://site.com/find/prefix-Foo-end')), 'Foo', ); - expect( - p.match(Uri.parse('https://site.com/find/Foo-end')), - isNull, - ); + expect(p.match(Uri.parse('https://site.com/find/Foo-end')), isNull); }); test('host mismatch rejects', () { final p = BangUrlPattern.parse('https://google.com/search?q={{{s}}}'); - expect( - p!.match(Uri.parse('https://bing.com/search?q=foo')), - isNull, - ); + expect(p!.match(Uri.parse('https://bing.com/search?q=foo')), isNull); }); test('path length mismatch rejects', () { final p = BangUrlPattern.parse('https://x.com/a?q={{{s}}}'); - expect( - p!.match(Uri.parse('https://x.com/a/b?q=foo')), - isNull, - ); + expect(p!.match(Uri.parse('https://x.com/a/b?q=foo')), isNull); }); test('empty captured query is rejected', () { @@ -152,7 +139,9 @@ void main() { }); test('non-generic subdomains still must match', () { - final p = BangUrlPattern.parse('https://cn.bing.com/dict/search?q={{{s}}}'); + final p = BangUrlPattern.parse( + 'https://cn.bing.com/dict/search?q={{{s}}}', + ); expect( p!.match(Uri.parse('https://www.bing.com/dict/search?q=foo')), isNull, @@ -178,9 +167,7 @@ void main() { ); expect(p, isNotNull); expect( - p!.match( - Uri.parse('https://research.lensai.eu/#/s/search/quantum'), - ), + p!.match(Uri.parse('https://research.lensai.eu/#/s/search/quantum')), 'quantum', ); }); @@ -190,31 +177,21 @@ void main() { 'https://research.lensai.eu/#/s/search/{{{s}}}', ); expect( - p!.match( - Uri.parse('https://research.lensai.eu/#/s/answer/quantum'), - ), + p!.match(Uri.parse('https://research.lensai.eu/#/s/answer/quantum')), isNull, ); }); test('hash query: tolerates extra fragment params', () { - final p = BangUrlPattern.parse( - 'https://site.example/#s={{{s}}}', - ); - expect( - p!.match(Uri.parse('https://site.example/#s=foo&page=2')), - 'foo', - ); + final p = BangUrlPattern.parse('https://site.example/#s={{{s}}}'); + expect(p!.match(Uri.parse('https://site.example/#s=foo&page=2')), 'foo'); }); test('fragment-required template rejects URLs without fragment', () { final p = BangUrlPattern.parse( 'https://boards.4chan.org/g/catalog#s={{{s}}}', ); - expect( - p!.match(Uri.parse('https://boards.4chan.org/g/catalog')), - isNull, - ); + expect(p!.match(Uri.parse('https://boards.4chan.org/g/catalog')), isNull); }); }); @@ -238,9 +215,7 @@ void main() { group('BangUrlPattern - tie-break helpers', () { test('more required constants score higher', () { final plain = BangUrlPattern.parse('https://x.com/?q={{{s}}}')!; - final imgs = BangUrlPattern.parse( - 'https://x.com/?q={{{s}}}&tbm=isch', - )!; + final imgs = BangUrlPattern.parse('https://x.com/?q={{{s}}}&tbm=isch')!; expect(imgs.constraintCount, greaterThan(plain.constraintCount)); }); }); diff --git a/packages/flutter_mozilla_components/lib/src/domain/services/gecko_event.dart b/packages/flutter_mozilla_components/lib/src/domain/services/gecko_event.dart index 23d8cc94..f25c408f 100644 --- a/packages/flutter_mozilla_components/lib/src/domain/services/gecko_event.dart +++ b/packages/flutter_mozilla_components/lib/src/domain/services/gecko_event.dart @@ -60,8 +60,7 @@ class GeckoEventService extends GeckoStateEvents { ValueStream get engineReadyStateEvents => _engineStateSubject.stream; ValueStream> get tabListEvents => _tabListSubject.stream; ValueStream get selectedTabEvents => _selectedTabSubject.stream; - ValueStream get restoreCompleteEvents => - _restoreCompleteSubject.stream; + ValueStream get restoreCompleteEvents => _restoreCompleteSubject.stream; Stream get tabContentEvents => _tabContentSubject.stream; Stream get historyEvents => _historySubject.stream;