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
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:
1 parent
aa5255d1e4
commit
abc1868550
260 files changed
+43964
-5591
No files matched your search
@@ -1,4 +1,7 @@
|
||||
import 'package:cutdex/app/editor_theme.dart';
|
||||
import 'package:cutdex/features/properties/project_properties.dart';
|
||||
import 'package:cutdex/features/properties/project_property_row.dart';
|
||||
import 'package:cutdex_ui/theme.dart';
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
@@ -16,6 +19,152 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'support/preview_fixture.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('desktop project values share a right edge across labels', (
|
||||
tester,
|
||||
) async {
|
||||
final f = (await tester.runAsync(
|
||||
() =>
|
||||
createPreviewFixture(Uri.file('/test/photo.png'), mediaType: 'image'),
|
||||
))!;
|
||||
addTearDown(
|
||||
() => tester.runAsync(() async {
|
||||
await f.workspace.close();
|
||||
await f.directory.delete(recursive: true);
|
||||
}),
|
||||
);
|
||||
for (final locale in ['en', 'zh', 'de']) {
|
||||
for (final width in [220.0, 260.0, 320.0]) {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
locale: Locale(locale),
|
||||
theme: EditorTheme.desktop(EditorTheme.penLight),
|
||||
home: Scaffold(
|
||||
body: Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: SizedBox(
|
||||
width: width,
|
||||
height: 600,
|
||||
child: ProjectProperties(session: f.timeline),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
final panelRight = tester.getRect(find.byType(ProjectProperties)).right;
|
||||
expect(
|
||||
tester
|
||||
.getSize(find.byKey(const ValueKey('project-settings-edit')))
|
||||
.height,
|
||||
28,
|
||||
);
|
||||
final rows = find.byWidgetPredicate(
|
||||
(widget) => widget.runtimeType.toString() == '_Info',
|
||||
);
|
||||
expect(rows, findsNWidgets(7));
|
||||
for (var i = 0; i < 7; i++) {
|
||||
final label = find
|
||||
.descendant(of: rows.at(i), matching: find.byType(Text))
|
||||
.first;
|
||||
final value = find
|
||||
.descendant(of: rows.at(i), matching: find.byType(Text))
|
||||
.last;
|
||||
expect(tester.widget<Text>(value).textAlign, TextAlign.right);
|
||||
expect(
|
||||
tester.getTopLeft(label).dy,
|
||||
closeTo(tester.getTopLeft(value).dy, .01),
|
||||
);
|
||||
expect(tester.getRect(label).left, AppInspectorMetrics.padding);
|
||||
expect(
|
||||
find.descendant(
|
||||
of: rows.at(i),
|
||||
matching: find.byType(ProjectPropertyRow),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(
|
||||
tester.getRect(value).right,
|
||||
panelRight - AppInspectorMetrics.padding,
|
||||
reason: '$locale at $width: ${tester.widget<Text>(value).data}',
|
||||
);
|
||||
}
|
||||
expect(tester.takeException(), isNull);
|
||||
}
|
||||
}
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
});
|
||||
|
||||
testWidgets(
|
||||
'long desktop project metadata fits narrow panels in every theme',
|
||||
(tester) async {
|
||||
const name = '海边日落与城市漫游 · 旅行短片的最终版本 / Very long sequence name';
|
||||
for (final palette in AppPalette.values) {
|
||||
for (final brightness in Brightness.values) {
|
||||
for (final width in [220.0, 280.0, 320.0]) {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: AppTheme.desktopWorkspaceTheme(
|
||||
AppTheme.forPalette(palette, brightness),
|
||||
),
|
||||
home: Scaffold(
|
||||
body: Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: SizedBox(
|
||||
width: width,
|
||||
child: const MediaQuery(
|
||||
data: MediaQueryData(
|
||||
textScaler: TextScaler.linear(1.3),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ProjectPropertyRow(label: '时间线名称', value: name),
|
||||
ProjectPropertyRow(
|
||||
label: '项目色彩空间',
|
||||
value: 'HDR · Rec.2020 HLG',
|
||||
),
|
||||
ProjectPropertyRow(
|
||||
label: '画布大小',
|
||||
value: '3840 × 2160 px',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
expect(tester.takeException(), isNull);
|
||||
for (final row in find.byType(ProjectPropertyRow).evaluate()) {
|
||||
final texts = find.descendant(
|
||||
of: find.byWidget(row.widget),
|
||||
matching: find.byType(Text),
|
||||
);
|
||||
expect(tester.getRect(texts.first).left, 12);
|
||||
expect(tester.getRect(texts.last).right, width - 12);
|
||||
expect(
|
||||
tester.getTopLeft(texts.first).dy,
|
||||
closeTo(tester.getTopLeft(texts.last).dy, .01),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
final tooltip = find.ancestor(
|
||||
of: find.text(name),
|
||||
matching: find.byType(Tooltip),
|
||||
);
|
||||
tester.state<TooltipState>(tooltip).ensureTooltipVisible();
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text(name), findsNWidgets(2));
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
},
|
||||
);
|
||||
|
||||
testWidgets('timeline switch does not expose the previous session', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in new issue
Block a user