Skip to content

Commit be714f6

Browse files
committed
feat(shell_context_menu): implement ShellMenuWorker for asynchronous shell menu operations
1 parent 842c675 commit be714f6

4 files changed

Lines changed: 370 additions & 42 deletions

File tree

‎cb_file_manager/lib/ui/components/common/shared_file_context_menu.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,8 +910,8 @@ class _ContextMenuPopupSubmenuTriggerState
910910
final loader = widget.action.loadChildSections;
911911
if (_sectionsFuture != null || loader == null) return;
912912
final future = () async {
913-
// Paint the loading row/cursor before invoking a potentially blocking
914-
// native Shell extension on the Windows platform thread.
913+
// Paint the loading row/cursor before starting a potentially slow
914+
// native Shell extension discovery.
915915
await WidgetsBinding.instance.endOfFrame;
916916
if (!mounted || !widget.actionContext.mounted) {
917917
return const <ContextMenuSection>[];

‎cb_file_manager/test/ui/widgets/zz_tmp_preview_resize_test.dart‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ void main() {
3838
folderListBloc: bloc,
3939
selectionBloc: selection,
4040
);
41+
addTearDown(() async {
42+
dragSel.dispose();
43+
await selection.close();
44+
width.dispose();
45+
});
4146

4247
await tester.pumpWidget(
4348
RepaintBoundary(
@@ -90,6 +95,7 @@ void main() {
9095
final center = tester.getCenter(handle);
9196

9297
final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
98+
addTearDown(mouse.removePointer);
9399
await mouse.addPointer(location: center);
94100
await tester.pump(const Duration(milliseconds: 300));
95101
await expectLater(
@@ -122,9 +128,5 @@ void main() {
122128
expect(committed, [460]);
123129
expect(width.value, 460);
124130
expect(find.textContaining(' px'), findsNothing);
125-
126-
dragSel.dispose();
127-
await selection.close();
128-
width.dispose();
129131
});
130132
}

0 commit comments

Comments
 (0)