This commit is contained in:
Fabian Freund
2026-06-12 06:00:10 +02:00
parent 2d13c1b065
commit 0540618bbf
19 changed files with 100 additions and 142 deletions
@@ -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
@@ -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,
@@ -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) {
@@ -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)),
@@ -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<TabTreeEntity>()
.map((entity) {
return _TabTreePreview(
entity: entity,
activeTabId: activeTab,
onClose: onClose,
stackPadding: const Offset(8, 8),
);
})
.toList();
return filteredTabEntities.value.whereType<TabTreeEntity>().map((entity) {
return _TabTreePreview(
entity: entity,
activeTabId: activeTab,
onClose: onClose,
stackPadding: const Offset(8, 8),
);
}).toList();
}, [filteredTabEntities, activeTab]);
return Padding(
@@ -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);
}
}
@@ -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(
@@ -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]);
@@ -77,10 +77,10 @@ class ColorPickerDialog extends HookWidget {
child: const Text('Cancel'),
),
TextButton(
onPressed: () => Navigator.pop<ColorPickerResult?>(
context,
(color: selectedColor.value, useCustomColor: useCustom.value),
),
onPressed: () => Navigator.pop<ColorPickerResult?>(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,