perf(editor): native Windows preview and UI-first timeline navigation (#11)
Gitea CI / Check code and tests (push) Successful in 8m7s
Gitea CI / Build Windows x64 app (push) Successful in 5m48s
Gitea CI / Build Android APK (push) Successful in 5m59s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m17s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m22s
Gitea CI / Gitea CI passed (push) Successful in 2s

This commit was merged in pull request #11.
This commit is contained in:
lingjhf committed 2026-10-07 10:05:14 +00:00
1 parent 0ecf920669
commit b4cb12cbe3
36 files changed
+3292 -148

No files matched your search

+19 -10
View File
@@ -8,6 +8,10 @@ import 'timeline_session.dart';
/// Keeps local timeline navigation out of the authored project document.
final class TimelineViewStateBinding {
static final _initialized = Expando<bool>();
static final _preparing = Expando<Future<void>>();
static bool isPrepared(EditorTimelineSession session) =>
_initialized[session] == true;
TimelineViewStateBinding._(
this.projectId,
@@ -21,16 +25,21 @@ final class TimelineViewStateBinding {
required String timelineId,
required EditorTimelineSession session,
required TimelineViewSettingsRepository repository,
}) async {
if (_initialized[session] == true) return;
var saved = const TimelineViewState();
try {
saved = await repository.load(projectId, timelineId);
} catch (_) {
// Corrupt or unavailable local UI state must not block the timeline.
}
_restore(session, saved);
_initialized[session] = true;
}) {
if (isPrepared(session)) return Future<void>.value();
final pending = _preparing[session];
if (pending != null) return pending;
return _preparing[session] = () async {
var saved = const TimelineViewState();
try {
saved = await repository.load(projectId, timelineId);
} catch (_) {
// Corrupt or unavailable local UI state must not block the timeline.
}
_restore(session, saved);
_initialized[session] = true;
_preparing[session] = null;
}();
}
static FutureOr<TimelineViewStateBinding> attach({