feat: the archive picker offers only projects that hold archived sessions

- the archive page passes its project set to the shared picker, built from
  the archived sessions' directories (deduped and sorted by name), so the
  sheet no longer lists every server project
- the restricted picker hides the add-project action: the archive page never
  archives anything, so adding a project there would be pointless
- the picker gained an optional onlyProjects argument; chat archives remain
  reachable through the Chat row
- version 0.6.2+602
This commit is contained in:
blumia committed 2026-11-27 13:36:11 +08:00
1 parent 83e09e8e25
commit 8ac36b1fb1
6 files changed
+56 -12

No files matched your search

+6
View File
@@ -23,6 +23,8 @@ class _FakeTransport implements Transport {
body = [
{'id': 'p1', 'canonical': '/home/me/alpha', 'vcs': 'git'},
{'id': 'p2', 'canonical': '/home/me/beta', 'vcs': 'git'},
// A project with no archived sessions must not be offered.
{'id': 'p3', 'canonical': '/home/me/gamma', 'vcs': 'git'},
];
} else if (r.path == '/api/config/settings') {
body = {'projects': <dynamic>[]};
@@ -92,6 +94,9 @@ void main() {
// back.
await tester.tap(find.text('All projects'));
await tester.pumpAndSettle();
// Only projects with archived sessions are offered; no add-project here.
expect(find.text('Add project'), findsNothing);
expect(find.text('/home/me/gamma'), findsNothing);
await tester.tap(find.text('/home/me/alpha'));
await tester.pumpAndSettle();
expect(find.text('Old alpha'), findsOneWidget);
@@ -132,6 +137,7 @@ void main() {
await tester.tap(find.text('All projects'));
await tester.pumpAndSettle();
expect(find.text('/home/me/gamma'), findsNothing);
await tester.tap(find.text('/home/me/beta'));
await tester.pumpAndSettle();
expect(find.text('Old beta'), findsOneWidget);