From 9ae21190f4a39420ea6611245b37f6fc77cebe9f Mon Sep 17 00:00:00 2001 From: Fabian Freund Date: Fri, 25 Jul 2025 22:17:07 +0200 Subject: [PATCH] close all tabs prompt --- .../widgets/sheets/view_tabs.dart | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/view_tabs.dart b/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/view_tabs.dart index 7e172672..a86e5ad6 100644 --- a/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/view_tabs.dart +++ b/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/view_tabs.dart @@ -186,11 +186,39 @@ class _TabSheetHeader extends HookConsumerWidget { TextButton.icon( onPressed: () async { final container = ref.read(selectedContainerProvider); + final result = await showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Close All Tabs'), + content: Text( + (container != null) + ? 'Are you sure you want to close all container tabs?' + : 'Are you sure you want to close all unassigned tabs?', + ), + actions: [ + TextButton( + onPressed: () { + Navigator.pop(context, false); + }, + child: const Text('Cancel'), + ), + TextButton( + onPressed: () { + Navigator.pop(context, true); + }, + child: const Text('Close'), + ), + ], + ); + }, + ); + + if (result == true) { await ref .read(tabDataRepositoryProvider.notifier) .closeAllTabsByContainer(container); - - onClose(); + } }, icon: const Icon(MdiIcons.closeBoxMultiple), label: const Text('Close All'),