refactor(desktop): reorganize workspace panels and navigation
Gitea CI / Windows x64 and Android (pull_request) Successful in 16m21s
Gitea CI / Gitea CI passed (pull_request) Successful in 3s

This commit is contained in:
lingjhf committed 2026-10-06 12:11:59 +08:00
1 parent 826745b407
commit 1f73765745
92 files changed
+5811 -2650

No files matched your search

+55
View File
@@ -896,6 +896,43 @@ void main() {
},
);
testWidgets('prepared timeline stays visible while provider binds', (
tester,
) async {
final pending = Completer<EditorTimelineSession>();
await tester.pumpWidget(
ProviderScope(
overrides: [
projectsProvider.overrideWith(
() => _CachedViewProjects(session, projectId),
),
editorTimelineProvider(
projectId,
'project',
).overrideWith((ref) => pending.future),
],
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.pump();
expect(find.byKey(const Key('timeline-pending')), findsNothing);
expect(find.byKey(const Key('editor-timeline-surface')), findsOneWidget);
expect(tester.takeException(), isNull);
pending.complete(session);
await tester.pumpWidget(const SizedBox.shrink());
});
testWidgets('timeline switch keeps the toolbar element mounted', (
tester,
) async {
@@ -936,6 +973,13 @@ void main() {
await tester.pumpWidget(panel('project'));
await tester.pumpAndSettle();
final toolbar = tester.element(find.byKey(const Key('timeline-toolbar')));
// Entering the clip enables cut/trim; subsequent motion keeps that state.
session.view(session.activeSequenceId!).seekTo(100);
await tester.pump();
final toolbarWidget = toolbar.widget;
session.view(session.activeSequenceId!).seekTo(200);
await tester.pump();
expect(toolbar.widget, same(toolbarWidget));
await tester.pumpWidget(panel(second.document.id));
await tester.pump();
@@ -3768,3 +3812,14 @@ class _ImportingDropProjects extends _DropProjects {
return _importResult.future;
}
}
class _CachedViewProjects extends _ViewProjects {
_CachedViewProjects(super.session, super.projectId);
@override
EditorTimelineSession? cachedTimelineSession(
String projectId,
String timelineId,
) => projectId == this.projectId && timelineId == session.document.id
? session
: null;
}