diff --git a/mobile/apps/photos/CLAUDE.md b/mobile/apps/photos/CLAUDE.md index ccd188ff55..1dc576066d 100644 --- a/mobile/apps/photos/CLAUDE.md +++ b/mobile/apps/photos/CLAUDE.md @@ -31,7 +31,10 @@ The Photos app uses two types of packages: **CRITICAL: CI will fail if ANY of these checks fail. Run ALL commands and ensure they ALL pass.** ```bash -# 1. Analyze flutter code for errors and warnings +# 1. Format Dart code +dart format . + +# 2. Analyze flutter code for errors and warnings flutter analyze ``` @@ -164,11 +167,12 @@ lib/ ## Critical Coding Requirements ### 1. Code Quality - MANDATORY -**Every code change MUST pass `flutter analyze` with zero issues** +**Every code change MUST pass `dart format .` and `flutter analyze` with zero issues** +- Run `dart format .` first to format all Dart code - Run `flutter analyze` after EVERY code modification - Resolve ALL issues (info, warning, error) - no exceptions - The codebase has zero issues by default, so any issue is from your changes -- DO NOT commit or consider work complete until `flutter analyze` passes cleanly +- DO NOT commit or consider work complete until both commands pass cleanly ### 2. Component Reuse - MANDATORY **Always try to reuse existing components** diff --git a/mobile/apps/photos/lib/ente_theme_data.dart b/mobile/apps/photos/lib/ente_theme_data.dart index 5b6071cad4..b8b4c4bdaf 100644 --- a/mobile/apps/photos/lib/ente_theme_data.dart +++ b/mobile/apps/photos/lib/ente_theme_data.dart @@ -228,7 +228,7 @@ extension CustomColorScheme on ColorScheme { Color get videoPlayerPrimaryColor => brightness == Brightness.light ? const Color.fromRGBO(0, 179, 60, 1) : const Color.fromRGBO(1, 222, 77, 1); - + Color get videoPlayerBorderColor => brightness == Brightness.light ? const Color(0xFF424242) : const Color(0xFFFFFFFF); diff --git a/mobile/apps/photos/lib/events/create_new_album_event.dart b/mobile/apps/photos/lib/events/create_new_album_event.dart index 2dbf3b72fa..7444d8b7ad 100644 --- a/mobile/apps/photos/lib/events/create_new_album_event.dart +++ b/mobile/apps/photos/lib/events/create_new_album_event.dart @@ -5,4 +5,4 @@ class CreateNewAlbumEvent extends Event { final Collection collection; CreateNewAlbumEvent(this.collection); -} \ No newline at end of file +} diff --git a/mobile/apps/photos/lib/services/date_parse_service.dart b/mobile/apps/photos/lib/services/date_parse_service.dart index 54a018158c..86a4b54896 100644 --- a/mobile/apps/photos/lib/services/date_parse_service.dart +++ b/mobile/apps/photos/lib/services/date_parse_service.dart @@ -110,7 +110,7 @@ class DateParseService { result = _parseStructuredFormats(lowerInput); if (!result.isEmpty) return result; - + final normalized = _normalizeDateString(lowerInput); result = _parseTokenizedDate(normalized); @@ -203,7 +203,7 @@ class DateParseService { } return PartialDate.empty; } - + match = _standardFormatRegex.firstMatch(cleanInput); if (match != null) { final p1 = int.parse(match.group(1)!); diff --git a/mobile/apps/photos/lib/ui/account/password_entry_page.dart b/mobile/apps/photos/lib/ui/account/password_entry_page.dart index f56cdb279a..4eb5fab032 100644 --- a/mobile/apps/photos/lib/ui/account/password_entry_page.dart +++ b/mobile/apps/photos/lib/ui/account/password_entry_page.dart @@ -344,7 +344,8 @@ class _PasswordEntryPageState extends State { const EdgeInsets.symmetric(horizontal: 20, vertical: 8), child: Text( AppLocalizations.of(context).passwordStrength( - passwordStrengthValue: passwordStrengthText,), + passwordStrengthValue: passwordStrengthText, + ), style: TextStyle( color: passwordStrengthColor, ), diff --git a/mobile/apps/photos/lib/ui/settings/developer_settings_widget.dart b/mobile/apps/photos/lib/ui/settings/developer_settings_widget.dart index b0b2c33e4b..251bbc1a31 100644 --- a/mobile/apps/photos/lib/ui/settings/developer_settings_widget.dart +++ b/mobile/apps/photos/lib/ui/settings/developer_settings_widget.dart @@ -14,7 +14,8 @@ class DeveloperSettingsWidget extends StatelessWidget { padding: const EdgeInsets.only(bottom: 20), child: Text( AppLocalizations.of(context).customEndpoint( - endpoint: "${endpointURI.host}:${endpointURI.port}",), + endpoint: "${endpointURI.host}:${endpointURI.port}", + ), style: Theme.of(context).textTheme.bodySmall, ), ); diff --git a/mobile/apps/photos/lib/ui/settings/storage_card_widget.dart b/mobile/apps/photos/lib/ui/settings/storage_card_widget.dart index 839e4cb6cc..577f826805 100644 --- a/mobile/apps/photos/lib/ui/settings/storage_card_widget.dart +++ b/mobile/apps/photos/lib/ui/settings/storage_card_widget.dart @@ -283,7 +283,9 @@ class _StorageCardWidgetState extends State { : const SizedBox.shrink(), Text( AppLocalizations.of(context).availableStorageSpace( - freeAmount: freeSpace, storageUnit: freeSpaceUnit,), + freeAmount: freeSpace, + storageUnit: freeSpaceUnit, + ), style: getEnteTextTheme(context) .mini .copyWith(color: textFaintDark), diff --git a/mobile/apps/photos/lib/ui/sharing/verify_identity_dialog.dart b/mobile/apps/photos/lib/ui/sharing/verify_identity_dialog.dart index f9f04a3da5..96c6e01d14 100644 --- a/mobile/apps/photos/lib/ui/sharing/verify_identity_dialog.dart +++ b/mobile/apps/photos/lib/ui/sharing/verify_identity_dialog.dart @@ -180,7 +180,8 @@ class _VerifyIdentifyDialogState extends State { .shareMyVerificationID(verificationID: verificationID) : AppLocalizations.of(context) .shareTextConfirmOthersVerificationID( - verificationID: verificationID,), + verificationID: verificationID, + ), ); }, child: Container( diff --git a/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart b/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart index 3ce0df1849..805826b44d 100644 --- a/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart +++ b/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart @@ -366,7 +366,8 @@ class _ImageEditorPageState extends State { margin: const EdgeInsets.only(bottom: 24), decoration: BoxDecoration( color: isHovered - ? colorScheme.warning400.withValues(alpha: 0.8) + ? colorScheme.warning400 + .withValues(alpha: 0.8) : Colors.white, shape: BoxShape.circle, ), diff --git a/mobile/apps/photos/lib/ui/tools/free_space_page.dart b/mobile/apps/photos/lib/ui/tools/free_space_page.dart index d768eae36b..ec261a7cf6 100644 --- a/mobile/apps/photos/lib/ui/tools/free_space_page.dart +++ b/mobile/apps/photos/lib/ui/tools/free_space_page.dart @@ -54,7 +54,9 @@ class _FreeSpacePageState extends State { ? AppLocalizations.of(context) .filesBackedUpInAlbum(count: count, formattedNumber: formattedCount) : AppLocalizations.of(context).filesBackedUpFromDevice( - count: count, formattedNumber: formattedCount,); + count: count, + formattedNumber: formattedCount, + ); final informationTextStyle = TextStyle( fontSize: 14, height: 1.3, @@ -121,7 +123,9 @@ class _FreeSpacePageState extends State { Expanded( child: Text( AppLocalizations.of(context).freeUpSpaceSaving( - count: count, formattedSize: formatBytes(status.size),), + count: count, + formattedSize: formatBytes(status.size), + ), style: informationTextStyle, ), ), diff --git a/mobile/apps/photos/lib/ui/viewer/actions/delete_empty_albums.dart b/mobile/apps/photos/lib/ui/viewer/actions/delete_empty_albums.dart index 9a0a23c354..5a2548b872 100644 --- a/mobile/apps/photos/lib/ui/viewer/actions/delete_empty_albums.dart +++ b/mobile/apps/photos/lib/ui/viewer/actions/delete_empty_albums.dart @@ -153,8 +153,9 @@ class _DeleteEmptyAlbumsState extends State { .toString() .padLeft(collections.length.toString().length, '0'); _deleteProgress.value = AppLocalizations.of(context).deleteProgress( - currentlyDeleting: currentlyDeleting, - totalCount: collections.length,); + currentlyDeleting: currentlyDeleting, + totalCount: collections.length, + ); try { await CollectionsService.instance.trashEmptyCollection( collections[i], diff --git a/mobile/apps/photos/lib/ui/viewer/file/video_stream_change.dart b/mobile/apps/photos/lib/ui/viewer/file/video_stream_change.dart index a99aaeede9..0b1248f63d 100644 --- a/mobile/apps/photos/lib/ui/viewer/file/video_stream_change.dart +++ b/mobile/apps/photos/lib/ui/viewer/file/video_stream_change.dart @@ -47,15 +47,16 @@ class _VideoStreamChangeWidgetState extends State { final status = event.status; // Handle different states - will be false for different files or non-processing states - final newProcessingState = widget.file.uploadedFileID == fileId && switch (status) { - PreviewItemStatus.inQueue || - PreviewItemStatus.retry || - PreviewItemStatus.compressing || - PreviewItemStatus.uploading => - true, - _ => false, - }; - + final newProcessingState = widget.file.uploadedFileID == fileId && + switch (status) { + PreviewItemStatus.inQueue || + PreviewItemStatus.retry || + PreviewItemStatus.compressing || + PreviewItemStatus.uploading => + true, + _ => false, + }; + // Only update state if value changed if (isCurrentlyProcessing != newProcessingState) { isCurrentlyProcessing = newProcessingState; diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart index 57c827268b..e37293bbbd 100644 --- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart +++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart @@ -224,7 +224,8 @@ class _GalleryAppBarWidgetState extends State { context, AppLocalizations.of(context) .typeOfGallerGallerytypeIsNotSupportedForRename( - galleryType: "$galleryType",), + galleryType: "$galleryType", + ), ); return; diff --git a/mobile/apps/photos/lib/ui/viewer/people/person_cluster_suggestion.dart b/mobile/apps/photos/lib/ui/viewer/people/person_cluster_suggestion.dart index 7379565cd4..0761b04866 100644 --- a/mobile/apps/photos/lib/ui/viewer/people/person_cluster_suggestion.dart +++ b/mobile/apps/photos/lib/ui/viewer/people/person_cluster_suggestion.dart @@ -104,7 +104,8 @@ class _PersonClustersState extends State { return Center( child: Text( AppLocalizations.of(context).noSuggestionsForPerson( - personName: widget.person.data.name,), + personName: widget.person.data.name, + ), style: getEnteTextTheme(context).largeMuted, ), ); diff --git a/mobile/apps/photos/lib/ui/viewer/people/person_selection_action_widgets.dart b/mobile/apps/photos/lib/ui/viewer/people/person_selection_action_widgets.dart index efdcb8a5a9..989c2a09b1 100644 --- a/mobile/apps/photos/lib/ui/viewer/people/person_selection_action_widgets.dart +++ b/mobile/apps/photos/lib/ui/viewer/people/person_selection_action_widgets.dart @@ -156,7 +156,9 @@ class _LinkContactToPersonSelectionPageState title: context.l10n.linkPersonToEmail(email: emailToLink), icon: Icons.info_outline, body: context.l10n.linkPersonToEmailConfirmation( - personName: personName, email: emailToLink,), + personName: personName, + email: emailToLink, + ), isDismissible: true, buttons: [ ButtonWidget( diff --git a/mobile/apps/photos/lib/utils/local_settings.dart b/mobile/apps/photos/lib/utils/local_settings.dart index 4eef3a32c5..d6bd933d53 100644 --- a/mobile/apps/photos/lib/utils/local_settings.dart +++ b/mobile/apps/photos/lib/utils/local_settings.dart @@ -42,7 +42,7 @@ class LocalSettings { static const kCollectionViewType = "collection_view_type"; static const kCollectionSortDirection = "collection_sort_direction"; static const kShowLocalIDOverThumbnails = "show_local_id_over_thumbnails"; - + // Thumbnail queue configuration keys static const kSmallQueueMaxConcurrent = "small_queue_max_concurrent"; static const kSmallQueueTimeout = "small_queue_timeout_seconds"; @@ -235,39 +235,41 @@ class LocalSettings { } // Thumbnail queue configuration - Small queue - int get smallQueueMaxConcurrent => _prefs.getInt(kSmallQueueMaxConcurrent) ?? 15; - + int get smallQueueMaxConcurrent => + _prefs.getInt(kSmallQueueMaxConcurrent) ?? 15; + int get smallQueueTimeoutSeconds => _prefs.getInt(kSmallQueueTimeout) ?? 60; - + int get smallQueueMaxSize => _prefs.getInt(kSmallQueueMaxSize) ?? 200; - + Future setSmallQueueMaxConcurrent(int value) async { await _prefs.setInt(kSmallQueueMaxConcurrent, value); } - + Future setSmallQueueTimeout(int seconds) async { await _prefs.setInt(kSmallQueueTimeout, seconds); } - + Future setSmallQueueMaxSize(int value) async { await _prefs.setInt(kSmallQueueMaxSize, value); } // Thumbnail queue configuration - Large queue - int get largeQueueMaxConcurrent => _prefs.getInt(kLargeQueueMaxConcurrent) ?? 5; - + int get largeQueueMaxConcurrent => + _prefs.getInt(kLargeQueueMaxConcurrent) ?? 5; + int get largeQueueTimeoutSeconds => _prefs.getInt(kLargeQueueTimeout) ?? 60; - + int get largeQueueMaxSize => _prefs.getInt(kLargeQueueMaxSize) ?? 200; - + Future setLargeQueueMaxConcurrent(int value) async { await _prefs.setInt(kLargeQueueMaxConcurrent, value); } - + Future setLargeQueueTimeout(int seconds) async { await _prefs.setInt(kLargeQueueTimeout, seconds); } - + Future setLargeQueueMaxSize(int value) async { await _prefs.setInt(kLargeQueueMaxSize, value); }