Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mobile][photos] Fix first file not getting selected in swipe-to-select

ashilkneb52989a6e01
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/component/gallery_file_widget.dart b/mobile/apps/photos/lib/ui/viewer/gallery/component/gallery_file_widget.dart
index 46dbd28d87..c5fe147e62 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/component/gallery_file_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/component/gallery_file_widget.dart
@@ -94,6 +94,17 @@ class _GalleryFileWidgetState extends State<GalleryFileWidget> {
_currentPointerId = event.pointer;
// Don't start selection immediately - wait for horizontal swipe detection
},
+ onHover: (event) {
+ // Only handle the initial file selection when swipe becomes active
+ if (swipeActiveNotifier?.value == true &&
+ swipeHelper != null &&
+ !swipeHelper.isActive &&
+ widget.selectedFiles != null &&
+ widget.selectedFiles!.files.isNotEmpty) {
+ // Start selection for the first file when horizontal swipe is detected
+ swipeHelper.startSelection(widget.file);
+ }
+ },
onEnter: (event) {
// Check if horizontal swipe is active before starting or updating selection
if (swipeActiveNotifier?.value == true && swipeHelper != null) {
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
index 26c7e6f74e..efbc0530a7 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
@@ -293,7 +293,6 @@ class GalleryState extends State<Gallery> {
});
widget.selectedFiles?.addListener(_selectedFilesListener);
-
}
@override
@@ -470,7 +469,6 @@ class GalleryState extends State<Gallery> {
}
}
-
Future<FileLoadResult> _loadFiles({int? limit}) async {
_logger.info("Loading ${limit ?? "all"} files");
try {