when closing tab check for parent tab first #155
This commit is contained in:
@@ -293,6 +293,14 @@ class TabRepository extends _$TabRepository {
|
||||
|
||||
if (!ref.mounted) return;
|
||||
|
||||
// Priority 1: Check for parent tab first (if exists and in same container)
|
||||
if (tabState?.parentId != null) {
|
||||
if (sameContainerTabs.any((tab) => tab == tabState?.parentId)) {
|
||||
return _tabsService.selectTab(tabId: tabState!.parentId!);
|
||||
}
|
||||
}
|
||||
|
||||
// Priority 2: Check for previous tab by timestamp
|
||||
final previousTabId = await ref
|
||||
.read(tabDatabaseProvider)
|
||||
.definitionsDrift
|
||||
@@ -305,12 +313,6 @@ class TabRepository extends _$TabRepository {
|
||||
}
|
||||
}
|
||||
|
||||
if (tabState?.parentId != null) {
|
||||
if (sameContainerTabs.any((tab) => tab == tabState?.parentId)) {
|
||||
return _tabsService.selectTab(tabId: tabState!.parentId!);
|
||||
}
|
||||
}
|
||||
|
||||
if (!ref.mounted) return;
|
||||
|
||||
final previousOrderedTabId = await ref
|
||||
|
||||
Reference in New Issue
Block a user