Skip to content

armgit / ente

Public Imported from GitHub
0

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

Polish mobile comment pruning

Manav Rathi9736f88b7f88
diff --git a/mobile/apps/auth/lib/models/code.dart b/mobile/apps/auth/lib/models/code.dart
index a603fa401a..70e3040540 100644
--- a/mobile/apps/auth/lib/models/code.dart
+++ b/mobile/apps/auth/lib/models/code.dart
@@ -33,7 +33,7 @@ class Code {
final Object? err;
bool get hasError => err != null;
- // Unsaved codes use rawData until sync assigns generatedID.
+ // Unsaved codes use rawData until the first save assigns generatedID.
String get selectionKey => generatedID?.toString() ?? rawData;
String get issuerAccount =>
diff --git a/mobile/apps/auth/lib/services/local_backup_service.dart b/mobile/apps/auth/lib/services/local_backup_service.dart
index 19b43d96a2..fedb04c22c 100644
--- a/mobile/apps/auth/lib/services/local_backup_service.dart
+++ b/mobile/apps/auth/lib/services/local_backup_service.dart
@@ -32,6 +32,7 @@ class LocalBackupService {
});
}
+ // Clear any backup password left in secure storage by an earlier install.
Future<void> _clearBackupPasswordIfFreshInstall(
bool hasOptedForOfflineMode,
) async {
diff --git a/mobile/apps/auth/lib/store/code_display_store.dart b/mobile/apps/auth/lib/store/code_display_store.dart
index ae2934f485..4d2dd5bdc9 100644
--- a/mobile/apps/auth/lib/store/code_display_store.dart
+++ b/mobile/apps/auth/lib/store/code_display_store.dart
@@ -37,7 +37,7 @@ class CodeDisplayStore {
isSelectionModeActive.value = false;
}
- // Preserve selections when sync replaces rawData keys with generated IDs.
+ // Preserve selections when rawData keys are replaced by generated IDs.
void reconcileSelections(Iterable<Code> codes) {
final currentSelection = selectedCodeIds.value;
if (currentSelection.isEmpty) {
diff --git a/mobile/apps/auth/lib/ui/settings/data/local_backup/local_backup_experience.dart b/mobile/apps/auth/lib/ui/settings/data/local_backup/local_backup_experience.dart
index fe8d004ab1..e5050c353e 100644
--- a/mobile/apps/auth/lib/ui/settings/data/local_backup/local_backup_experience.dart
+++ b/mobile/apps/auth/lib/ui/settings/data/local_backup/local_backup_experience.dart
@@ -980,6 +980,7 @@ class _LocalBackupExperienceState extends State<LocalBackupExperience> {
).showSnackBar(SnackBar(content: Text(message)));
}
+ // The "On My iPhone" root cannot store files; require a subfolder.
bool _isInvalidIosPath(String path) {
if (!Platform.isIOS) return false;
if (path.isEmpty) return true;
diff --git a/mobile/apps/auth/lib/utils/debug_code_deep_link.dart b/mobile/apps/auth/lib/utils/debug_code_deep_link.dart
index cdb20c3cd3..5586142e6e 100644
--- a/mobile/apps/auth/lib/utils/debug_code_deep_link.dart
+++ b/mobile/apps/auth/lib/utils/debug_code_deep_link.dart
@@ -9,7 +9,7 @@ class DebugCodeDeepLink {
final String codeUri;
}
-// iOS routes otpauth:// to Passwords, so debug automation wraps it in Ente
+// iOS may route otpauth:// to Passwords, so debug automation wraps it in Ente
// Auth's own scheme.
DebugCodeDeepLink? parseDebugCodeDeepLink(String link) {
if (!kDebugMode) return null;
diff --git a/mobile/apps/locker/lib/services/collections/collections_service.dart b/mobile/apps/locker/lib/services/collections/collections_service.dart
index b8484317e6..0bda5a3f34 100644
--- a/mobile/apps/locker/lib/services/collections/collections_service.dart
+++ b/mobile/apps/locker/lib/services/collections/collections_service.dart
@@ -545,6 +545,7 @@ class CollectionService {
keepFiles: true,
skipEventFiring: isBulkDelete,
);
+ // Bulk deletion syncs once after the loop.
if (!isBulkDelete) {
await sync();
await TrashService.instance.syncTrash();
diff --git a/mobile/apps/photos/lib/db/common/conflict_algo.dart b/mobile/apps/photos/lib/db/common/conflict_algo.dart
index 081aacf804..93b587dd2e 100644
--- a/mobile/apps/photos/lib/db/common/conflict_algo.dart
+++ b/mobile/apps/photos/lib/db/common/conflict_algo.dart
@@ -1,7 +1 @@
-enum SqliteAsyncConflictAlgorithm {
- rollback,
- abort,
- fail,
- ignore,
- replace,
-}
+enum SqliteAsyncConflictAlgorithm { rollback, abort, fail, ignore, replace }
diff --git a/mobile/apps/photos/lib/models/metadata/common_keys.dart b/mobile/apps/photos/lib/models/metadata/common_keys.dart
index 1d2007feea..44dbf1665e 100644
--- a/mobile/apps/photos/lib/models/metadata/common_keys.dart
+++ b/mobile/apps/photos/lib/models/metadata/common_keys.dart
@@ -4,4 +4,5 @@ const magicKeyVisibility = 'visibility';
const visibleVisibility = 0;
const archiveVisibility = 1;
+// Do not use hiddenVisibility for hidden files.
const hiddenVisibility = 2;
diff --git a/mobile/apps/photos/lib/models/similar_files.dart b/mobile/apps/photos/lib/models/similar_files.dart
index 7efee07af1..e6d69b478b 100644
--- a/mobile/apps/photos/lib/models/similar_files.dart
+++ b/mobile/apps/photos/lib/models/similar_files.dart
@@ -75,6 +75,7 @@ class SimilarFilesCache {
final bool exact;
List<SimilarFiles>? _similarFilesList;
+ // Milliseconds since epoch.
final int cachedTime;
SimilarFilesCache({
diff --git a/mobile/apps/photos/lib/services/date_parse_service.dart b/mobile/apps/photos/lib/services/date_parse_service.dart
index 195b2edfe2..8b5563f1d3 100644
--- a/mobile/apps/photos/lib/services/date_parse_service.dart
+++ b/mobile/apps/photos/lib/services/date_parse_service.dart
@@ -217,8 +217,7 @@ class DateParseService {
if (p1 >= 1 && p1 <= 31 && p2 >= 1 && p2 <= 12) {
return PartialDate(day: p1, month: p2, year: year);
- }
- else if (p1 >= 1 && p1 <= 12 && p2 >= 1 && p2 <= 31) {
+ } else if (p1 >= 1 && p1 <= 12 && p2 >= 1 && p2 <= 31) {
return PartialDate(day: p2, month: p1, year: year);
}
return PartialDate.empty;
diff --git a/mobile/apps/photos/lib/services/filedata/model/file_data.dart b/mobile/apps/photos/lib/services/filedata/model/file_data.dart
index c144c302e8..c016b10486 100644
--- a/mobile/apps/photos/lib/services/filedata/model/file_data.dart
+++ b/mobile/apps/photos/lib/services/filedata/model/file_data.dart
@@ -92,6 +92,7 @@ class RemoteFaceEmbedding {
final int height;
final int width;
+ // Bits are defined in ml_versions.dart; absent on the wire means legacy 0.
final int flags;
RemoteFaceEmbedding(
@@ -131,6 +132,7 @@ class RemoteClipEmbedding {
final String client;
final List<double> embedding;
+ // Bits are defined in ml_versions.dart; absent on the wire means legacy 0.
final int flags;
RemoteClipEmbedding(
diff --git a/mobile/apps/photos/lib/services/files_service.dart b/mobile/apps/photos/lib/services/files_service.dart
index 8c0e0c903b..dd106fc6bd 100644
--- a/mobile/apps/photos/lib/services/files_service.dart
+++ b/mobile/apps/photos/lib/services/files_service.dart
@@ -218,6 +218,8 @@ class FilesService {
}
}
+ // Note: this method is not used anywhere, but it is kept for future
+ // reference when we add bulk EditTime feature
Future<void> bulkEditTime(List<EnteFile> files, EditTimeSource source) async {
final ListMatch<EnteFile> result = files.splitMatch(
(element) => element.isUploaded,
@@ -277,9 +279,4 @@ class FilesService {
}
}
-enum EditTimeSource {
- fileName,
- exif,
- manualFix,
- manualAdjusted,
-}
+enum EditTimeSource { fileName, exif, manualFix, manualAdjusted }
diff --git a/mobile/apps/photos/lib/services/home_widget_service.dart b/mobile/apps/photos/lib/services/home_widget_service.dart
index 304586e52b..29c26945a5 100644
--- a/mobile/apps/photos/lib/services/home_widget_service.dart
+++ b/mobile/apps/photos/lib/services/home_widget_service.dart
@@ -23,7 +23,9 @@ import 'package:synchronized/synchronized.dart';
enum WidgetStatus {
notSynced,
+ // Some data was cached before the sync stopped or without a widget installed.
syncedPartially,
+ // A widget that previously had data was deliberately cleared.
syncedEmpty,
syncedAll,
}
diff --git a/mobile/apps/photos/lib/services/memories/photo_selector.dart b/mobile/apps/photos/lib/services/memories/photo_selector.dart
index 3ddb093786..86182eac3b 100644
--- a/mobile/apps/photos/lib/services/memories/photo_selector.dart
+++ b/mobile/apps/photos/lib/services/memories/photo_selector.dart
@@ -10,21 +10,11 @@ import "package:photos/models/ml/face/face_with_embedding.dart";
import "package:photos/models/ml/vector.dart";
import "package:photos/services/location_service.dart";
-enum SelectionDistribution {
- none,
- timeBuckets,
- yearRoundRobin,
-}
+enum SelectionDistribution { none, timeBuckets, yearRoundRobin }
-enum SelectionPick {
- ranked,
- geographicFarthest,
-}
+enum SelectionPick { ranked, geographicFarthest }
-enum SelectionSort {
- chronological,
- reverseChronological,
-}
+enum SelectionSort { chronological, reverseChronological }
class SelectionConfig {
final int targetSize;
@@ -37,6 +27,7 @@ class SelectionConfig {
final SelectionPick pick;
final SelectionSort sort;
+ // Fraction of each bucket to retain; 0.3 means 30%.
final double? preNarrowTopPercent;
final bool skipDuplicateCheckOnFirstRound;
@@ -307,8 +298,7 @@ class PhotoSelector {
});
}
- final years = yearToFiles.keys.toList()
- ..sort((a, b) => b.compareTo(a));
+ final years = yearToFiles.keys.toList()..sort((a, b) => b.compareTo(a));
final selected = <Memory>[];
final selectedCreationTimes = <int>[];
diff --git a/mobile/apps/photos/lib/services/search_service.dart b/mobile/apps/photos/lib/services/search_service.dart
index cf5e0c5d82..145fd1eb6d 100644
--- a/mobile/apps/photos/lib/services/search_service.dart
+++ b/mobile/apps/photos/lib/services/search_service.dart
@@ -1611,7 +1611,7 @@ class SearchService {
);
}
}
- // TODO: Add named base locations to search results.
+ // TODO: lau: Add base location names
if (limit == null || tagSearchResults.length < limit) {
final results = await locationService.getFilesInCity(
@@ -1703,8 +1703,7 @@ class SearchService {
),
);
}
- }
- else if (parsedDate.day != null && parsedDate.month != null) {
+ } else if (parsedDate.day != null && parsedDate.month != null) {
final int day = parsedDate.day!;
final int month = parsedDate.month!;
final int? year = parsedDate.year; // nullable for generic dates
diff --git a/mobile/apps/photos/lib/services/smart_memories_trip_calculator_v2.dart b/mobile/apps/photos/lib/services/smart_memories_trip_calculator_v2.dart
index 2af653e2b1..92b76a8e22 100644
--- a/mobile/apps/photos/lib/services/smart_memories_trip_calculator_v2.dart
+++ b/mobile/apps/photos/lib/services/smart_memories_trip_calculator_v2.dart
@@ -87,6 +87,7 @@ class _TripSurfaceCandidate {
class TripMemoriesCalculatorV2 {
static const _maxTemporalGapDays = 15;
+ // Spatial distance constants in this class use kilometers.
static const _tripClusterRadius = 25.0;
static const _chainHopDistance = 800.0;
diff --git a/mobile/apps/photos/lib/settings/local_settings.dart b/mobile/apps/photos/lib/settings/local_settings.dart
index 97ee4793e6..7e98e37eaa 100644
--- a/mobile/apps/photos/lib/settings/local_settings.dart
+++ b/mobile/apps/photos/lib/settings/local_settings.dart
@@ -130,6 +130,7 @@ class LocalSettings {
AppMode? _cachedAppMode;
+ // Session-only so the get-started banner waits until the next launch.
bool localGalleryModeEnabledThisSession = false;
// Carries first-import completion from local-gallery mode into account setup.
diff --git a/mobile/apps/photos/lib/states/detail_page_state.dart b/mobile/apps/photos/lib/states/detail_page_state.dart
index a3eb5c9e66..05ca490da6 100644
--- a/mobile/apps/photos/lib/states/detail_page_state.dart
+++ b/mobile/apps/photos/lib/states/detail_page_state.dart
@@ -2,6 +2,7 @@ import "package:flutter/material.dart";
import "package:flutter/services.dart";
import "package:photos/models/file/file.dart";
+// Scale is relative to the contained image; offset is in logical pixels.
@immutable
class ZoomTransform {
static const ZoomTransform identity = ZoomTransform(
diff --git a/mobile/apps/photos/lib/ui/viewer/file/video_widget_media_kit.dart b/mobile/apps/photos/lib/ui/viewer/file/video_widget_media_kit.dart
index d23acc38a7..3046e19dda 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/video_widget_media_kit.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/video_widget_media_kit.dart
@@ -228,6 +228,7 @@ class _VideoWidgetMediaKitState extends State<VideoWidgetMediaKit>
@override
Widget build(BuildContext context) {
return GestureDetector(
+ // During zoom, keep this recognizer out of multi-touch gesture arenas.
onVerticalDragUpdate: _isGuestView || _isZooming
? null
: (d) {
diff --git a/mobile/apps/photos/lib/ui/viewer/file/video_widget_native.dart b/mobile/apps/photos/lib/ui/viewer/file/video_widget_native.dart
index b74decbb54..fb8cba96c4 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/video_widget_native.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/video_widget_native.dart
@@ -251,6 +251,7 @@ class _VideoWidgetNativeState extends State<VideoWidgetNative>
_logger.info("Clearing cache");
final file = File(_filePath!);
+ // Avoid an observed PathNotFoundException.
if (file.existsSync()) {
file.delete().then((value) {
_logger.info("Cache cleared");
@@ -302,6 +303,7 @@ class _VideoWidgetNativeState extends State<VideoWidgetNative>
}
},
child: GestureDetector(
+ // During zoom, keep this recognizer out of multi-touch gesture arenas.
onVerticalDragUpdate: _isGuestView || _isZooming
? null
: (d) {
diff --git a/mobile/packages/ente_components/lib/components/buttons/button_component.dart b/mobile/packages/ente_components/lib/components/buttons/button_component.dart
index bdf69a9336..c45080220f 100644
--- a/mobile/packages/ente_components/lib/components/buttons/button_component.dart
+++ b/mobile/packages/ente_components/lib/components/buttons/button_component.dart
@@ -55,6 +55,7 @@ class ButtonComponent extends StatefulWidget {
final ValueListenable<String>? progressStatus;
final Widget? leading;
+ // Only popup routes such as dialogs and sheets are dismissed.
final bool dismissModalOnSuccess;
@override
diff --git a/mobile/packages/ente_components/lib/components/pin_input_component.dart b/mobile/packages/ente_components/lib/components/pin_input_component.dart
index ed8b5c72a6..bd576ee890 100644
--- a/mobile/packages/ente_components/lib/components/pin_input_component.dart
+++ b/mobile/packages/ente_components/lib/components/pin_input_component.dart
@@ -30,6 +30,7 @@ class PinInputComponent extends StatefulWidget {
final int length;
final TextEditingController controller;
final bool autofocus;
+ // When false, the caller must update the controller from its own keypad.
final bool useNativeKeyboard;
final bool closeKeyboardWhenCompleted;
final bool obscureText;
diff --git a/mobile/packages/ente_components/lib/components/text_input_component.dart b/mobile/packages/ente_components/lib/components/text_input_component.dart
index 72f2586f3e..f415fb1f5e 100644
--- a/mobile/packages/ente_components/lib/components/text_input_component.dart
+++ b/mobile/packages/ente_components/lib/components/text_input_component.dart
@@ -95,6 +95,7 @@ class TextInputComponent extends StatefulWidget {
final IconData? messageIcon;
final bool isDisabled;
+ // Unlike isDisabled, this keeps enabled styling and selectable text.
final bool readOnly;
final Iterable<String>? autofillHints;
final int? maxLines;
diff --git a/mobile/packages/logging/lib/super_logging.dart b/mobile/packages/logging/lib/super_logging.dart
index 912e9c2626..5c162c5a8c 100644
--- a/mobile/packages/logging/lib/super_logging.dart
+++ b/mobile/packages/logging/lib/super_logging.dart
@@ -77,6 +77,7 @@ class LogConfig {
Duration sentryRetryDelay;
+ // Null disables file logging; empty uses the default directory.
String? logDirPath;
int maxLogFiles;
diff --git a/mobile/packages/network/lib/network.dart b/mobile/packages/network/lib/network.dart
index 76a2b8ece5..467a241e32 100644
--- a/mobile/packages/network/lib/network.dart
+++ b/mobile/packages/network/lib/network.dart
@@ -26,7 +26,7 @@ class Network {
final version = packageInfo.version;
String packageName = packageInfo.packageName;
- // Desktop Auth reports names that must be normalized for production.
+ // Linux reports ente_auth; Windows reports Ente Auth.
if (Platform.isWindows || Platform.isLinux) {
if (packageName == 'ente_auth' || packageName == 'Ente Auth') {
packageName = 'io.ente.auth';