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,139 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:cutdex/features/properties/picture_edits.dart';
|
||||
import 'package:cutdex_sdk/editor.dart';
|
||||
import 'package:cutdex_sdk/preview.dart';
|
||||
import 'package:cutdex_sdk/runtime.dart';
|
||||
import 'package:cutdex_sdk/timeline/model.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'support/preview_fixture.dart';
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
for (final invalidation in [
|
||||
'dispose',
|
||||
'seek',
|
||||
'version',
|
||||
'sequence',
|
||||
'selection',
|
||||
]) {
|
||||
test(
|
||||
'picture edit cannot publish after $invalidation during pause',
|
||||
() async {
|
||||
final f = await createPreviewFixture(Uri.file('/test/video.mov'));
|
||||
final preview = _PausedPreview(
|
||||
timeline: f.timeline,
|
||||
runtime: CutdexRuntime(),
|
||||
activeSequence: () => f.timeline.activeSequenceId,
|
||||
viewForSequence: f.timeline.view,
|
||||
);
|
||||
final container = ProviderContainer();
|
||||
var disposed = false;
|
||||
addTearDown(() async {
|
||||
if (!disposed) container.dispose();
|
||||
await preview.close();
|
||||
await f.workspace.close();
|
||||
await f.directory.delete(recursive: true);
|
||||
});
|
||||
final sequence = SequenceId('one'), clip = ElementId('clip');
|
||||
final provider = pictureEditsProvider(f.timeline, sequence, clip);
|
||||
container.listen(provider, (_, _) {});
|
||||
final edits = container.read(provider.notifier);
|
||||
var current = true;
|
||||
var applied = 0;
|
||||
final pending = edits.commit(preview, (value) {
|
||||
applied++;
|
||||
return value.copyWith(x: .25);
|
||||
}, isCurrent: () => current);
|
||||
expect(container.read(provider).isLoading, isTrue);
|
||||
switch (invalidation) {
|
||||
case 'dispose':
|
||||
container.dispose();
|
||||
disposed = true;
|
||||
case 'seek':
|
||||
f.timeline.view(sequence).seekTo(1);
|
||||
case 'version':
|
||||
f.timeline.commands.addEffect(
|
||||
sequence: sequence,
|
||||
clip: clip,
|
||||
tick: 0,
|
||||
effectId: 'external',
|
||||
type: ClipEffectType.dropShadow,
|
||||
);
|
||||
case 'sequence':
|
||||
f.timeline.selectSequence(SequenceId('empty'));
|
||||
case 'selection':
|
||||
current = false;
|
||||
}
|
||||
preview.paused.complete();
|
||||
expect(await pending, isFalse);
|
||||
expect(applied, 0);
|
||||
if (!disposed) expect(container.read(provider).hasError, isFalse);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
test(
|
||||
'picture keys wait for the input commit and record its new value',
|
||||
() async {
|
||||
final f = await createPreviewFixture(Uri.file('/test/video.mov'));
|
||||
final preview = _PausedPreview(
|
||||
timeline: f.timeline,
|
||||
runtime: CutdexRuntime(),
|
||||
activeSequence: () => f.timeline.activeSequenceId,
|
||||
viewForSequence: f.timeline.view,
|
||||
);
|
||||
final container = ProviderContainer();
|
||||
addTearDown(() async {
|
||||
container.dispose();
|
||||
await preview.close();
|
||||
await f.workspace.close();
|
||||
await f.directory.delete(recursive: true);
|
||||
});
|
||||
final provider = pictureEditsProvider(
|
||||
f.timeline,
|
||||
SequenceId('one'),
|
||||
ElementId('clip'),
|
||||
);
|
||||
container.listen(provider, (_, _) {});
|
||||
final edits = container.read(provider.notifier);
|
||||
final commit = edits.commit(
|
||||
preview,
|
||||
(v) => v.copyWith(x: .25),
|
||||
isCurrent: () => true,
|
||||
);
|
||||
expect(
|
||||
await edits.commit(
|
||||
preview,
|
||||
(v) => v.copyWith(x: .75),
|
||||
isCurrent: () => true,
|
||||
),
|
||||
isFalse,
|
||||
);
|
||||
final keys = edits.editKeys(
|
||||
preview,
|
||||
TransformChannel.position,
|
||||
isCurrent: () => true,
|
||||
);
|
||||
preview.paused.complete();
|
||||
expect(await commit, isTrue);
|
||||
await keys;
|
||||
expect(edits.animation()!.value.x, .25);
|
||||
expect(edits.animation()!.keyed(TransformChannel.position), isTrue);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
class _PausedPreview extends PreviewController {
|
||||
_PausedPreview({
|
||||
required super.timeline,
|
||||
required super.runtime,
|
||||
required super.activeSequence,
|
||||
required super.viewForSequence,
|
||||
});
|
||||
final paused = Completer<void>();
|
||||
@override
|
||||
Future<void> pauseForCanvasInteraction() => paused.future;
|
||||
}
|
||||
Reference in new issue
Block a user