feat(inspector): edit animated effects, strokes and corner distortion
Replace the shadow-only inspector with layered effect and stroke controls and per-corner distortion editors. Share color inputs, layer rows, keyframe controls and property edit boundaries; keep nested selection menus within their property popover and update localized labels. Add property editing, preview interaction and benchmark comparison coverage. Validation: Dart analysis reports no issues and 160 targeted application tests pass. The macOS development app was rebuilt and visually checked during native rendering validation. Exclude local dependency override changes from the committed lockfile.
This commit is contained in:
1 parent
8d1f8db7e8
commit
789af7a68e
58 files changed
+6911
-1972
No files matched your search
@@ -0,0 +1,123 @@
|
||||
import 'package:cutdex/app/editor_theme.dart';
|
||||
import 'package:cutdex/features/preview/preview_panel.dart';
|
||||
import 'package:cutdex/features/properties/distortion_properties.dart';
|
||||
import 'package:cutdex/l10n/app_localizations.dart';
|
||||
import 'package:cutdex_sdk/editor.dart';
|
||||
import 'package:cutdex_sdk/timeline/model.dart';
|
||||
import 'package:cutdex_sdk/timeline/engine.dart';
|
||||
import 'package:cutdex_ui/theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'support/preview_fixture.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets(
|
||||
'four corner fields use paired keys; reset preserves animation; no px',
|
||||
(tester) async {
|
||||
final f = (await tester.runAsync(
|
||||
() => createPreviewFixture(
|
||||
Uri.file('/test/video.mov'),
|
||||
clipDuration: RationalTime.seconds(5),
|
||||
),
|
||||
))!;
|
||||
addTearDown(
|
||||
() => tester.runAsync(() async {
|
||||
await f.workspace.close();
|
||||
await f.directory.delete(recursive: true);
|
||||
}),
|
||||
);
|
||||
final sequence = SequenceId('one'),
|
||||
clip = ElementId('clip'),
|
||||
project = f.workspace.project!.info.id;
|
||||
final view = f.timeline.view(sequence);
|
||||
ElementRecord record() {
|
||||
final q = view.version.kernelVersion.query();
|
||||
return q.element(q.elementById(clip)!);
|
||||
}
|
||||
|
||||
await tester.pumpWidget(
|
||||
ProviderScope(
|
||||
overrides: [
|
||||
editorPreviewProvider(
|
||||
project,
|
||||
'project',
|
||||
).overrideWith((ref) => null),
|
||||
],
|
||||
child: MaterialApp(
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
locale: const Locale('zh'),
|
||||
theme: AppTheme.propertiesPanelTheme(
|
||||
EditorTheme.desktop(EditorTheme.penDark),
|
||||
),
|
||||
home: Scaffold(
|
||||
body: Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: SizedBox(
|
||||
width: 240,
|
||||
child: SingleChildScrollView(
|
||||
child: DistortionProperties(
|
||||
projectId: project,
|
||||
timelineId: 'project',
|
||||
session: f.timeline,
|
||||
sequence: sequence,
|
||||
clip: clip,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
Future<void> settle() async {
|
||||
await tester.pump();
|
||||
await tester.runAsync(f.timeline.flush);
|
||||
await tester.pumpAndSettle();
|
||||
expect(tester.takeException(), isNull);
|
||||
}
|
||||
|
||||
await settle();
|
||||
expect(find.text('变形'), findsOneWidget);
|
||||
expect(find.text('px'), findsNothing);
|
||||
expect(find.text('X'), findsNWidgets(4));
|
||||
expect(find.text('Y'), findsNWidgets(4));
|
||||
expect(find.byType(TextField), findsNWidgets(8));
|
||||
final key = find.byKey(const ValueKey('distortion-topLeft-key'));
|
||||
await tester.tap(key);
|
||||
await settle();
|
||||
for (final id in ClipDistortion.ids.take(2)) {
|
||||
expect(record().parameters![id]!.length, 1);
|
||||
}
|
||||
view.seekTo(TimelineClock.ticksPerSecond);
|
||||
await settle();
|
||||
final input = find.descendant(
|
||||
of: find.byKey(const ValueKey('distortion-topLeft-y')),
|
||||
matching: find.byType(TextField),
|
||||
);
|
||||
await tester.enterText(input, '20');
|
||||
await tester.testTextInput.receiveAction(TextInputAction.done);
|
||||
await settle();
|
||||
for (final id in ClipDistortion.ids.take(2)) {
|
||||
expect(record().parameters![id]!.length, 2);
|
||||
}
|
||||
final y = record().parameters![ClipDistortion.ids[1]]!;
|
||||
expect(y.valueAt(TimelineClock.ticksPerSecond), greaterThan(0));
|
||||
for (final id in ClipDistortion.ids.skip(2)) {
|
||||
expect(record().parameters?[id]?.length ?? 0, 0);
|
||||
}
|
||||
await tester.tap(find.byKey(const ValueKey('distortion-reset')));
|
||||
await settle();
|
||||
expect(record().parameters![ClipDistortion.ids[1]]!.length, 2);
|
||||
expect(
|
||||
record().parameters![ClipDistortion.ids[1]]!.valueAt(
|
||||
TimelineClock.ticksPerSecond,
|
||||
),
|
||||
0,
|
||||
);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user