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

+78
View File
@@ -0,0 +1,78 @@
import 'package:cutdex/features/projects/sidebar_category_tabs.dart';
import 'package:cutdex/l10n/app_localizations.dart';
import 'package:cutdex_ui/theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('sidebar categories fit themes, narrow widths and large text', (
tester,
) async {
for (final palette in AppPalette.values) {
for (final brightness in Brightness.values) {
for (final locale in const [Locale('zh'), Locale('en'), Locale('de')]) {
for (final width in [120.0, 180.0, 280.0]) {
var media = false;
await tester.pumpWidget(
MaterialApp(
theme: AppTheme.desktopWorkspaceTheme(
AppTheme.forPalette(palette, brightness),
),
locale: locale,
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: Scaffold(
body: Align(
alignment: Alignment.topLeft,
child: SizedBox(
width: width,
child: MediaQuery(
data: const MediaQueryData(
textScaler: TextScaler.linear(2),
),
child: StatefulBuilder(
builder: (context, setState) => SidebarCategoryTabs(
mediaSelected: media,
onSelected: (value) =>
setState(() => media = value),
),
),
),
),
),
),
),
);
await tester.pumpAndSettle();
final header = tester.getRect(
find.byKey(const Key('sidebar-category-header')),
);
final chat = tester.getRect(
find.byKey(const Key('sidebar-tab-chat')),
);
final resources = tester.getRect(
find.byKey(const Key('sidebar-tab-resources')),
);
expect(header.height, 36);
expect(chat.height, 28);
expect(resources.height, 28);
expect(chat.left - header.left, 12);
expect(header.right - resources.right, 12);
expect(resources.left - chat.right, 4);
await tester.tap(find.byKey(const Key('sidebar-tab-resources')));
await tester.pump();
expect(media, isTrue);
await tester.tap(find.byKey(const Key('sidebar-tab-chat')));
await tester.pump();
expect(media, isFalse);
expect(
tester.takeException(),
isNull,
reason: '$palette $brightness $locale width=$width',
);
}
}
}
}
});
}