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
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:
1 parent
aa5255d1e4
commit
2e0033ce2d
260 files changed
+43963
-5591
No files matched your search
@@ -23,6 +23,7 @@ import 'media_import.dart';
|
||||
import 'timeline_session.dart';
|
||||
import 'background_task_registry.dart';
|
||||
import 'timeline_view_state.dart';
|
||||
import 'view_settings.dart';
|
||||
import 'preview_controller_registry.dart';
|
||||
|
||||
import 'package:cutdex_sdk/editor.dart';
|
||||
@@ -200,6 +201,19 @@ class Projects extends _$Projects {
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> closeActiveProject() => _perform(() async {
|
||||
await _workspace.deactivateProject();
|
||||
if (!ref.mounted) return;
|
||||
state = AsyncData(
|
||||
state.requireValue.copyWith(
|
||||
activeProject: null,
|
||||
timeline: null,
|
||||
timelines: const [],
|
||||
assets: const [],
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
Future<bool> open(
|
||||
String path, {
|
||||
String? name,
|
||||
@@ -278,6 +292,8 @@ class Projects extends _$Projects {
|
||||
if (selectedDocument != null) {
|
||||
await _prepareTimeline(active.id, selectedDocument);
|
||||
}
|
||||
// Publish content and its saved layout together to avoid a default-layout frame.
|
||||
await ref.read(projectViewSettingsProvider(active.id).future);
|
||||
checkCurrent();
|
||||
await ref
|
||||
.read(previewControllerRegistryProvider)
|
||||
@@ -327,6 +343,27 @@ class Projects extends _$Projects {
|
||||
}
|
||||
});
|
||||
|
||||
/// Checks destination occupancy without creating or changing any files.
|
||||
/// Creation still checks again to protect against concurrent changes.
|
||||
Future<AppFailure?> validateNewProjectName(String name) async {
|
||||
try {
|
||||
final root = await ref
|
||||
.read(projectLocationSettingsRepositoryProvider)
|
||||
.load();
|
||||
if (root == null || root.trim().isEmpty) return null;
|
||||
final destination = p.join(root, '${name.trim()}.cutdex');
|
||||
if (await FileSystemEntity.type(destination, followLinks: false) !=
|
||||
FileSystemEntityType.notFound) {
|
||||
return const AppFailure(AppErrorCode.projectAlreadyExists);
|
||||
}
|
||||
} on ProjectLocationUnavailableException {
|
||||
// The creation flow presents location failures with a settings action.
|
||||
} on FileSystemException {
|
||||
// Let creation report the access failure through its normal error path.
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Future<bool> createProject(
|
||||
String name, {
|
||||
required String initialTimelineName,
|
||||
|
||||
Reference in new issue
Block a user