diff --git a/apps/weblibre/lib/features/geckoview/features/tabs/data/database/daos/tab.dart b/apps/weblibre/lib/features/geckoview/features/tabs/data/database/daos/tab.dart index eb00cb42..a7006ee2 100644 --- a/apps/weblibre/lib/features/geckoview/features/tabs/data/database/daos/tab.dart +++ b/apps/weblibre/lib/features/geckoview/features/tabs/data/database/daos/tab.dart @@ -525,12 +525,13 @@ class TabDao extends DatabaseAccessor with $TabDaoMixin { ); } - Future> getUnassignedTabsOlderThan(DateTime threshold) { + Future> getUnassignedRegularTabsOlderThan(DateTime threshold) { final query = selectOnly(db.tab) ..addColumns([db.tab.id]) ..where( db.tab.containerId.isNull() & - db.tab.timestamp.isSmallerThanValue(threshold), + db.tab.timestamp.isSmallerThanValue(threshold) & + db.tab.tabMode.equalsValue(TabModeDbValue.regular), ); return query.map((row) => row.read(db.tab.id)!).get(); diff --git a/apps/weblibre/lib/features/geckoview/features/tabs/domain/repositories/tab.dart b/apps/weblibre/lib/features/geckoview/features/tabs/domain/repositories/tab.dart index c6a4f066..3035608a 100644 --- a/apps/weblibre/lib/features/geckoview/features/tabs/domain/repositories/tab.dart +++ b/apps/weblibre/lib/features/geckoview/features/tabs/domain/repositories/tab.dart @@ -277,7 +277,7 @@ class TabDataRepository extends _$TabDataRepository { final tabIds = await ref .read(tabDatabaseProvider) .tabDao - .getUnassignedTabsOlderThan(threshold); + .getUnassignedRegularTabsOlderThan(threshold); if (tabIds.isNotEmpty) { await ref.read(tabRepositoryProvider.notifier).closeTabs(tabIds); diff --git a/apps/weblibre/lib/features/user/domain/presentation/dialogs/quit_browser_dialog.dart b/apps/weblibre/lib/features/user/domain/presentation/dialogs/quit_browser_dialog.dart index 25864a6b..73ff2d52 100644 --- a/apps/weblibre/lib/features/user/domain/presentation/dialogs/quit_browser_dialog.dart +++ b/apps/weblibre/lib/features/user/domain/presentation/dialogs/quit_browser_dialog.dart @@ -30,7 +30,7 @@ Future showQuitBrowserDialog(BuildContext context) { icon: const Icon(Icons.warning), title: const Text('Quit Browser'), content: const Text( - 'This will properly shutdown the browser and clear private tabs', + 'This will properly shutdown the browser and clear private tab data', ), actions: [ TextButton( diff --git a/apps/weblibre/lib/features/user/domain/presentation/dialogs/switch_profile_dialog.dart b/apps/weblibre/lib/features/user/domain/presentation/dialogs/switch_profile_dialog.dart index 2b32285e..abab3dc2 100644 --- a/apps/weblibre/lib/features/user/domain/presentation/dialogs/switch_profile_dialog.dart +++ b/apps/weblibre/lib/features/user/domain/presentation/dialogs/switch_profile_dialog.dart @@ -33,7 +33,7 @@ Future showSwitchProfileDialog( icon: const Icon(Icons.warning), title: const Text('Switch User'), content: Text( - "Switching to User '$profileName' will require a restart of the Browser.", + "Switching to User '$profileName' will require a restart of the Browser.\n\nPrivate tab data will be cleared on restart.", style: const TextStyle(fontWeight: FontWeight.bold), ), actions: [ diff --git a/apps/weblibre/lib/utils/exit_app.dart b/apps/weblibre/lib/utils/exit_app.dart index dbdf6ae0..3e57804a 100644 --- a/apps/weblibre/lib/utils/exit_app.dart +++ b/apps/weblibre/lib/utils/exit_app.dart @@ -30,11 +30,12 @@ import 'package:weblibre/features/tor/domain/services/tor_proxy.dart'; Future exitApp(ProviderContainer container) async { logger.i('Preparing exit'); - // 1. Close private/isolated tabs (clears browsing data for those contexts) + // 1. Close private tabs (clears browsing data for private contexts). + // Isolated tabs are persistent and should survive app exit. try { await container .read(tabDataRepositoryProvider.notifier) - .closeAllTabs(includeRegular: false); + .closeAllTabs(includeRegular: false, includeIsolated: false); logger.i('Private tabs closed'); } catch (e, st) { logger.e('Failed to close tabs', error: e, stackTrace: st);