Skip to content

armgit / ente

Public Imported from GitHub
0

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

Polish mobile comment pruning

Manav Rathied7a2a9381fb
diff --git a/mobile/apps/auth/lib/ente_theme_data.dart b/mobile/apps/auth/lib/ente_theme_data.dart
index 22cff7871e..e0875f4bc9 100644
--- a/mobile/apps/auth/lib/ente_theme_data.dart
+++ b/mobile/apps/auth/lib/ente_theme_data.dart
@@ -318,8 +318,7 @@ extension CustomColorScheme on ColorScheme {
? const Color.fromRGBO(0, 0, 0, 1)
: const Color.fromRGBO(48, 48, 48, 1);
- Color get dynamicFABTextColor =>
- const Color.fromRGBO(255, 255, 255, 1); //same for both themes
+ Color get dynamicFABTextColor => const Color.fromRGBO(255, 255, 255, 1);
// todo: use brightness == Brightness.light for changing color for dark/light theme
ButtonStyle? get optionalActionButtonStyle => buildElevatedButtonThemeData(
diff --git a/mobile/apps/photos/lib/core/error-reporting/super_logging.dart b/mobile/apps/photos/lib/core/error-reporting/super_logging.dart
index 58e957aa27..de1d8510ef 100644
--- a/mobile/apps/photos/lib/core/error-reporting/super_logging.dart
+++ b/mobile/apps/photos/lib/core/error-reporting/super_logging.dart
@@ -90,6 +90,7 @@ class LogConfig {
Duration sentryRetryDelay;
+ // Null disables file logging; empty uses the default directory.
String? logDirPath;
int maxLogFiles;
diff --git a/mobile/apps/photos/lib/ente_theme_data.dart b/mobile/apps/photos/lib/ente_theme_data.dart
index 2412eeefbe..51b66701a2 100644
--- a/mobile/apps/photos/lib/ente_theme_data.dart
+++ b/mobile/apps/photos/lib/ente_theme_data.dart
@@ -250,8 +250,7 @@ extension CustomColorScheme on ColorScheme {
? const Color.fromRGBO(0, 0, 0, 1)
: const Color.fromRGBO(48, 48, 48, 1);
- Color get dynamicFABTextColor =>
- const Color.fromRGBO(255, 255, 255, 1); //same for both themes
+ Color get dynamicFABTextColor => const Color.fromRGBO(255, 255, 255, 1);
// todo: use brightness == Brightness.light for changing color for dark/light theme
ButtonStyle? get optionalActionButtonStyle => buildElevatedButtonThemeData(
diff --git a/mobile/apps/photos/lib/services/machine_learning/face_thumbnail_generator.dart b/mobile/apps/photos/lib/services/machine_learning/face_thumbnail_generator.dart
index d9ea66070e..d2771599cf 100644
--- a/mobile/apps/photos/lib/services/machine_learning/face_thumbnail_generator.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/face_thumbnail_generator.dart
@@ -17,7 +17,6 @@ class FaceThumbnailGenerator extends SuperIsolate {
@override
bool get shouldAutomaticDispose => true;
- // Singleton pattern
FaceThumbnailGenerator._privateConstructor();
static final FaceThumbnailGenerator instance =
FaceThumbnailGenerator._privateConstructor();
diff --git a/mobile/apps/photos/lib/services/machine_learning/ml_computer.dart b/mobile/apps/photos/lib/services/machine_learning/ml_computer.dart
index 326c92618b..7d1ea7a552 100644
--- a/mobile/apps/photos/lib/services/machine_learning/ml_computer.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/ml_computer.dart
@@ -32,7 +32,6 @@ class MLComputer extends SuperIsolate {
@override
bool get shouldAutomaticDispose => false;
- // Singleton pattern
MLComputer._privateConstructor();
static final MLComputer instance = MLComputer._privateConstructor();
factory MLComputer() => instance;
diff --git a/mobile/apps/photos/lib/services/sync/remote_sync_service.dart b/mobile/apps/photos/lib/services/sync/remote_sync_service.dart
index 7c4075687b..0e755a6b9d 100644
--- a/mobile/apps/photos/lib/services/sync/remote_sync_service.dart
+++ b/mobile/apps/photos/lib/services/sync/remote_sync_service.dart
@@ -988,8 +988,8 @@ class RemoteSyncService {
});
}
- // For each iOS background slot, check up to four candidates for a local
- // file. If none is local, use the next iCloud-only file.
+ // Prefer a local file in each iOS background slot; otherwise use the next
+ // file in line.
Future<List<EnteFile>> _buildBgUploadQueue(List<EnteFile> files) async {
const maxChecksPerSlot = kMaximumPermissibleUploadsInThrottledMode;
const slots = kMaximumPermissibleUploadsInThrottledMode;
diff --git a/mobile/apps/photos/lib/ui/common/touch_cross_detector.dart b/mobile/apps/photos/lib/ui/common/touch_cross_detector.dart
index 44988c89a4..8db2af043c 100644
--- a/mobile/apps/photos/lib/ui/common/touch_cross_detector.dart
+++ b/mobile/apps/photos/lib/ui/common/touch_cross_detector.dart
@@ -4,6 +4,7 @@ import 'package:flutter/widgets.dart';
// Flutter sends a drag only to the widget where it began. Track the pointer
// globally so widgets can detect it crossing their boundaries.
+// Pressing inside reports enter and hover; releasing inside reports exit.
class TouchCrossDetector extends SingleChildRenderObjectWidget {
const TouchCrossDetector({
super.key,
diff --git a/mobile/apps/photos/lib/ui/components/models/text_input_type_v2.dart b/mobile/apps/photos/lib/ui/components/models/text_input_type_v2.dart
index 99026ed924..8bd81a9a7f 100644
--- a/mobile/apps/photos/lib/ui/components/models/text_input_type_v2.dart
+++ b/mobile/apps/photos/lib/ui/components/models/text_input_type_v2.dart
@@ -1,15 +1,7 @@
import 'package:flutter/material.dart';
import 'package:photos/theme/colors.dart';
-enum TextInputMessageType {
- guide,
-
- error,
-
- alert,
-
- success,
-}
+enum TextInputMessageType { guide, error, alert, success }
class TextInputTheme {
final Color defaultBg;
diff --git a/mobile/apps/photos/lib/ui/home/memories/memory_cover_util.dart b/mobile/apps/photos/lib/ui/home/memories/memory_cover_util.dart
index 398b39282b..2c6154f788 100644
--- a/mobile/apps/photos/lib/ui/home/memories/memory_cover_util.dart
+++ b/mobile/apps/photos/lib/ui/home/memories/memory_cover_util.dart
@@ -22,11 +22,10 @@ int getNextMemoryIndex(List<Memory> memories) {
return lastSeenIndex + 1;
}
-// Cap on how many memory covers to warm on a single pass. Sized against a
-// typical above-the-fold strip; prevents runaway bandwidth when there is a
-// large backlog of unseen memories.
+// Limit warming to above-the-fold covers to avoid runaway downloads.
const int kMemoryCoverWarmCap = 20;
+// Warm originals so opening a memory does not fall back to its thumbnail.
Future<void> warmMemoryCovers(
List<List<Memory>> memoryLists, {
required bool Function() stillActive,
diff --git a/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart
index c6e51a3f4b..1848c56ba1 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart
@@ -147,9 +147,7 @@ class FeedItemWidget extends StatelessWidget {
_FeedTypeIconWithTimeline(
type: feedItem.type,
showTimeline: !isLastItem,
- timelineExtensionHeight: hasSharedPhotos
- ? 400
- : 95,
+ timelineExtensionHeight: hasSharedPhotos ? 400 : 95,
),
const SizedBox(width: 10),
Expanded(
diff --git a/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart b/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart
index 190124a704..3c7278c64a 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart
@@ -178,9 +178,7 @@ class FileAppBarState extends State<FileAppBar> {
child: AppBar(
clipBehavior: Clip.none,
key: ValueKey(isGuestView),
- iconTheme: const IconThemeData(
- color: Colors.white,
- ), //same for both themes
+ iconTheme: const IconThemeData(color: Colors.white),
leading: IconButton(
icon: const Icon(Icons.arrow_back),
onPressed: () {
diff --git a/mobile/apps/photos/lib/ui/viewer/file/file_details_widget.dart b/mobile/apps/photos/lib/ui/viewer/file/file_details_widget.dart
index 08a4c5d563..0d6053bf40 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/file_details_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/file_details_widget.dart
@@ -218,7 +218,6 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {
],
)
: const SizedBox.shrink();
-
},
),
]);
diff --git a/mobile/apps/photos/lib/ui/viewer/file/file_icons_widget.dart b/mobile/apps/photos/lib/ui/viewer/file/file_icons_widget.dart
index 2ceb5e84a9..e9f23fa271 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/file_icons_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/file_icons_widget.dart
@@ -210,9 +210,9 @@ class FileOverlayText extends StatelessWidget {
padding: const EdgeInsets.only(bottom: 5),
child: Text(
text,
- style: Theme.of(context).textTheme.titleSmall!.copyWith(
- color: Colors.white,
- ),
+ style: Theme.of(
+ context,
+ ).textTheme.titleSmall!.copyWith(color: Colors.white),
),
);
}
diff --git a/mobile/apps/photos/lib/ui/viewer/file/zoomable_image.dart b/mobile/apps/photos/lib/ui/viewer/file/zoomable_image.dart
index 0ce92a23cc..0d08f18dd7 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/zoomable_image.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/zoomable_image.dart
@@ -343,6 +343,7 @@ class _ZoomableImageState extends State<ZoomableImage> {
if (file != null) {
_onFileLoaded(file);
} else {
+ // Most network failures return null; retry them like exceptions.
_onFinalImageFetchFailed();
}
})
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
index 27b2247ea1..958db92111 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
@@ -84,6 +84,7 @@ class Gallery extends StatefulWidget {
final bool addHeaderOrFooterEmptyState;
+ // Enables tap-to-select; it does not indicate whether files are selected.
final bool inSelectionMode;
final bool showSelectAll;
@@ -176,6 +177,7 @@ class GalleryState extends State<Gallery> {
_automationScrollIdentifier = _buildAutomationScrollIdentifier(
widget.tagPrefix,
);
+ // Keep the logger name from ending in a dot.
_logTag =
"Gallery_${widget.tagPrefix}${kDebugMode ? "_" + widget.albumName! : ""}_x";
_logger = Logger(_logTag);
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/scroll_bar_with_use_notifier.dart b/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/scroll_bar_with_use_notifier.dart
index 1248015329..6a6f6f14a7 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/scroll_bar_with_use_notifier.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/scroll_bar_with_use_notifier.dart
@@ -4,7 +4,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import "package:flutter/material.dart";
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/swipe_to_select_helper.dart b/mobile/apps/photos/lib/ui/viewer/gallery/swipe_to_select_helper.dart
index c19b67fe0a..86391ca28d 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/swipe_to_select_helper.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/swipe_to_select_helper.dart
@@ -53,6 +53,7 @@ class SwipeToSelectHelper {
_selecting = null;
}
+ // Reversing the drag undoes changes outside the new start-to-pointer range.
void _toggleSelectionToIndex(int toIndex) {
if (_fromIndex == null || _lastToIndex == null || _selecting == null) {
return;
@@ -62,7 +63,6 @@ class SwipeToSelectHelper {
final lastToIndex = _lastToIndex!;
final selecting = _selecting!;
- // Reversing the drag undoes changes outside the new start-to-pointer range.
Set<EnteFile> getRange(int start, int end) {
if (start < end && start >= 0 && end <= allFiles.length) {
return allFiles.getRange(start, end).toSet();
diff --git a/mobile/apps/photos/lib/ui/viewer/location/update_location_data_widget.dart b/mobile/apps/photos/lib/ui/viewer/location/update_location_data_widget.dart
index 246c9c303c..b2cdc8b375 100644
--- a/mobile/apps/photos/lib/ui/viewer/location/update_location_data_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/location/update_location_data_widget.dart
@@ -262,11 +262,7 @@ class _UpdateLocationInfoState extends State<UpdateLocationInfo> {
return Stack(
alignment: Alignment.center,
children: [
- Positioned(
- top: 0,
- key: bottomChildKey,
- child: bottomChild,
- ),
+ Positioned(top: 0, key: bottomChildKey, child: bottomChild),
Positioned(key: topChildKey, child: topChild),
],
);
diff --git a/mobile/apps/photos/lib/ui/viewer/people/file_face_widget.dart b/mobile/apps/photos/lib/ui/viewer/people/file_face_widget.dart
index 98d7ad5544..4ee2480cb4 100644
--- a/mobile/apps/photos/lib/ui/viewer/people/file_face_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/people/file_face_widget.dart
@@ -24,6 +24,7 @@ class FileFaceWidget extends StatefulWidget {
final bool useFullFile;
final bool thumbnailFallback;
+ // Physical pixels; null or non-positive decodes at full resolution.
final int? cachedPixelWidth;
const FileFaceWidget(
diff --git a/mobile/apps/photos/lib/ui/viewer/people/memory_lane_page.dart b/mobile/apps/photos/lib/ui/viewer/people/memory_lane_page.dart
index 235ea2988a..0d25cc7fb4 100644
--- a/mobile/apps/photos/lib/ui/viewer/people/memory_lane_page.dart
+++ b/mobile/apps/photos/lib/ui/viewer/people/memory_lane_page.dart
@@ -1292,10 +1292,7 @@ class _MemoryLaneCard extends StatelessWidget {
final cardShadow = _shadowForCard(distance);
final double emphasisDistance = distance.abs();
- final double activation = (1 - (emphasisDistance * 1.8)).clamp(
- 0.0,
- 1.0,
- );
+ final double activation = (1 - (emphasisDistance * 1.8)).clamp(0.0, 1.0);
final double emphasis = Curves.easeOutQuad.transform(activation);
final double dateOpacity = emphasis;
final double gradientAlpha = 0.6 * emphasis;
diff --git a/mobile/apps/photos/lib/ui/viewer/people/person_face_widget.dart b/mobile/apps/photos/lib/ui/viewer/people/person_face_widget.dart
index 7e5cf40afd..73ea1cb103 100644
--- a/mobile/apps/photos/lib/ui/viewer/people/person_face_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/people/person_face_widget.dart
@@ -34,6 +34,7 @@ class PersonFaceWidget extends StatefulWidget {
final VoidCallback? onErrorCallback;
final bool keepAlive;
+ // Physical pixels; null or non-positive decodes at full resolution.
final int? cachedPixelWidth;
const PersonFaceWidget({
diff --git a/mobile/apps/photos/lib/utils/isolate/isolate_operations.dart b/mobile/apps/photos/lib/utils/isolate/isolate_operations.dart
index eb341bd952..4e7fd51440 100644
--- a/mobile/apps/photos/lib/utils/isolate/isolate_operations.dart
+++ b/mobile/apps/photos/lib/utils/isolate/isolate_operations.dart
@@ -259,7 +259,6 @@ Future<dynamic> isolateFunction(
}
_isolateCache.clear();
return true;
-
}
}
diff --git a/mobile/packages/ui/lib/theme/ente_theme_data.dart b/mobile/packages/ui/lib/theme/ente_theme_data.dart
index 7ce0fa6b57..5ff8ef2754 100644
--- a/mobile/packages/ui/lib/theme/ente_theme_data.dart
+++ b/mobile/packages/ui/lib/theme/ente_theme_data.dart
@@ -313,8 +313,7 @@ extension CustomColorScheme on ColorScheme {
? const Color.fromRGBO(0, 0, 0, 1)
: const Color.fromRGBO(48, 48, 48, 1);
- Color get dynamicFABTextColor =>
- const Color.fromRGBO(255, 255, 255, 1); //same for both themes
+ Color get dynamicFABTextColor => const Color.fromRGBO(255, 255, 255, 1);
// todo: use brightness == Brightness.light for changing color for dark/light
// theme