Skip to content

Commit 0540618

Browse files
committed
format
1 parent 2d13c1b commit 0540618

19 files changed

Lines changed: 100 additions & 142 deletions

File tree

apps/weblibre/lib/features/bangs/domain/services/reverse_match.dart

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,10 @@ class BangUrlPattern {
145145
if (value == null) return null;
146146
if (!value.startsWith(prefix)) return null;
147147
if (!value.endsWith(suffix)) return null;
148-
final captured =
149-
value.substring(prefix.length, value.length - suffix.length);
148+
final captured = value.substring(
149+
prefix.length,
150+
value.length - suffix.length,
151+
);
150152
return captured.isEmpty ? null : captured;
151153
}
152154

@@ -155,8 +157,10 @@ class BangUrlPattern {
155157
final segment = segments[pathIndex!];
156158
if (!segment.startsWith(prefix)) return null;
157159
if (!segment.endsWith(suffix)) return null;
158-
final captured =
159-
segment.substring(prefix.length, segment.length - suffix.length);
160+
final captured = segment.substring(
161+
prefix.length,
162+
segment.length - suffix.length,
163+
);
160164
return captured.isEmpty ? null : captured;
161165
}
162166

@@ -238,8 +242,9 @@ class BangUrlPattern {
238242
final placeholderValue = scopeComponents.queryParams[sentinelParam]!;
239243
final sentinelStart = placeholderValue.indexOf(_sentinel);
240244
final prefix = placeholderValue.substring(0, sentinelStart);
241-
final suffix =
242-
placeholderValue.substring(sentinelStart + _sentinel.length);
245+
final suffix = placeholderValue.substring(
246+
sentinelStart + _sentinel.length,
247+
);
243248

244249
// The other params in the same scope become required constants.
245250
final required = <String, String>{
@@ -327,8 +332,9 @@ bool _requiredQueryParamsMatch(
327332
/// duplicate-keyed query params (multi-map semantics aren't worth the
328333
/// complexity for our use case).
329334
_Components? _componentsFromUri(Uri uri) {
330-
final segments =
331-
uri.pathSegments.where((s) => s.isNotEmpty).toList(growable: false);
335+
final segments = uri.pathSegments
336+
.where((s) => s.isNotEmpty)
337+
.toList(growable: false);
332338
final all = uri.queryParametersAll;
333339
final params = <String, String>{};
334340
for (final entry in all.entries) {

apps/weblibre/lib/features/geckoview/domain/providers/desktop_mode.dart

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,11 @@ class DesktopMode extends _$DesktopMode {
6464
// landing on a ruled host forces desktop on again, and leaving it reverts
6565
// to the browser-wide default. Watching only the host keeps in-page
6666
// navigations (path/query changes) from clobbering a manual override.
67-
ref.listen(
68-
tabStateProvider(tabId),
69-
(previous, next) {
70-
if (previous?.url.host != next?.url.host) {
71-
state = _resolveForHost(next?.url);
72-
}
73-
},
74-
);
67+
ref.listen(tabStateProvider(tabId), (previous, next) {
68+
if (previous?.url.host != next?.url.host) {
69+
state = _resolveForHost(next?.url);
70+
}
71+
});
7572

7673
// Seed the initial value from the per-site rule (falling back to the
7774
// browser-wide default) so a newly opened tab's menu checkbox matches the

apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/browser_modules/quick_tab_switcher_chip.dart

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,20 +168,21 @@ buildQuickTabSwitcherChipDecoration(
168168
null => null,
169169
},
170170
side: (item, isSelected) => switch (item.color) {
171-
final color? when isSelected => thickContainerSelectedBorder
172-
? BorderSide(
173-
color: ContainerColors.palette(
171+
final color? when isSelected =>
172+
thickContainerSelectedBorder
173+
? BorderSide(
174+
color: ContainerColors.palette(
175+
context,
176+
color,
177+
useCustomColor: item.useCustomColor,
178+
).outlineColor,
179+
width: 2.0,
180+
)
181+
: ContainerColors.palette(
174182
context,
175183
color,
176184
useCustomColor: item.useCustomColor,
177-
).outlineColor,
178-
width: 2.0,
179-
)
180-
: ContainerColors.palette(
181-
context,
182-
color,
183-
useCustomColor: item.useCustomColor,
184-
).selectedBorderSide,
185+
).selectedBorderSide,
185186
final color? => ContainerColors.palette(
186187
context,
187188
color,

apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/sheets/gesture_exclusion_section.dart

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,19 @@ class GestureExclusionSection extends HookConsumerWidget {
9090
bool enabled,
9191
) async {
9292
try {
93-
await ref.read(gestureSettingsRepositoryProvider.notifier).updateSettings(
94-
(current) {
95-
final next = current.excludedSites.toList();
96-
if (enabled) {
97-
// Enabling gestures here => remove the host from the exclusion list.
98-
next.remove(host);
99-
} else if (!next.contains(host)) {
100-
// Disabling gestures here => add the host to the exclusion list.
101-
next.add(host);
102-
}
103-
return current.copyWith.excludedSites(next);
104-
},
105-
);
93+
await ref.read(gestureSettingsRepositoryProvider.notifier).updateSettings((
94+
current,
95+
) {
96+
final next = current.excludedSites.toList();
97+
if (enabled) {
98+
// Enabling gestures here => remove the host from the exclusion list.
99+
next.remove(host);
100+
} else if (!next.contains(host)) {
101+
// Disabling gestures here => add the host to the exclusion list.
102+
next.add(host);
103+
}
104+
return current.copyWith.excludedSites(next);
105+
});
106106
} catch (e, s) {
107107
logger.e('Failed to toggle gesture exclusion', error: e, stackTrace: s);
108108
if (context.mounted) {

apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/tab_view/dialogs/tab_parent_picker.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ class _TabParentPickerSheet extends HookConsumerWidget {
136136
child: ListTile(
137137
leading: const Icon(MdiIcons.fileTreeOutline),
138138
title: const Text('Make standalone'),
139-
subtitle: const Text(
140-
'Detach from current parent',
141-
),
139+
subtitle: const Text('Detach from current parent'),
142140
enabled: movingTab.parentId != null,
143141
onTap: () => Navigator.of(
144142
context,
@@ -173,8 +171,7 @@ class _TabParentPickerSheet extends HookConsumerWidget {
173171
// the one you're currently nested under".
174172
return ListTabPreview(
175173
tabId: candidate.id,
176-
isActive:
177-
candidate.id == movingTab.parentId,
174+
isActive: candidate.id == movingTab.parentId,
178175
onTap: () => Navigator.of(
179176
context,
180177
).pop(_ParentPickerSelected(candidate.id)),

apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/tab_view/tab_tree_view.dart

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,7 @@ class _TabTreesGrid extends HookConsumerWidget {
296296

297297
final row = index ~/ 2;
298298
final tabStart = row * itemSize.height;
299-
final viewportDimension =
300-
scrollController.position.viewportDimension;
299+
final viewportDimension = scrollController.position.viewportDimension;
301300

302301
final targetOffset =
303302
(tabStart - viewportDimension / 2 + itemSize.height / 2).clamp(
@@ -324,17 +323,14 @@ class _TabTreesGrid extends HookConsumerWidget {
324323
}, [filteredTabEntities, activeTab]);
325324

326325
final tabs = useMemoized(() {
327-
return filteredTabEntities.value
328-
.whereType<TabTreeEntity>()
329-
.map((entity) {
330-
return _TabTreePreview(
331-
entity: entity,
332-
activeTabId: activeTab,
333-
onClose: onClose,
334-
stackPadding: const Offset(8, 8),
335-
);
336-
})
337-
.toList();
326+
return filteredTabEntities.value.whereType<TabTreeEntity>().map((entity) {
327+
return _TabTreePreview(
328+
entity: entity,
329+
activeTabId: activeTab,
330+
onClose: onClose,
331+
stackPadding: const Offset(8, 8),
332+
);
333+
}).toList();
338334
}, [filteredTabEntities, activeTab]);
339335

340336
return Padding(

apps/weblibre/lib/features/geckoview/features/open_link_tools/presentation/dialogs/open_shared_content.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@ class OpenSharedContent extends HookConsumerWidget {
143143
unawaited(
144144
Future(() async {
145145
ContainerData? resolved;
146-
final containerRepo = ref.read(
147-
containerRepositoryProvider.notifier,
148-
);
146+
final containerRepo = ref.read(containerRepositoryProvider.notifier);
149147

150148
// Priority: explicit intent container (PWA shortcut) > site
151149
// assignment for the URL > mode default.
@@ -160,9 +158,7 @@ class OpenSharedContent extends HookConsumerWidget {
160158
final siteAssignedId = await containerRepo
161159
.siteAssignedContainerId(Uri.parse(selectionUrlKey));
162160
if (siteAssignedId != null) {
163-
resolved = await containerRepo.getContainerData(
164-
siteAssignedId,
165-
);
161+
resolved = await containerRepo.getContainerData(siteAssignedId);
166162
}
167163
}
168164

apps/weblibre/lib/features/geckoview/features/search/presentation/screens/search.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,7 @@ class SearchScreen extends HookConsumerWidget {
631631
// Whether to surface an in-app close button so the page can be dismissed
632632
// without a system back button/gesture (opt-in, e.g. for e-ink devices).
633633
// Only meaningful when there is a route to pop back to.
634-
final showCloseButton =
635-
context.canPop() && settings.showSearchCloseButton;
634+
final showCloseButton = context.canPop() && settings.showSearchCloseButton;
636635

637636
return Scaffold(
638637
body: SafeArea(

apps/weblibre/lib/features/geckoview/features/tabs/presentation/screens/container_draft_suggestions.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ class ContainerDraftSuggestionsScreen extends HookConsumerWidget {
6262
);
6363

6464
return math.max(
65-
math.min(
66-
calculatedCount,
67-
selectedContainer.value?.tabIds.length ?? 0,
68-
),
65+
math.min(calculatedCount, selectedContainer.value?.tabIds.length ?? 0),
6966
2,
7067
);
7168
}, [screenWidth, selectedContainer.value?.tabIds.length]);

apps/weblibre/lib/features/geckoview/features/tabs/presentation/widgets/color_picker_dialog.dart

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ class ColorPickerDialog extends HookWidget {
7777
child: const Text('Cancel'),
7878
),
7979
TextButton(
80-
onPressed: () => Navigator.pop<ColorPickerResult?>(
81-
context,
82-
(color: selectedColor.value, useCustomColor: useCustom.value),
83-
),
80+
onPressed: () => Navigator.pop<ColorPickerResult?>(context, (
81+
color: selectedColor.value,
82+
useCustomColor: useCustom.value,
83+
)),
8484
child: const Text('Select'),
8585
),
8686
],
@@ -191,11 +191,7 @@ class _CustomSwatch extends StatelessWidget {
191191
Widget build(BuildContext context) {
192192
final colorScheme = Theme.of(context).colorScheme;
193193
final palette = isSelected
194-
? ContainerColors.palette(
195-
context,
196-
selectedColor,
197-
useCustomColor: true,
198-
)
194+
? ContainerColors.palette(context, selectedColor, useCustomColor: true)
199195
: null;
200196
return InkResponse(
201197
onTap: onTap,

0 commit comments

Comments
 (0)