Restore mobile Chats workspace on tab retap

This commit is contained in:
2026-11-07 22:36:06 +00:00
parent 7287ba35c9
commit 9408ec1531
7 changed files with 440 additions and 0 deletions
+29
View File
@@ -253,4 +253,33 @@ void main() {
// Unknown deeper paths still resolve to the default list.
expect(AppRoute.parse('/schedules/1'), AppRoute.pipelines);
});
test('retapping Chats reopens only a retained workspace from its list', () {
final workspace = AppRoute.chatSession('active');
expect(chatRouteForRetap(AppRoute.chat, workspace), workspace);
expect(
chatRouteForRetap(
AppRoute.chat,
workspace,
isValidSession: (id) => id == 'active',
),
workspace,
);
expect(
chatRouteForRetap(
AppRoute.chat,
workspace,
isValidSession: (id) => id == 'other',
),
isNull,
);
expect(chatRouteForRetap(AppRoute.chat, null), isNull);
expect(chatRouteForRetap(AppRoute.chat, AppRoute.chat), isNull);
});
test('retapping Chats while a chat is open does not return to the list', () {
final current = AppRoute.chatSession('active');
expect(chatRouteForRetap(current, AppRoute.chatSession('older')), current);
expect(chatRouteForRetap(AppRoute.pipelines, current), isNull);
});
}