feat(workspace): 桌面工作区、主题与交互更新,发布 0.1.2
Gitea CI / Check code and tests (push) Successful in 6m37s
Gitea CI / Build Windows x64 app (push) Successful in 3m18s
Gitea CI / Build Android APK (push) Successful in 3m47s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m7s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 50s
Gitea CI / Gitea CI passed (push) Successful in 2s
Gitea Release / Prepare draft Release (push) Successful in 9s
Gitea Release / Upload Android to draft Release (push) Successful in 16s
Gitea Release / Upload Windows to draft Release (push) Successful in 22s
Gitea Release / Verify and publish Release (push) Successful in 14s

This commit was merged in pull request #13.
This commit is contained in:
lingjhf committed 2026-10-08 18:17:12 +00:00
1 parent aa5255d1e4
commit abc1868550
260 files changed
+43964 -5591

No files matched your search

+37
View File
@@ -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,