feat(workspace): 桌面工作区、主题与交互更新,发布 0.1.2
Gitea CI / Check code and tests (push) Successful in 6m37s
Gitea CI / Build Windows x64 app (push) Successful in 3m18s
Gitea CI / Build Android APK (push) Successful in 3m47s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m7s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 50s
Gitea CI / Gitea CI passed (push) Successful in 2s
Gitea Release / Prepare draft Release (push) Successful in 9s
Gitea Release / Upload Android to draft Release (push) Successful in 16s
Gitea Release / Upload Windows to draft Release (push) Successful in 22s
Gitea Release / Verify and publish Release (push) Successful in 14s

This commit was merged in pull request #13.
This commit is contained in:
lingjhf committed 2026-10-08 18:17:12 +00:00
1 parent aa5255d1e4
commit abc1868550
260 files changed
+43964 -5591

No files matched your search

+48 -1
View File
@@ -1,6 +1,7 @@
import 'package:cutdex/errors/app_failure.dart';
import 'package:cutdex/l10n/app_localizations.dart';
import 'package:cutdex/shared/widgets/error_notification_host.dart';
import 'package:cutdex_ui/icons.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@@ -57,7 +58,7 @@ void main() {
expect(copied, contains('code: resourceDownloadHttpFailed'));
expect(copied, contains('HTTP: 503'));
expect(copied, contains('service unavailable'));
expect(find.byIcon(Icons.check), findsOneWidget);
expect(find.byIcon(AppIcons.check), findsOneWidget);
await tester.tap(find.byKey(const Key('close-error-button')));
await tester.pump();
expect(notice, findsNothing);
@@ -101,4 +102,50 @@ void main() {
expect(find.text('Dialog error'), findsNothing);
expect(find.text('Dialog'), findsOneWidget);
});
testWidgets('top message keeps undo available above dialogs', (tester) async {
final host = await mount(tester);
showDialog<void>(
context: tester.element(find.text('Workspace')),
builder: (_) => const AlertDialog(content: Text('Dialog')),
);
await tester.pumpAndSettle();
var restored = false;
host.showMessage(
content: const Text('Project removed'),
actionLabel: 'Undo',
onAction: () => restored = true,
);
await tester.pump();
final notice = find.byKey(const Key('global-message-notification'));
expect(tester.getRect(notice).top, 48);
expect(find.byType(SnackBar), findsNothing);
expect(find.byKey(const Key('copy-error-button')), findsNothing);
await tester.tap(find.text('Undo'));
await tester.pump();
expect(restored, isTrue);
expect(notice, findsNothing);
expect(find.text('Dialog'), findsOneWidget);
});
testWidgets('messages and errors share a queue and dismiss automatically', (
tester,
) async {
final host = await mount(tester);
host.showMessage(content: const Text('Task started'));
host.show(const ErrorNotification(content: Text('Task failed')));
host.showMessage(content: const Text('Token copied'));
await tester.pump();
expect(find.text('Task started'), findsOneWidget);
expect(find.text('Task failed'), findsNothing);
await tester.pump(const Duration(seconds: 4));
expect(find.text('Task started'), findsNothing);
expect(find.text('Task failed'), findsOneWidget);
await tester.pump(const Duration(seconds: 8));
expect(find.text('Task failed'), findsNothing);
expect(find.text('Token copied'), findsOneWidget);
await tester.tap(find.byKey(const Key('close-message-button')));
await tester.pump();
expect(find.text('Token copied'), findsNothing);
});
}