feat(workspace): refresh desktop editing experience and prepare 0.1.2
Gitea CI / Build Android APK (pull_request) Canceled after 0s
Gitea CI / Build Windows x64 app (pull_request) Canceled after 0s
Gitea CI / Audit and package Windows x64 (pull_request) Canceled after 0s
Gitea CI / Assemble and validate CI artifacts (pull_request) Canceled after 0s
Gitea CI / Gitea CI passed (pull_request) Canceled after 0s
Gitea CI / Check code and tests (pull_request) Canceled after 6m29s

This commit is contained in:
lingjhf committed 2026-10-09 01:56:01 +08:00
1 parent aa5255d1e4
commit 2e0033ce2d
260 files changed
+43963 -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);
});
}