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

+87
View File
@@ -12,6 +12,62 @@ import 'package:flutter_test/flutter_test.dart';
import 'support/preview_fixture.dart';
void main() {
testWidgets('inactive picture properties ignore replacement notifications', (
tester,
) async {
final fixture = (await tester.runAsync(
() =>
createPreviewFixture(Uri.file('/test/image.png'), mediaType: 'image'),
))!;
addTearDown(
() => tester.runAsync(() async {
await fixture.workspace.close();
await fixture.directory.delete(recursive: true);
}),
);
final view = fixture.timeline.view(SequenceId('one'));
final clip = view.version.kernelVersion.query().element(
view.version.kernelVersion.query().elementById(ElementId('clip'))!,
);
final project = fixture.workspace.project!.info.id;
final container = ProviderContainer(
overrides: [
editorPreviewProvider(project, 'project').overrideWith((ref) => null),
],
);
addTearDown(container.dispose);
Widget host(Widget child) => UncontrolledProviderScope(
container: container,
child: MaterialApp(
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
locale: const Locale('zh'),
theme: EditorTheme.penLight,
home: Scaffold(body: SingleChildScrollView(child: child)),
),
);
await tester.pumpWidget(
host(
PictureProperties(
projectId: project,
timelineId: 'project',
session: fixture.timeline,
sequence: SequenceId('one'),
clip: clip,
),
),
);
await tester.pumpAndSettle();
expect(find.byKey(const ValueKey('picture-x')), findsOneWidget);
await tester.pumpWidget(
host(_NotifyOnMount(() => view.seekTo(TimelineClock.ticksPerSecond))),
);
expect(view.playheadTick, TimelineClock.ticksPerSecond);
expect(find.byType(PictureProperties), findsNothing);
expect(tester.takeException(), isNull);
await tester.pumpWidget(const SizedBox());
});
testWidgets('cursor changes preserve inspector selection subscriptions', (
tester,
) async {
@@ -35,6 +91,17 @@ void main() {
view.setSelection([clip]);
expect(inspector.selectedClips.single.id, ElementId('clip'));
final selectedCount = notifications;
f.timeline.commands.setTransform(
sequence: SequenceId('one'),
clip: ElementId('clip'),
tick: 0,
change: (value) => value.copyWith(x: .25),
);
expect(
notifications,
selectedCount,
reason: 'Property values belong to editors, not selection shell',
);
view.beginScrubbing();
for (var i = 1; i <= 120; i++) {
view.seekTo(i * TimelineClock.ticksPerSecond ~/ 120);
@@ -53,6 +120,7 @@ void main() {
switchedCount,
reason: 'Old sequence listener is detached',
);
await tester.runAsync(f.timeline.flush);
});
testWidgets('static controls stay stable and discard edits after a seek', (
@@ -144,3 +212,22 @@ void main() {
await tester.pumpWidget(const SizedBox.shrink());
});
}
class _NotifyOnMount extends StatefulWidget {
const _NotifyOnMount(this.notify);
final VoidCallback notify;
@override
State<_NotifyOnMount> createState() => _NotifyOnMountState();
}
class _NotifyOnMountState extends State<_NotifyOnMount> {
@override
void initState() {
super.initState();
widget.notify();
}
@override
Widget build(BuildContext context) => const SizedBox();
}