Move editor UI into the app and release verified Core dependencies (#14)
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m47s
Gitea CI / Check code and tests (push) Successful in 7m15s
Gitea CI / Build Android APK (push) Successful in 4m6s
Gitea CI / Build Windows x64 app (push) Successful in 3m34s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m29s
Gitea CI / Gitea CI passed (push) Successful in 1s
Gitea Release / Prepare draft Release (push) Failing after 8s
Gitea Release / Upload Android to draft Release (push) Skipped
Gitea Release / Upload Windows to draft Release (push) Skipped
Gitea Release / Verify and publish Release (push) Skipped
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m47s
Gitea CI / Check code and tests (push) Successful in 7m15s
Gitea CI / Build Android APK (push) Successful in 4m6s
Gitea CI / Build Windows x64 app (push) Successful in 3m34s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m29s
Gitea CI / Gitea CI passed (push) Successful in 1s
Gitea Release / Prepare draft Release (push) Failing after 8s
Gitea Release / Upload Android to draft Release (push) Skipped
Gitea Release / Upload Windows to draft Release (push) Skipped
Gitea Release / Verify and publish Release (push) Skipped
This commit was merged in pull request #14.
This commit is contained in:
1 parent
abc1868550
commit
06f1c26681
452 files changed
+43806
-2329
No files matched your search
+156
-49
@@ -7,7 +7,7 @@ import 'package:cutdex/features/media/transcription_dialog.dart';
|
||||
import 'package:cutdex_ui/widgets.dart';
|
||||
import 'package:cutdex_native/cutdex_native.dart';
|
||||
import 'package:cutdex/features/properties/canvas_presets.dart';
|
||||
import 'package:cutdex_sdk/editor.dart';
|
||||
import 'package:cutdex_core/editor.dart';
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
@@ -17,15 +17,19 @@ import 'package:cutdex/features/timeline/timeline_asset_drop_target.dart';
|
||||
import 'package:cutdex/features/media/media_asset_drag.dart';
|
||||
|
||||
import 'dart:io';
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
import 'package:cutdex/workspace/timeline_provider.dart';
|
||||
|
||||
import 'package:cutdex/features/timeline/timeline_panel.dart';
|
||||
import 'package:cutdex/features/properties/properties_panel.dart';
|
||||
import 'package:cutdex/features/properties/picture_properties.dart';
|
||||
import 'package:cutdex_sdk/preview.dart';
|
||||
import 'package:cutdex_preview/cutdex_preview.dart';
|
||||
import 'package:cutdex/features/preview/preview_panel.dart';
|
||||
import 'package:cutdex_sdk/runtime.dart';
|
||||
import 'package:cutdex_core/execution.dart';
|
||||
import 'package:cutdex_native_flutter/cutdex_native_flutter.dart';
|
||||
import 'package:cutdex/features/media/media_panel.dart';
|
||||
import 'package:cutdex/workspace/projects.dart';
|
||||
import 'package:cutdex/workspace/project_state.dart';
|
||||
@@ -35,11 +39,11 @@ import 'package:cutdex/workspace/timeline_session.dart';
|
||||
import 'package:cutdex/workspace/timeline_view_state.dart';
|
||||
import 'package:cutdex/persistence/app_database.dart';
|
||||
import 'package:cutdex/persistence/app_settings_repositories.dart';
|
||||
import 'package:cutdex_sdk/project.dart';
|
||||
import 'package:cutdex_sdk/timeline/model.dart';
|
||||
import 'package:cutdex_sdk/timeline/engine.dart';
|
||||
import 'package:cutdex_sdk/timeline/layout.dart';
|
||||
import 'package:cutdex_sdk/timeline_ui.dart';
|
||||
import 'package:cutdex_core/project.dart';
|
||||
import 'package:cutdex_core/timeline/model.dart';
|
||||
import 'package:cutdex_core/timeline/engine.dart';
|
||||
import 'package:cutdex_core/timeline/layout.dart';
|
||||
import 'package:cutdex_timeline_ui/cutdex_timeline_ui.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
@@ -131,6 +135,94 @@ void main() {
|
||||
await root.delete(recursive: true);
|
||||
});
|
||||
|
||||
for (final direction in [-1.0, 1.0]) {
|
||||
testWidgets('single primary clip stays painted off axis $direction', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
ProviderScope(
|
||||
overrides: [
|
||||
projectsProvider.overrideWith(
|
||||
() => _ViewProjects(session, projectId),
|
||||
),
|
||||
editorTimelineProvider(
|
||||
projectId,
|
||||
'project',
|
||||
).overrideWith((ref) => session),
|
||||
],
|
||||
child: MaterialApp(
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
locale: const Locale('zh'),
|
||||
theme: EditorTheme.penDark,
|
||||
home: Scaffold(
|
||||
body: EditorTimelinePanel(
|
||||
projectId: projectId,
|
||||
timelineId: 'project',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
final surface = find.byKey(const Key('editor-timeline-surface'));
|
||||
final origin = tester.getTopLeft(surface);
|
||||
final size = tester.getSize(surface);
|
||||
final viewport = TimelineViewportRect(
|
||||
width: size.width,
|
||||
height: size.height,
|
||||
);
|
||||
final controller = session.view(session.activeSequenceId!);
|
||||
final base = controller.version;
|
||||
final frame = controller.project(viewport);
|
||||
final clipBounds = controller.presentationBoundsAt(frame, 0);
|
||||
final start = Offset(clipBounds.left + 30, clipBounds.center.dy);
|
||||
final gesture = await tester.startGesture(
|
||||
origin + start,
|
||||
kind: PointerDeviceKind.mouse,
|
||||
);
|
||||
await gesture.moveTo(origin + start + Offset(0, 100 * direction));
|
||||
await tester.pump();
|
||||
expect(tester.takeException(), isNull);
|
||||
expect(controller.isDragging, isTrue);
|
||||
expect(controller.dragRejection, isNull);
|
||||
expect(controller.dragGhost, isNotNull);
|
||||
expect(controller.version, same(base));
|
||||
final ghostBounds = controller.dragGhostBounds(
|
||||
controller.dragGhost!,
|
||||
viewport,
|
||||
);
|
||||
final boundary = tester.renderObject<RenderRepaintBoundary>(
|
||||
find.descendant(of: surface, matching: find.byType(RepaintBoundary)),
|
||||
);
|
||||
await tester.runAsync(() async {
|
||||
final image = await boundary.toImage(pixelRatio: 1);
|
||||
try {
|
||||
final bytes = (await image.toByteData(
|
||||
format: ui.ImageByteFormat.rawRgba,
|
||||
))!;
|
||||
final point = Offset(ghostBounds.left + 30, ghostBounds.bottom - 10);
|
||||
final color = TimelineThemeData.of(tester.element(surface))
|
||||
.visualClipColor
|
||||
.toARGB32();
|
||||
expect(
|
||||
bytes.getUint32(
|
||||
(point.dy.toInt() * image.width + point.dx.toInt()) * 4,
|
||||
),
|
||||
((color & 0xffffff) << 8) | (color >> 24),
|
||||
);
|
||||
} finally {
|
||||
image.dispose();
|
||||
}
|
||||
});
|
||||
await gesture.cancel();
|
||||
expect(controller.version, same(base));
|
||||
expect(controller.canUndo, isFalse);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
|
||||
for (final connected in [false, true]) {
|
||||
test('detach audio is independent and atomic (connected=$connected)', () async {
|
||||
final id = SequenceId('two');
|
||||
@@ -1095,13 +1187,15 @@ void main() {
|
||||
home: Scaffold(
|
||||
body: SizedBox(
|
||||
width: 225,
|
||||
child: PictureProperties(
|
||||
projectId: projectId,
|
||||
timelineId: 'project',
|
||||
session: session,
|
||||
sequence: id,
|
||||
clip: base.query().element(
|
||||
base.query().elementById(ElementId('clip'))!,
|
||||
child: SingleChildScrollView(
|
||||
child: PictureProperties(
|
||||
projectId: projectId,
|
||||
timelineId: 'project',
|
||||
session: session,
|
||||
sequence: id,
|
||||
clip: base.query().element(
|
||||
base.query().elementById(ElementId('clip'))!,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -1114,7 +1208,10 @@ void main() {
|
||||
await tester.tap(find.byKey(const Key('picture-lock')));
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
final label = find.text(labelText);
|
||||
final label = find.descendant(
|
||||
of: find.byKey(ValueKey(fieldKey)),
|
||||
matching: find.text(labelText),
|
||||
);
|
||||
final gesture = await tester.startGesture(
|
||||
tester.getCenter(label),
|
||||
kind: PointerDeviceKind.mouse,
|
||||
@@ -1273,12 +1370,16 @@ void main() {
|
||||
home: Scaffold(
|
||||
body: SizedBox(
|
||||
width: 225,
|
||||
child: PictureProperties(
|
||||
projectId: projectId,
|
||||
timelineId: 'project',
|
||||
session: session,
|
||||
sequence: id,
|
||||
clip: base.query().element(base.query().elementById(clipId)!),
|
||||
child: SingleChildScrollView(
|
||||
child: PictureProperties(
|
||||
projectId: projectId,
|
||||
timelineId: 'project',
|
||||
session: session,
|
||||
sequence: id,
|
||||
clip: base.query().element(
|
||||
base.query().elementById(clipId)!,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -1286,15 +1387,23 @@ void main() {
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
String text(String key) => tester
|
||||
.widget<TextField>(
|
||||
find.descendant(
|
||||
of: find.byKey(ValueKey(key)),
|
||||
matching: find.byType(TextField),
|
||||
),
|
||||
)
|
||||
.controller!
|
||||
.text;
|
||||
TextField field(String key) => tester.widget<TextField>(
|
||||
find.descendant(
|
||||
of: find.byKey(ValueKey(key)),
|
||||
matching: find.byType(TextField),
|
||||
),
|
||||
);
|
||||
String text(String key) => field(key).controller!.text;
|
||||
Iterable<TextField> transformFields() => [
|
||||
for (final key in [
|
||||
'picture-x',
|
||||
'picture-y',
|
||||
'picture-scale-x',
|
||||
'picture-scale-y',
|
||||
'picture-rotation',
|
||||
])
|
||||
field(key),
|
||||
];
|
||||
PreviewVisual visual(ClipTransform value) => PreviewVisual(
|
||||
layerId: 'video',
|
||||
elementId: clipId,
|
||||
@@ -1408,9 +1517,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
await tester.pump();
|
||||
for (final field in tester.widgetList<TextField>(
|
||||
find.byType(TextField),
|
||||
)) {
|
||||
for (final field in transformFields()) {
|
||||
expect(field.enabled, isTrue);
|
||||
expect(field.readOnly, isTrue);
|
||||
expect(field.canRequestFocus, isFalse);
|
||||
@@ -1432,9 +1539,7 @@ void main() {
|
||||
}
|
||||
await edit.end();
|
||||
await tester.pump();
|
||||
for (final field in tester.widgetList<TextField>(
|
||||
find.byType(TextField),
|
||||
)) {
|
||||
for (final field in transformFields()) {
|
||||
expect(field.enabled, isTrue);
|
||||
expect(field.readOnly, isFalse);
|
||||
expect(field.canRequestFocus, isTrue);
|
||||
@@ -1699,18 +1804,20 @@ void main() {
|
||||
home: Scaffold(
|
||||
body: SizedBox(
|
||||
width: 225,
|
||||
child: ListenableBuilder(
|
||||
listenable: view,
|
||||
builder: (_, _) {
|
||||
final query = view.version.kernelVersion.query();
|
||||
return PictureProperties(
|
||||
projectId: projectId,
|
||||
timelineId: 'project',
|
||||
session: session,
|
||||
sequence: id,
|
||||
clip: query.element(query.elementById(clipId)!),
|
||||
);
|
||||
},
|
||||
child: SingleChildScrollView(
|
||||
child: ListenableBuilder(
|
||||
listenable: view,
|
||||
builder: (_, _) {
|
||||
final query = view.version.kernelVersion.query();
|
||||
return PictureProperties(
|
||||
projectId: projectId,
|
||||
timelineId: 'project',
|
||||
session: session,
|
||||
sequence: id,
|
||||
clip: query.element(query.elementById(clipId)!),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user