From 7e93b52e5e6e9e324448e802653e6383cdeffaa0 Mon Sep 17 00:00:00 2001 From: AmanRajSinghMourya Date: Fri, 4 Jul 2025 23:35:12 +0530 Subject: [PATCH 1/4] Clear selected file after share action --- .../actions/file_selection_actions_widget.dart | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart index 548395a9c4..0103dece2e 100644 --- a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart +++ b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart @@ -480,11 +480,7 @@ class _FileSelectionActionsWidgetState labelText: S.of(context).share, icon: Icons.adaptive.share_outlined, key: shareButtonKey, - onTap: () => shareSelected( - context, - shareButtonKey, - widget.selectedFiles.files.toList(), - ), + onTap: _shareSelectedFiles, ), ); } @@ -524,6 +520,15 @@ class _FileSelectionActionsWidgetState return const SizedBox(); } + Future _shareSelectedFiles() async { + shareSelected( + context, + shareButtonKey, + widget.selectedFiles.files.toList(), + ); + widget.selectedFiles.clearAll(); + } + Future _moveFiles() async { if (split.pendingUploads.isNotEmpty || split.ownedByOtherUsers.isNotEmpty) { widget.selectedFiles From 574803937113a7b3f66b19aac5cfd92f8e81d50b Mon Sep 17 00:00:00 2001 From: AmanRajSinghMourya Date: Fri, 4 Jul 2025 23:37:52 +0530 Subject: [PATCH 2/4] Revert "Clear selected file after share action" This reverts commit 7e93b52e5e6e9e324448e802653e6383cdeffaa0. --- .../actions/file_selection_actions_widget.dart | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart index 0103dece2e..548395a9c4 100644 --- a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart +++ b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart @@ -480,7 +480,11 @@ class _FileSelectionActionsWidgetState labelText: S.of(context).share, icon: Icons.adaptive.share_outlined, key: shareButtonKey, - onTap: _shareSelectedFiles, + onTap: () => shareSelected( + context, + shareButtonKey, + widget.selectedFiles.files.toList(), + ), ), ); } @@ -520,15 +524,6 @@ class _FileSelectionActionsWidgetState return const SizedBox(); } - Future _shareSelectedFiles() async { - shareSelected( - context, - shareButtonKey, - widget.selectedFiles.files.toList(), - ); - widget.selectedFiles.clearAll(); - } - Future _moveFiles() async { if (split.pendingUploads.isNotEmpty || split.ownedByOtherUsers.isNotEmpty) { widget.selectedFiles From bf644477dce6e38fe294422e13627f567e86233c Mon Sep 17 00:00:00 2001 From: AmanRajSinghMourya Date: Fri, 4 Jul 2025 23:39:12 +0530 Subject: [PATCH 3/4] Clear selectedFiles after share action --- .../actions/file_selection_actions_widget.dart | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart index 548395a9c4..0103dece2e 100644 --- a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart +++ b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart @@ -480,11 +480,7 @@ class _FileSelectionActionsWidgetState labelText: S.of(context).share, icon: Icons.adaptive.share_outlined, key: shareButtonKey, - onTap: () => shareSelected( - context, - shareButtonKey, - widget.selectedFiles.files.toList(), - ), + onTap: _shareSelectedFiles, ), ); } @@ -524,6 +520,15 @@ class _FileSelectionActionsWidgetState return const SizedBox(); } + Future _shareSelectedFiles() async { + shareSelected( + context, + shareButtonKey, + widget.selectedFiles.files.toList(), + ); + widget.selectedFiles.clearAll(); + } + Future _moveFiles() async { if (split.pendingUploads.isNotEmpty || split.ownedByOtherUsers.isNotEmpty) { widget.selectedFiles From 87f04dbaa61f214c13fba30f4833c84a5f0f8d31 Mon Sep 17 00:00:00 2001 From: AmanRajSinghMourya Date: Fri, 4 Jul 2025 23:40:29 +0530 Subject: [PATCH 4/4] Minor refractor --- .../file_selection_actions_widget.dart | 78 ++++++++++--------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart index 0103dece2e..8afde97947 100644 --- a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart +++ b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart @@ -423,44 +423,7 @@ class _FileSelectionActionsWidgetState ), labelText: S.of(context).editLocation, icon: Icons.edit_location_alt_outlined, - onTap: () async { - await showBarModalBottomSheet( - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - top: Radius.circular(5), - ), - ), - backgroundColor: getEnteColorScheme(context).backgroundElevated, - barrierColor: backdropFaintDark, - topControl: Stack( - alignment: Alignment.bottomCenter, - children: [ - // This container is for increasing the tap area - Container( - width: double.infinity, - height: 36, - color: Colors.transparent, - ), - Container( - height: 5, - width: 40, - decoration: const BoxDecoration( - color: backgroundElevated2Light, - borderRadius: BorderRadius.all( - Radius.circular(5), - ), - ), - ), - ], - ), - context: context, - builder: (context) { - return UpdateLocationDataWidget( - widget.selectedFiles.files.toList(), - ); - }, - ); - }, + onTap: _editLocation, ), ); } @@ -520,6 +483,45 @@ class _FileSelectionActionsWidgetState return const SizedBox(); } + Future _editLocation() async { + await showBarModalBottomSheet( + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(5), + ), + ), + backgroundColor: getEnteColorScheme(context).backgroundElevated, + barrierColor: backdropFaintDark, + topControl: Stack( + alignment: Alignment.bottomCenter, + children: [ + // This container is for increasing the tap area + Container( + width: double.infinity, + height: 36, + color: Colors.transparent, + ), + Container( + height: 5, + width: 40, + decoration: const BoxDecoration( + color: backgroundElevated2Light, + borderRadius: BorderRadius.all( + Radius.circular(5), + ), + ), + ), + ], + ), + context: context, + builder: (context) { + return UpdateLocationDataWidget( + widget.selectedFiles.files.toList(), + ); + }, + ); + } + Future _shareSelectedFiles() async { shareSelected( context,