Skip to content

armgit / ente

Public Imported from GitHub
0

💚 End-to-end encrypted cloud for everything.

Prune Photos UI comments

Manav Rathi7098730216d6
diff --git a/mobile/apps/photos/lib/ui/components/action_sheet_widget.dart b/mobile/apps/photos/lib/ui/components/action_sheet_widget.dart
index 3d73fd3935..cf5a489a70 100644
--- a/mobile/apps/photos/lib/ui/components/action_sheet_widget.dart
+++ b/mobile/apps/photos/lib/ui/components/action_sheet_widget.dart
@@ -10,11 +10,7 @@ import 'package:photos/ui/components/buttons/button_widget.dart';
enum ActionSheetType { defaultActionSheet, iconOnly }
-/// Compatibility adapter for legacy Photos action sheets.
-///
-/// Preserves existing [ButtonWidget]/[ButtonResult] behavior while rendering
-/// through [BottomSheetComponent]. Prefer [BottomSheetComponent] directly for
-/// new sheets.
+// Legacy adapter; use BottomSheetComponent for new sheets.
Future<ButtonResult?> showActionSheet({
required BuildContext context,
required List<ButtonWidget> buttons,
diff --git a/mobile/apps/photos/lib/ui/components/bottom_action_bar/bottom_action_bar_widget.dart b/mobile/apps/photos/lib/ui/components/bottom_action_bar/bottom_action_bar_widget.dart
index 68ab11e6b1..2d395e6aa4 100644
--- a/mobile/apps/photos/lib/ui/components/bottom_action_bar/bottom_action_bar_widget.dart
+++ b/mobile/apps/photos/lib/ui/components/bottom_action_bar/bottom_action_bar_widget.dart
@@ -65,7 +65,6 @@ class BottomActionBarWidget extends StatelessWidget {
),
const DividerWidget(dividerType: DividerType.bottomBar),
ActionBarWidget(selectedFiles: selectedFiles, onCancel: onCancel),
- // const SizedBox(height: 2)
],
),
);
diff --git a/mobile/apps/photos/lib/ui/components/bottom_action_bar/expanded_menu_widget.dart b/mobile/apps/photos/lib/ui/components/bottom_action_bar/expanded_menu_widget.dart
index b88ec12511..26d5f86c33 100644
--- a/mobile/apps/photos/lib/ui/components/bottom_action_bar/expanded_menu_widget.dart
+++ b/mobile/apps/photos/lib/ui/components/bottom_action_bar/expanded_menu_widget.dart
@@ -21,7 +21,6 @@ class ExpandedMenuWidget extends StatelessWidget {
double combinedHeightOfItems = 0.0;
for (List<BlurMenuItemWidget> group in items) {
- //no divider if there is only one item in the section/group
if (group.length != 1) {
numberOfDividers += (group.length - 1);
}
diff --git a/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_button_widget.dart b/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_button_widget.dart
index 9a03d4ff3c..405e3ec371 100644
--- a/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_button_widget.dart
+++ b/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_button_widget.dart
@@ -2,7 +2,6 @@ import "package:ente_components/ente_components.dart" as components;
import "package:flutter/material.dart";
import "package:hugeicons/hugeicons.dart";
-/// Pass [hugeIcon], or [iconWidget] for custom assets.
class SelectionActionButton extends StatelessWidget {
final String labelText;
final List<List<dynamic>>? hugeIcon;
diff --git a/mobile/apps/photos/lib/ui/components/buttons/button_component_adapter.dart b/mobile/apps/photos/lib/ui/components/buttons/button_component_adapter.dart
index 6c7473bfbc..45336e2718 100644
--- a/mobile/apps/photos/lib/ui/components/buttons/button_component_adapter.dart
+++ b/mobile/apps/photos/lib/ui/components/buttons/button_component_adapter.dart
@@ -11,11 +11,7 @@ import "package:photos/ui/components/models/button_type.dart";
const _loadingSurfaceDelay = Duration(milliseconds: 300);
const _successDisplayDuration = Duration(seconds: 1);
-/// Compatibility bridge from legacy Photos [ButtonWidget] actions to
-/// ente_components [ButtonComponent].
-///
-/// Used by legacy dialog/action-sheet adapters. Prefer [ButtonComponent]
-/// directly for new bottom sheet actions.
+// Legacy adapter; use ButtonComponent for new bottom sheet actions.
class ButtonComponentAdapter extends StatelessWidget {
const ButtonComponentAdapter({required this.button, super.key});
diff --git a/mobile/apps/photos/lib/ui/components/buttons/button_widget.dart b/mobile/apps/photos/lib/ui/components/buttons/button_widget.dart
index ef8c3ecdf3..d324dee04e 100644
--- a/mobile/apps/photos/lib/ui/components/buttons/button_widget.dart
+++ b/mobile/apps/photos/lib/ui/components/buttons/button_widget.dart
@@ -28,36 +28,19 @@ class ButtonWidget extends StatelessWidget {
final bool isDisabled;
final ButtonSize buttonSize;
- ///Setting this flag to true will show a success confirmation as a 'check'
- ///icon once the onTap(). This is expected to be used only if time taken to
- ///execute onTap() takes less than debouce time.
final bool shouldShowSuccessConfirmation;
- ///Setting this flag to false will restrict the loading and success states of
- ///the button from surfacing on the UI. The ExecutionState of the button will
- ///change irrespective of the value of this flag. Only that it won't be
- ///surfaced on the UI
final bool shouldSurfaceExecutionStates;
- /// iconColor should only be specified when we do not want to honor the default
- /// iconColor based on buttonType. Most of the items, default iconColor is what
- /// we need unless we want to pop out the icon in a non-primary button type
final Color? iconColor;
- ///Button action will only work if isInAlert is true
+ // buttonAction is returned only when isInAlert is true.
final ButtonAction? buttonAction;
- ///setting this flag to true will make the button appear like how it would
- ///on dark theme irrespective of the app's theme.
final bool shouldStickToDarkTheme;
- ///isInAlert is to dismiss the alert if the action on the button is completed.
- ///This should be set to true if the alert which uses this button needs to
- ///return the Button's action.
final bool isInAlert;
- /// progressStatus can be used to display information about the action
- /// progress when ExecutionState is in Progress.
final ValueNotifier<String>? progressStatus;
const ButtonWidget({
@@ -93,7 +76,6 @@ class ButtonWidget extends StatelessWidget {
? lightTextTheme
: getEnteTextTheme(context, inverse: true);
final buttonStyle = CustomButtonStyle(
- //Dummy default values since we need to keep these properties non-nullable
defaultButtonColor: Colors.transparent,
defaultBorderColor: Colors.transparent,
defaultIconColor: Colors.transparent,
@@ -209,8 +191,7 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
late Color loadingIconColor;
ValueNotifier<String>? progressStatus;
- ///This is used to store the width of the button in idle state (small button)
- ///to be used as width for the button when the loading/succes states comes.
+ // Keep the idle width while showing loading and success states.
double? widthOfButton;
final _debouncer = Debouncer(const Duration(milliseconds: 300));
Timer? _successResetTimer;
@@ -468,11 +449,7 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
setState(() {});
}
- // when the time taken by widget.onTap is approximately equal to the debounce
- // time, the callback is getting executed when/after the if condition
- // below is executing/executed which results in execution state stuck at
- // idle state. This Future is for delaying the execution of the if
- // condition so that the calback in the debouncer finishes execution before.
+ // Let the debounced callback run before checking its execution state.
await Future.delayed(const Duration(milliseconds: 5));
}
if (executionState == ExecutionState.inProgress ||
@@ -550,8 +527,6 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
navigator.canPop()) {
navigator.pop(ButtonResult(buttonAction, exception));
} else if (exception != null) {
- //This is to show the execution was unsuccessful if the dialog is manually
- //closed before the execution completes.
showGenericErrorDialog(context: context, error: exception).ignore();
}
}
diff --git a/mobile/apps/photos/lib/ui/components/dialog_widget.dart b/mobile/apps/photos/lib/ui/components/dialog_widget.dart
index 0c37336292..cb7f7ad94c 100644
--- a/mobile/apps/photos/lib/ui/components/dialog_widget.dart
+++ b/mobile/apps/photos/lib/ui/components/dialog_widget.dart
@@ -9,11 +9,7 @@ import 'package:photos/models/typedefs.dart';
import "package:photos/ui/components/buttons/button_component_adapter.dart";
import 'package:photos/ui/components/buttons/button_widget.dart';
-/// Compatibility adapter for legacy Photos dialogs.
-///
-/// Preserves existing [ButtonWidget]/[ButtonResult] behavior while rendering
-/// through [BottomSheetComponent]. Prefer [BottomSheetComponent] directly for
-/// new sheets.
+// Legacy adapter; use BottomSheetComponent for new sheets.
Future<ButtonResult?> showDialogWidget({
required BuildContext context,
required String title,
diff --git a/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_child_widgets.dart b/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_child_widgets.dart
index 103b8f470c..257e2bbf54 100644
--- a/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_child_widgets.dart
+++ b/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_child_widgets.dart
@@ -51,9 +51,7 @@ class _TrailingWidgetState extends State<TrailingWidget> {
@override
void didUpdateWidget(covariant TrailingWidget oldWidget) {
super.didUpdateWidget(oldWidget);
- // Handle showExecutionStates flag changes
if (oldWidget.showExecutionStates && !widget.showExecutionStates) {
- // Was true, now false: remove listener and reset to icon
if (_listenerAdded) {
oldWidget.executionStateNotifier.removeListener(
_executionStateListener,
@@ -62,11 +60,9 @@ class _TrailingWidgetState extends State<TrailingWidget> {
}
_setTrailingIcon();
} else if (!oldWidget.showExecutionStates && widget.showExecutionStates) {
- // Was false, now true: add listener
widget.executionStateNotifier.addListener(_executionStateListener);
_listenerAdded = true;
} else if (!widget.showExecutionStates) {
- // Still false: update the trailing icon if props changed
_setTrailingIcon();
}
}
@@ -171,7 +167,6 @@ class LeadingWidget extends StatelessWidget {
final Color? leadingIconColor;
final Widget? leadingIconWidget;
- // leadIconSize default value is 20.
final double leadingIconSize;
const LeadingWidget({
required this.leadingIconSize,
diff --git a/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget_new.dart b/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget_new.dart
index 9dcfcfe76e..2c2f41c51f 100644
--- a/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget_new.dart
+++ b/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget_new.dart
@@ -5,11 +5,6 @@ import 'package:photos/models/typedefs.dart';
import 'package:photos/theme/ente_theme.dart';
import 'package:photos/ui/components/menu_item_widget/menu_item_child_widgets.dart';
-/// A menu item widget with the new design system.
-/// Features:
-/// - 20px border radius
-/// - 16px horizontal padding
-/// - Background color: Light #FFFFFF, Dark #212121
class MenuItemWidgetNew extends StatefulWidget {
final String title;
final String? subText;
@@ -18,52 +13,38 @@ class MenuItemWidgetNew extends StatefulWidget {
final TextStyle? subTextStyle;
final double titleToSubTextSpacing;
- /// Color for the title text
final Color? titleColor;
- /// leading icon can be passed without specifing size of icon,
- /// this component sets size to 20x20 irrespective of passed icon's size
final IconData? leadingIcon;
final Color? leadingIconColor;
final Widget? leadingIconWidget;
- // leadIconSize default value is 20.
final double leadingIconSize;
- /// trailing icon can be passed without size as default size set by
- /// flutter is what this component expects
final IconData? trailingIcon;
final Color? trailingIconColor;
final Widget? trailingWidget;
final bool trailingIconIsMuted;
- /// If provided, add this much extra spacing to the right of the trailing icon.
final double trailingExtraMargin;
final FutureVoidCallback? onTap;
final VoidCallback? onDoubleTap;
final VoidCallback? onLongPress;
final Color? menuItemColor;
- /// Border radius for the menu item, defaults to 20
final double borderRadius;
- /// Inner padding for the menu item.
final EdgeInsetsGeometry padding;
final Color? pressedColor;
- /// disable gesture detector if not used
final bool isGestureDetectorDisabled;
- /// Success state will not be shown if this flag is set to true, only idle and
- /// loading state
final bool showOnlyLoadingState;
final bool surfaceExecutionStates;
- /// To show success state even when execution time < debounce time, set this
- /// flag to true.
final bool alwaysShowSuccessState;
const MenuItemWidgetNew({
@@ -154,7 +135,6 @@ class _MenuItemWidgetNewState extends State<MenuItemWidgetNew> {
final circularRadius = Radius.circular(widget.borderRadius);
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
- // Figma colors: Light #FFFFFF, Dark #212121
final defaultMenuItemColor = isDarkMode
? const Color(0xFF212121)
: const Color(0xFFFFFFFF);
@@ -279,8 +259,6 @@ class _MenuItemWidgetNewState extends State<MenuItemWidgetNew> {
if (widget.pressedColor == null) {
if (hasPassedGestureCallbacks()) {
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
- // Pressed color: Light #F5F5F5, Dark #2C2C2C
- // These are the result of overlaying fillFaintPressed on the base color
menuItemColor = isDarkMode
? const Color(0xFF2C2C2C)
: const Color(0xFFF5F5F5);
diff --git a/mobile/apps/photos/lib/ui/components/models/button_type.dart b/mobile/apps/photos/lib/ui/components/models/button_type.dart
index 87d3c0dd30..d55b1c427b 100644
--- a/mobile/apps/photos/lib/ui/components/models/button_type.dart
+++ b/mobile/apps/photos/lib/ui/components/models/button_type.dart
@@ -50,7 +50,6 @@ enum ButtonType {
return Colors.transparent;
}
- //Returning null to fallback to default color
Color? pressedButtonColor(EnteColorScheme colorScheme) {
if (isPrimary) {
return colorScheme.primary700;
@@ -67,7 +66,6 @@ enum ButtonType {
return null;
}
- //Returning null to fallback to default color
Color? disabledButtonColor(
EnteColorScheme colorScheme,
ButtonSize buttonSize,
@@ -91,7 +89,6 @@ enum ButtonType {
return Colors.transparent;
}
- //Returning null to fallback to default color
Color? pressedBorderColor({
required EnteColorScheme colorScheme,
required ButtonSize buttonSize,
@@ -102,7 +99,6 @@ enum ButtonType {
return null;
}
- //Returning null to fallback to default color
Color? disabledBorderColor(
EnteColorScheme colorScheme,
ButtonSize buttonSize,
@@ -126,11 +122,9 @@ enum ButtonType {
if (this == ButtonType.tertiaryCritical) {
return colorScheme.warning500;
}
- //fallback
return colorScheme.strokeBase;
}
- //Returning null to fallback to default color
Color? pressedIconColor(EnteColorScheme colorScheme, ButtonSize buttonSize) {
if (this == ButtonType.tertiaryCritical) {
return colorScheme.warning700;
@@ -141,7 +135,6 @@ enum ButtonType {
return null;
}
- //Returning null to fallback to default color
Color? disabledIconColor(EnteColorScheme colorScheme, ButtonSize buttonSize) {
if (isPrimary ||
isSecondary ||
@@ -168,11 +161,9 @@ enum ButtonType {
if (this == ButtonType.tertiaryCritical) {
return textTheme.bodyBold.copyWith(color: warning500);
}
- //fallback
return textTheme.bodyBold;
}
- //Returning null to fallback to default color
TextStyle? pressedLabelStyle(
EnteTextTheme textTheme,
EnteColorScheme colorScheme,
@@ -187,7 +178,6 @@ enum ButtonType {
return null;
}
- //Returning null to fallback to default color
TextStyle? disabledLabelStyle(
EnteTextTheme textTheme,
EnteColorScheme colorScheme,
@@ -195,7 +185,6 @@ enum ButtonType {
return textTheme.bodyBold.copyWith(color: colorScheme.textFaint);
}
- //Returning null to fallback to default color
Color? checkIconColor(EnteColorScheme colorScheme) {
if (isSecondary) {
return colorScheme.primary500;
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 07ba7d0390..99026ed924 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,18 +1,13 @@
import 'package:flutter/material.dart';
import 'package:photos/theme/colors.dart';
-/// Message types for TextInputWidgetV2 helper text
enum TextInputMessageType {
- /// Muted helper text, no icon (default)
guide,
- /// Red error text, no icon
error,
- /// Red alert text with warning icon
alert,
- /// Green success text with checkmark icon
success,
}
diff --git a/mobile/apps/photos/lib/ui/components/notification_widget.dart b/mobile/apps/photos/lib/ui/components/notification_widget.dart
index ae5e84c5b8..af286a2108 100644
--- a/mobile/apps/photos/lib/ui/components/notification_widget.dart
+++ b/mobile/apps/photos/lib/ui/components/notification_widget.dart
@@ -6,7 +6,6 @@ import "package:photos/theme/ente_theme.dart";
import 'package:photos/theme/text_style.dart';
import 'package:photos/ui/components/buttons/icon_button_widget.dart';
-// CreateNotificationType enum
enum NotificationType { warning, banner, greenBanner, goldenBanner, notice }
class NotificationWidget extends StatelessWidget {
@@ -121,7 +120,6 @@ class NotificationWidget extends StatelessWidget {
begin: const Offset(0.9, 0.9),
end: const Offset(1.1, 1.1),
delay: 1600.ms,
- // curve: Curves.easeInOut,
)
: Icon(
startIcon,
diff --git a/mobile/apps/photos/lib/ui/components/settings/settings_grouped_card.dart b/mobile/apps/photos/lib/ui/components/settings/settings_grouped_card.dart
index fd0eff3b27..8ce2a7ee61 100644
--- a/mobile/apps/photos/lib/ui/components/settings/settings_grouped_card.dart
+++ b/mobile/apps/photos/lib/ui/components/settings/settings_grouped_card.dart
@@ -1,7 +1,5 @@
import "package:flutter/material.dart";
-/// A container for grouped settings items.
-/// Uses 20px border radius and the standard card colors.
class SettingsGroupedCard extends StatelessWidget {
final List<Widget> children;
@@ -11,7 +9,6 @@ class SettingsGroupedCard extends StatelessWidget {
Widget build(BuildContext context) {
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
- // Card background: Light #FFFFFF, Dark #212121
final cardColor = isDarkMode
? const Color(0xFF212121)
: const Color(0xFFFFFFFF);
diff --git a/mobile/apps/photos/lib/ui/components/text_input_widget.dart b/mobile/apps/photos/lib/ui/components/text_input_widget.dart
index 9574b23894..7f72f7944c 100644
--- a/mobile/apps/photos/lib/ui/components/text_input_widget.dart
+++ b/mobile/apps/photos/lib/ui/components/text_input_widget.dart
@@ -10,8 +10,6 @@ import 'package:photos/models/typedefs.dart';
import 'package:photos/theme/ente_theme.dart';
import 'package:photos/utils/separators_util.dart';
-///To show wrong password state, throw an exception with the message
-///"Incorrect password" in onSubmit.
class TextInputWidget extends StatefulWidget {
final String? label;
final String? message;
@@ -23,12 +21,8 @@ class TextInputWidget extends StatefulWidget {
final int? maxLength;
final double borderRadius;
- ///TextInputWidget will listen to this notifier and executes onSubmit when
- ///notified. Value of this notifier is irrelevant.
final ValueNotifier? submitNotifier;
- ///TextInputWidget will listen to this notifier and clears and unfocuses the
- ///textFiled when notified.
final ValueNotifier? cancelNotifier;
final bool alwaysShowSuccessState;
final bool showOnlyLoadingState;
@@ -38,10 +32,9 @@ class TextInputWidget extends StatefulWidget {
final bool shouldSurfaceExecutionStates;
final TextCapitalization? textCapitalization;
- /// WARNING: Do not use this widget for password input. Create a separate PasswordInputWidget. This widget is becoming bloated and hard to maintain, so will create a PasswordInputWidget and remove this field from this widget in future
+ // Do not extend password handling here; split it into a dedicated widget.
final bool isPasswordInput;
- ///Clear comes in the form of a suffix icon. It is unrelated to onCancel.
final bool isClearable;
final bool shouldUnfocusOnClearOrSubmit;
final FocusNode? focusNode;
@@ -99,8 +92,6 @@ class _TextInputWidgetState extends State<TextInputWidget> {
VoidCallback? _onChangeListener;
VoidCallback? _isEmptyListener;
- ///This is to pass if the TextInputWidget is in a dialog and an error is
- ///thrown in executing onSubmit by passing it as arg in Navigator.pop()
Exception? _exception;
bool _incorrectPassword = false;
@@ -288,6 +279,7 @@ class _TextInputWidgetState extends State<TextInputWidget> {
executionState = ExecutionState.error;
_debouncer.cancelDebounceTimer();
_exception = e is Exception ? e : Exception(e.toString());
+ // "Incorrect password" triggers the inline error state.
if (e.toString().contains("Incorrect password")) {
_logger.warning("Incorrect password");
executionState = ExecutionState.idle;
@@ -306,11 +298,7 @@ class _TextInputWidgetState extends State<TextInputWidget> {
setState(() {});
}
- // when the time taken by widget.onSubmit is approximately equal to the debounce
- // time, the callback is getting executed when/after the if condition
- // below is executing/executed which results in execution state stuck at
- // idle state. This Future is for delaying the execution of the if
- // condition so that the calback in the debouncer finishes execution before.
+ // Let the debounced callback run before checking its execution state.
await Future.delayed(const Duration(milliseconds: 5));
if (executionState == ExecutionState.inProgress ||
executionState == ExecutionState.error) {
diff --git a/mobile/apps/photos/lib/ui/components/text_input_widget_v2.dart b/mobile/apps/photos/lib/ui/components/text_input_widget_v2.dart
index afc2e428c1..238e22773a 100644
--- a/mobile/apps/photos/lib/ui/components/text_input_widget_v2.dart
+++ b/mobile/apps/photos/lib/ui/components/text_input_widget_v2.dart
@@ -12,11 +12,6 @@ import 'package:photos/theme/ente_theme.dart';
import 'package:photos/theme/text_style.dart';
import 'package:photos/ui/components/models/text_input_type_v2.dart';
-/// A styled text input widget with built-in support for submission states,
-/// password visibility toggling, clearable input, and validation messages.
-///
-/// To show a wrong-password state, throw an exception containing
-/// "Incorrect password" in [onSubmit].
class TextInputWidgetV2 extends StatefulWidget {
final String? label;
final String? message;
@@ -25,12 +20,8 @@ class TextInputWidgetV2 extends StatefulWidget {
final bool? autoFocus;
final int? maxLength;
- /// The widget listens to this notifier and executes [onSubmit] when notified.
- /// The value of this notifier is irrelevant.
final ValueNotifier? submitNotifier;
- /// The widget listens to this notifier and clears and unfocuses the
- /// text field when notified.
final ValueNotifier? cancelNotifier;
final bool alwaysShowSuccessState;
final bool showOnlyLoadingState;
@@ -41,7 +32,6 @@ class TextInputWidgetV2 extends StatefulWidget {
final TextCapitalization? textCapitalization;
final bool isPasswordInput;
- /// Shows a clear (x) icon as a trailing widget. Unrelated to [onCancel].
final bool isClearable;
final bool shouldUnfocusOnClearOrSubmit;
final FocusNode? focusNode;
@@ -132,8 +122,6 @@ class _TextInputWidgetV2State extends State<TextInputWidgetV2>
bool _isFocused = false;
bool _incorrectPassword = false;
- /// Stored so it can be passed via Navigator.pop() when the widget is used
- /// inside a dialog and [popNavAfterSubmission] is true.
Exception? _exception;
@override
@@ -543,6 +531,7 @@ class _TextInputWidgetV2State extends State<TextInputWidgetV2>
_executionState = ExecutionState.error;
_debouncer.cancelDebounceTimer();
_exception = e is Exception ? e : Exception(e.toString());
+ // "Incorrect password" triggers the inline error state.
if (e.toString().contains('Incorrect password')) {
_logger.warning('Incorrect password');
_executionState = ExecutionState.idle;
@@ -565,10 +554,7 @@ class _TextInputWidgetV2State extends State<TextInputWidgetV2>
_syncLoadingController();
}
- // When onSubmit takes roughly as long as the debounce duration, the
- // debounce callback can fire during or after the checks below, leaving
- // the state stuck at idle. This short delay lets the debouncer finish
- // first.
+ // Let the debounced callback run before checking its execution state.
await Future.delayed(const Duration(milliseconds: 5));
if (_executionState == ExecutionState.inProgress ||
diff --git a/mobile/apps/photos/lib/ui/home/christmas/christmas_pull_animation.dart b/mobile/apps/photos/lib/ui/home/christmas/christmas_pull_animation.dart
index c5bb1f23a4..c6205f7268 100644
--- a/mobile/apps/photos/lib/ui/home/christmas/christmas_pull_animation.dart
+++ b/mobile/apps/photos/lib/ui/home/christmas/christmas_pull_animation.dart
@@ -1,8 +1,6 @@
import "package:flutter/material.dart";
import "package:rive/rive.dart" as rive;
-/// Overlay widget that appears at the top of the screen when pulling down.
-/// This shows the Merry Christmas animation with the duck character.
class ChristmasPullOverlay extends StatefulWidget {
final double pullOffset;
final bool isReleased;
@@ -42,12 +40,10 @@ class _ChristmasPullOverlayState extends State<ChristmasPullOverlay> {
void didUpdateWidget(ChristmasPullOverlay oldWidget) {
super.didUpdateWidget(oldWidget);
- // Set trigger to true when pulled past threshold
if (widget.pullOffset >= widget.triggerThreshold) {
_triggerInput?.value = true;
}
- // Set trigger to false when released
if (widget.isReleased) {
_triggerInput?.value = false;
}
diff --git a/mobile/apps/photos/lib/ui/home/christmas/christmas_utils.dart b/mobile/apps/photos/lib/ui/home/christmas/christmas_utils.dart
index 541380a0fd..f08a180ba9 100644
--- a/mobile/apps/photos/lib/ui/home/christmas/christmas_utils.dart
+++ b/mobile/apps/photos/lib/ui/home/christmas/christmas_utils.dart
@@ -1,13 +1,10 @@
import "package:photos/service_locator.dart";
-/// Returns true if the current date is within the Christmas period (Dec 24-26).
bool isChristmasDateRange() {
final now = DateTime.now();
return now.month == 12 && now.day >= 24 && now.day <= 26;
}
-/// Returns true if the current date is within the Christmas period (Dec 24-26)
-/// and the Christmas banner setting is enabled.
bool isChristmasPeriod() {
if (!localSettings.isChristmasBannerEnabled) {
return false;
diff --git a/mobile/apps/photos/lib/ui/home/grant_permissions_widget.dart b/mobile/apps/photos/lib/ui/home/grant_permissions_widget.dart
index 333a80ef2b..121468ac45 100644
--- a/mobile/apps/photos/lib/ui/home/grant_permissions_widget.dart
+++ b/mobile/apps/photos/lib/ui/home/grant_permissions_widget.dart
@@ -275,8 +275,6 @@ class _GrantPermissionsWidgetState extends State<GrantPermissionsWidget> {
await permissionService.onUpdatePermission(state);
await backupPreferenceService.setOnboardingPermissionSkipped(false);
if (shouldMarkLimitedFolders && state == PermissionState.limited) {
- // when limited permission is granted, by default mark all folders for
- // backup
await backupPreferenceService.setSelectAllFoldersForBackup(true);
}
SyncService.instance.onPermissionGranted().ignore();
diff --git a/mobile/apps/photos/lib/ui/home/home_bottom_nav_bar.dart b/mobile/apps/photos/lib/ui/home/home_bottom_nav_bar.dart
index 69e4c6e52f..3ef0ee2b98 100644
--- a/mobile/apps/photos/lib/ui/home/home_bottom_nav_bar.dart
+++ b/mobile/apps/photos/lib/ui/home/home_bottom_nav_bar.dart
@@ -62,7 +62,6 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
}
} else if (event.source == TabChangedEventSource.tabBar &&
currentTabIndex == event.selectedIndex) {
- // user tapped on the currently selected index on the tapBar
Bus.instance.fire(TabDoubleTapEvent(currentTabIndex));
}
});
diff --git a/mobile/apps/photos/lib/ui/home/home_gallery_widget.dart b/mobile/apps/photos/lib/ui/home/home_gallery_widget.dart
index f95480459e..fc295206b6 100644
--- a/mobile/apps/photos/lib/ui/home/home_gallery_widget.dart
+++ b/mobile/apps/photos/lib/ui/home/home_gallery_widget.dart
@@ -50,10 +50,7 @@ class _HomeGalleryWidgetState extends State<HomeGalleryWidget> {
_hideSharedFilesFromHomeSubscription;
bool _shouldHideSharedItems = localSettings.hideSharedItemsFromHomeGallery;
- /// This deboucner is to delay the UI update of the shared items toggle
- /// since it's expensive (a new differnt key is used for the gallery
- /// widget when hide is toggled), without which, causes the toggle button used
- /// for it in settings to have janky animation.
+ // Delay the gallery rebuild so the settings toggle stays smooth.
final _hideSharedItemsToggleDebouncer = Debouncer(
const Duration(milliseconds: 500),
);
diff --git a/mobile/apps/photos/lib/ui/home/landing_page_widget.dart b/mobile/apps/photos/lib/ui/home/landing_page_widget.dart
index b7f4e858a5..5483a63477 100644
--- a/mobile/apps/photos/lib/ui/home/landing_page_widget.dart
+++ b/mobile/apps/photos/lib/ui/home/landing_page_widget.dart
@@ -229,15 +229,11 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
if (Configuration.instance.getEncryptedToken() == null) {
page = const EmailEntryPage();
} else {
- // No key
if (Configuration.instance.getKeyAttributes() == null) {
- // Never had a key
page = const PasswordEntryPage(mode: PasswordEntryMode.set);
} else if (Configuration.instance.getKey() == null) {
- // Yet to decrypt the key
page = const PasswordReentryPage();
} else {
- // All is well, user just has not subscribed
page = getSubscriptionPage(isOnBoarding: true);
}
}
@@ -258,15 +254,11 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
if (Configuration.instance.getEncryptedToken() == null) {
page = const LoginPage();
} else {
- // No key
if (Configuration.instance.getKeyAttributes() == null) {
- // Never had a key
page = const PasswordEntryPage(mode: PasswordEntryMode.set);
} else if (Configuration.instance.getKey() == null) {
- // Yet to decrypt the key
page = const PasswordReentryPage();
} else {
- // All is well, user just has not subscribed
page = getSubscriptionPage(isOnBoarding: true);
}
}
diff --git a/mobile/apps/photos/lib/ui/home/memories/custom_listener.dart b/mobile/apps/photos/lib/ui/home/memories/custom_listener.dart
index 86ddf1b4d3..2481894488 100644
--- a/mobile/apps/photos/lib/ui/home/memories/custom_listener.dart
+++ b/mobile/apps/photos/lib/ui/home/memories/custom_listener.dart
@@ -23,28 +23,21 @@ class ActivePointers with ChangeNotifier {
}
}
-/// `onLongPress` and `onLongPressUp` have not been tested enough to make sure
-/// it works as expected, so they are commented out for now.
class MemoriesPointerGestureListener extends StatefulWidget {
final Widget child;
final Function(PointerEvent)? onTap;
final VoidCallback? onSwipeUp;
final bool Function()? canSwipeUp;
- // final VoidCallback? onLongPress;
- // final VoidCallback? onLongPressUp;
-
- /// How long the pointer must stay down before a long‐press fires.
final Duration longPressDuration;
- /// Maximum movement (in logical pixels) before we consider it a drag.
final double touchSlop;
- /// Minimum upward displacement before a gesture opens file details.
final double swipeUpThreshold;
- /// Notifier that indicates whether there are active pointers.
final ValueNotifier<bool>? hasPointerNotifier;
- static const double kTouchSlop = 18.0; // Default touch slop value
+
+ // Matches Flutter's default touch slop.
+ static const double kTouchSlop = 18.0;
const MemoriesPointerGestureListener({
super.key,
@@ -52,11 +45,9 @@ class MemoriesPointerGestureListener extends StatefulWidget {
this.onTap,
this.onSwipeUp,
this.canSwipeUp,
- // this.onLongPress,
- // this.onLongPressUp,
this.hasPointerNotifier,
this.longPressDuration = const Duration(milliseconds: 500),
- this.touchSlop = kTouchSlop, // from flutter/gestures/constants.dart
+ this.touchSlop = kTouchSlop,
this.swipeUpThreshold = 48,
});
@@ -99,7 +90,6 @@ class MemoriesPointerGestureListenerState
_longPressTimer?.cancel();
_longPressTimer = Timer(widget.longPressDuration, () {
_longPressFired = true;
- // widget.onLongPress?.call();
});
}
@@ -107,7 +97,6 @@ class MemoriesPointerGestureListenerState
if (event.pointer == _trackedPointer && _downPosition != null) {
final distance = (event.localPosition - _downPosition!).distance;
if (distance > widget.touchSlop) {
- // user started dragging – cancel long‐press
hasPointerMoved = true;
_longPressTimer?.cancel();
_longPressTimer = null;
@@ -141,7 +130,7 @@ class MemoriesPointerGestureListenerState
if (isSwipeUp) {
widget.onSwipeUp?.call();
} else if (_longPressFired) {
- // widget.onLongPressUp?.call();
+ // Long presses consume the tap.
} else {
if (!wasPartOfMultitouch && !hasPointerMoved) {
widget.onTap?.call(event);
diff --git a/mobile/apps/photos/lib/ui/home/memories/full_screen_memory.dart b/mobile/apps/photos/lib/ui/home/memories/full_screen_memory.dart
index 820c02a56f..8b6d05b449 100644
--- a/mobile/apps/photos/lib/ui/home/memories/full_screen_memory.dart
+++ b/mobile/apps/photos/lib/ui/home/memories/full_screen_memory.dart
@@ -354,7 +354,6 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
// AnimatedSwitcher doesn't animate its initial child, so we wrap it
// in an AnimatedOpacity that ramps 0→1 after the first frame.
double _firstPhotoOpacity = 0;
- // Photo crossfade durations for auto vs manual advance.
static const _autoCrossfadeDuration = Duration(milliseconds: 600);
static const _manualCrossfadeDuration = Duration(milliseconds: 200);
// How long to hold the incoming photo's Ken Burns still. Intentionally
@@ -370,7 +369,6 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
bool _isMediaZoomed = false;
final _socialControlsVisible = ValueNotifier<bool>(false);
- /// Used to check if any pointer is on the screen.
final hasPointerOnScreenNotifier = ValueNotifier<bool>(false);
bool hasFinalFileLoaded = false;
bool isAtFirstOrLastFile = false;
@@ -433,11 +431,6 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
super.dispose();
}
- /// Used to check if user has touched the screen and then to pause animation
- /// and once the pointer is removed from the screen, it resumes the animation
- /// It also resets the zoom of the photo view to default for better user
- /// experience after finger(s) is removed from the screen after zooming in by
- /// pinching.
void _hasPointerListener() {
if (hasPointerOnScreenNotifier.value) {
_toggleAnimation(pause: true);
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 19b085ca36..398b39282b 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
@@ -2,9 +2,6 @@ import "package:photos/models/file/file_type.dart";
import "package:photos/models/memories/memory.dart";
import "package:photos/module/download/file.dart";
-// The index inside a memory's file list that should be shown first to the
-// user: the first unseen file, or the one after the most recently seen if all
-// have been seen (wrapping to 0 once the last one was seen).
int getNextMemoryIndex(List<Memory> memories) {
int lastSeenIndex = 0;
int lastSeenTimestamp = 0;
@@ -30,12 +27,6 @@ int getNextMemoryIndex(List<Memory> memories) {
// large backlog of unseen memories.
const int kMemoryCoverWarmCap = 20;
-// Sequentially warm the "cover" file of each memory so a subsequent tap
-// opens to a full original instead of a thumbnail. Routes through [getFile],
-// which internally handles remote download, local asset resolution (including
-// iCloud-optimized fetch on iOS), and cache hits. Best-effort: swallows
-// per-file errors and skips videos. [stillActive] is checked between files
-// so the caller can cancel on unmount or a newer pass.
Future<void> warmMemoryCovers(
List<List<Memory>> memoryLists, {
required bool Function() stillActive,
diff --git a/mobile/apps/photos/lib/ui/home/memories/memory_share_sheet.dart b/mobile/apps/photos/lib/ui/home/memories/memory_share_sheet.dart
index 7ea764d374..9ee4f1ee47 100644
--- a/mobile/apps/photos/lib/ui/home/memories/memory_share_sheet.dart
+++ b/mobile/apps/photos/lib/ui/home/memories/memory_share_sheet.dart
@@ -274,8 +274,8 @@ class _MemoryShareSelectionSheetState
}
}
-/// The reference sheet is 634px on the 812px Share memory viewport.
-/// Source: https://www.figma.com/design/BuBNPPytxlVnqfmCUW0mgz/Ente-Visual-Design?node-id=18629-312441&m=dev
+// The reference sheet is 634px on the 812px Share memory viewport.
+// Source: https://www.figma.com/design/BuBNPPytxlVnqfmCUW0mgz/Ente-Visual-Design?node-id=18629-312441&m=dev
const double _figmaSheetHeightRatio = 634 / 812;
class _MemoryShareSheetBoundary extends StatefulWidget {
diff --git a/mobile/apps/photos/lib/ui/home/status_bar_widget.dart b/mobile/apps/photos/lib/ui/home/status_bar_widget.dart
index 1676121871..e1ff78fb0f 100644
--- a/mobile/apps/photos/lib/ui/home/status_bar_widget.dart
+++ b/mobile/apps/photos/lib/ui/home/status_bar_widget.dart
@@ -221,7 +221,6 @@ class _StatusBarWidgetState extends State<StatusBarWidget> {
);
}
- // _showVerificationBanner after 3 days of installation
bool _showVerificationBanner() {
if (_showErrorBanner ||
_showErrorBanner ||
diff --git a/mobile/apps/photos/lib/ui/settings/pending_sync/pending_sync_info_screen.dart b/mobile/apps/photos/lib/ui/settings/pending_sync/pending_sync_info_screen.dart
index 7dacee137f..7f829b9db1 100644
--- a/mobile/apps/photos/lib/ui/settings/pending_sync/pending_sync_info_screen.dart
+++ b/mobile/apps/photos/lib/ui/settings/pending_sync/pending_sync_info_screen.dart
@@ -6,28 +6,6 @@ import "package:photos/service_locator.dart";
import "package:photos/ui/components/menu_section_title.dart";
import "package:photos/ui/settings/pending_sync/path_info_storage_viewer.dart";
-// Preview Video related items -> pv
-// final String tempDir = Configuration.instance.getTempDirectory();
-// final String prefix = "${tempDir}_${enteFile.uploadedFileID}_${newID("pv")}";
-//
-// Recovery Key -> ente-recovery-key.txt
-// Configuration.instance.getTempDirectory() + "ente-recovery-key.txt",
-//
-// Encrypted files (upload), decrypted files (download) -> .encrypted & .decrypted
-// final String tempDir = Configuration.instance.getTempDirectory();
-// final String encryptedFilePath = "$tempDir${file.uploadedFileID}.encrypted";
-// final String decryptedFilePath = "$tempDir${file.uploadedFileID}.decrypted";
-//
-// Live photo compressed version -> .elp
-// final livePhotoPath = tempPath + uniqueId + "_${file.generatedID}.elp";
-//
-// Explicit uploads -> _file.encrpyted & _thumb.encrypted
-// final encryptedFilePath = multipartEntryExists
-// ? '$tempDirectory$existingMultipartEncFileName'
-// : '$tempDirectory$uploadTempFilePrefix${uniqueID}_file.encrypted';
-// final encryptedThumbnailPath =
-// '$tempDirectory$uploadTempFilePrefix${uniqueID}_thumb.encrypted';
-
class PendingSyncInfoScreen extends StatefulWidget {
const PendingSyncInfoScreen({super.key});
diff --git a/mobile/apps/photos/lib/ui/social/comment_likes_bottom_sheet.dart b/mobile/apps/photos/lib/ui/social/comment_likes_bottom_sheet.dart
index 3a10635916..8c8c830b57 100644
--- a/mobile/apps/photos/lib/ui/social/comment_likes_bottom_sheet.dart
+++ b/mobile/apps/photos/lib/ui/social/comment_likes_bottom_sheet.dart
@@ -15,7 +15,6 @@ import "package:photos/ui/social/widgets/resolved_social_user_name.dart";
const _shrinkWrapThreshold = 30;
-/// Shows the likes bottom sheet for a comment
Future<void> showCommentLikesBottomSheet(
BuildContext context, {
required List<Reaction> reactions,
diff --git a/mobile/apps/photos/lib/ui/social/comments_screen.dart b/mobile/apps/photos/lib/ui/social/comments_screen.dart
index 8477d1fe06..20ee9443db 100644
--- a/mobile/apps/photos/lib/ui/social/comments_screen.dart
+++ b/mobile/apps/photos/lib/ui/social/comments_screen.dart
@@ -26,7 +26,6 @@ import "package:photos/ui/social/widgets/comment_input_widget.dart";
final _commentDraftStore = CommentDraftStore.instance;
-/// Shows the file comments bottom sheet
Future<void> showFileCommentsBottomSheet(
BuildContext context, {
required int collectionID,
@@ -112,17 +111,12 @@ class FileCommentsBottomSheet extends StatefulWidget {
final int fileID;
final List<Collection>? sharedCollections;
- /// Optional comment ID to scroll to and highlight.
final String? highlightCommentID;
- /// Whether an unsent draft in another collection may override
- /// [collectionID] when the sheet opens.
final bool preferDraftCollection;
- /// Scroll controller for the drag handle (from DraggableScrollableSheet).
final ScrollController dragController;
- /// Controller to programmatically expand/collapse the sheet.
final DraggableScrollableController sheetController;
const FileCommentsBottomSheet({
@@ -229,7 +223,6 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
includeHidden: _isOpenedFromHiddenCollection(),
);
- // Fetch data in parallel
final sharedCollections = await Future.wait(
sharedCollectionsList.map((collection) async {
final commentCount = await SocialDataProvider.instance
@@ -282,7 +275,6 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
Future<void> _loadInitialComments() async {
setState(() => _isLoading = true);
- // Load local data first for immediate display
final results = await Future.wait([
SocialDataProvider.instance.getCommentsForFilePaginated(
widget.fileID,
@@ -307,10 +299,8 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
});
unawaited(_syncMissingAnonDisplayNamesFor(comments));
- // Scroll to highlighted comment if specified
_scrollToHighlightedComment();
- // Sync in background and refresh if there are changes
unawaited(_syncAndRefresh());
}
@@ -323,7 +313,6 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
if (!mounted) return;
- // Reload comments and any already-synced anonymous names after sync.
final results = await Future.wait([
SocialDataProvider.instance.getCommentsForFilePaginated(
widget.fileID,
@@ -447,7 +436,6 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
_scrollTargetCommentID =
parentCommentID; // Set immediately for race detection
- // Check if already loaded
int index = _comments.indexWhere((c) => c.id == parentCommentID);
if (index != -1) {
@@ -455,7 +443,6 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
return;
}
- // Parent not in loaded comments - need to load more
while (_hasMoreComments) {
await _loadMoreComments();
@@ -471,8 +458,6 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
return;
}
}
-
- // Parent not found (deleted) - do nothing silently
}
void _performScrollToIndex(int index, String commentID) {
@@ -503,7 +488,6 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
curve: Curves.easeOutExpo,
);
}
- // Clear scroll target and trigger highlight
_scrollTargetCommentID = null;
_scrollTargetKey = null;
if (mounted) {
@@ -586,7 +570,6 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
return;
}
- // Update UI only after successful persistence
_clearDraftForCollection(collectionID);
if (mounted) {
setState(() {
@@ -598,7 +581,6 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
}
}
- // Update comment count in shared collections list
final index = _sharedCollections.indexWhere(
(c) => c.collection.id == collectionID,
);
@@ -615,7 +597,6 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
_textController.clear();
}
- // Scroll to the newly added comment (position 0 in reversed list)
if (_selectedCollectionID == collectionID &&
_scrollController.hasClients) {
unawaited(
@@ -650,7 +631,6 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
setState(() {
_comments.removeWhere((c) => c.id == commentId);
- // Decrement comment count in shared collections list
final index = _sharedCollections.indexWhere(
(c) => c.collection.id == _selectedCollectionID,
);
diff --git a/mobile/apps/photos/lib/ui/social/feed_screen.dart b/mobile/apps/photos/lib/ui/social/feed_screen.dart
index 31cb7e9625..cff20258f9 100644
--- a/mobile/apps/photos/lib/ui/social/feed_screen.dart
+++ b/mobile/apps/photos/lib/ui/social/feed_screen.dart
@@ -80,9 +80,6 @@ class FeedNavigationTarget {
}
}
-/// Screen that displays the user's activity feed.
-///
-/// Shows likes, comments, and replies on the user's photos and comments.
class FeedScreen extends StatefulWidget {
final FeedNavigationTarget? initialTarget;
final bool showBackButton;
@@ -116,7 +113,6 @@ class _FeedScreenState extends State<FeedScreen> {
final ScrollController _scrollController = ScrollController();
final GlobalKey _navigationTargetItemKey = GlobalKey();
- /// Map of collectionID -> (anonUserID -> displayName)
Map<int, Map<String, String>> _anonDisplayNamesByCollection = {};
@override
@@ -175,12 +171,10 @@ class _FeedScreenState extends State<FeedScreen> {
_hasMore = true;
});
- // Load local data first
final items = await FeedDataProvider.instance.getFeedItems(
limit: _currentLimit,
);
- // Load anon display names for all collections in feed
final anonNames = await _loadAnonDisplayNames(items);
if (mounted) {
@@ -194,7 +188,6 @@ class _FeedScreenState extends State<FeedScreen> {
}
_tryOpenNavigationTarget();
- // Sync in background and refresh
unawaited(_syncAndRefresh());
}
@@ -223,12 +216,10 @@ class _FeedScreenState extends State<FeedScreen> {
if (!mounted) return;
if (!hasNewSocialData) return;
- // Reload feed items after sync
final freshItems = await FeedDataProvider.instance.getFeedItems(
limit: _currentLimit,
);
- // Reload anon display names for new items
final freshAnonNames = await _loadAnonDisplayNames(freshItems);
if (mounted) {
@@ -708,7 +699,6 @@ class _FeedScreenState extends State<FeedScreen> {
}
if (collection == null || !mounted) {
- // Fallback to shared-photos viewer if collection metadata isn't available.
await _openSharedPhotos(
item,
initialFileID: jumpToFileID,
@@ -755,7 +745,6 @@ class _FeedScreenState extends State<FeedScreen> {
return sharedFileIDs.first;
}
- /// Opens the photo viewer for the feed item, then shows the comments sheet.
Future<void> _openComments(
FeedItem item, {
String? heroTagPrefix,
@@ -824,7 +813,6 @@ class _FeedScreenState extends State<FeedScreen> {
}
}
- /// Opens the photo viewer for the feed item.
Future<void> _openPhoto(FeedItem item, {String? heroTagPrefix}) async {
var fileID = item.fileID;
@@ -854,7 +842,6 @@ class _FeedScreenState extends State<FeedScreen> {
);
}
- /// Opens a gallery view of the shared photos.
Future<void> _openSharedPhotos(
FeedItem item, {
int? initialFileID,
@@ -863,7 +850,6 @@ class _FeedScreenState extends State<FeedScreen> {
final fileIDs = item.sharedFileIDs;
if (fileIDs == null || fileIDs.isEmpty) return;
- // Load all files using batch query
final loadedFiles = await FilesDB.instance.getUploadedFilesBatch(
fileIDs,
item.collectionID,
diff --git a/mobile/apps/photos/lib/ui/social/like_collection_selector_sheet.dart b/mobile/apps/photos/lib/ui/social/like_collection_selector_sheet.dart
index 35c3dc78d8..99ae0b0e39 100644
--- a/mobile/apps/photos/lib/ui/social/like_collection_selector_sheet.dart
+++ b/mobile/apps/photos/lib/ui/social/like_collection_selector_sheet.dart
@@ -20,7 +20,6 @@ final _logger = Logger("LikeCollectionSelectorSheet");
const _greenHeartColor = Color(0xFF08C225);
-/// Holds collection info with mutable like state for the selector
class _CollectionLikeState {
final Collection collection;
bool isLiked;
@@ -28,13 +27,6 @@ class _CollectionLikeState {
_CollectionLikeState({required this.collection, required this.isLiked});
}
-/// Shows the like collection selector bottom sheet
-///
-/// Parameters:
-/// - [fileID]: The uploaded file ID to like
-/// - [currentUserID]: Current user's ID for checking existing likes
-/// - [collections]: Shared collections eligible for this action
-/// - [file]: The EnteFile for displaying thumbnail (optional, will fetch if null)
Future<void> showLikeCollectionSelectorSheet(
BuildContext context, {
required int fileID,
@@ -92,10 +84,8 @@ class _LikeCollectionSelectorSheetState
Future<void> _loadData() async {
try {
- // Load file if not provided (for thumbnail)
_file ??= await FilesDB.instance.getAnyUploadedFile(widget.fileID);
- // Fetch like states in parallel
final collectionStates = await Future.wait(
widget.collections.map((collection) async {
final reactions = await SocialDataProvider.instance
@@ -126,7 +116,6 @@ class _LikeCollectionSelectorSheetState
Future<void> _toggleLike(_CollectionLikeState state) async {
final previousState = state.isLiked;
- // Optimistic UI update
setState(() => state.isLiked = !state.isLiked);
try {
@@ -147,26 +136,21 @@ class _LikeCollectionSelectorSheetState
}
Future<void> _likeAll() async {
- // Get collections that aren't already liked
final toLike = _collections.where((c) => !c.isLiked).toList();
if (toLike.isEmpty) {
- // All already liked, just close
Navigator.of(context).pop();
return;
}
- // Optimistic UI update
setState(() {
for (final c in toLike) {
c.isLiked = true;
}
});
- // Track failures for rollback
final failed = <_CollectionLikeState>[];
- // Perform all likes in parallel
await Future.wait(
toLike.map((c) async {
try {
@@ -184,7 +168,6 @@ class _LikeCollectionSelectorSheetState
if (!mounted) return;
- // Rollback failed items and show toast
if (failed.isNotEmpty) {
setState(() {
for (final c in failed) {
@@ -195,11 +178,9 @@ class _LikeCollectionSelectorSheetState
context,
context.strings.failedToLikeAlbums(count: failed.length),
);
- // Don't close sheet - let user retry
return;
}
- // Close sheet after successful "Like all"
Navigator.of(context).pop();
}
@@ -228,7 +209,6 @@ class _LikeCollectionSelectorSheetState
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
- // Header with close button - inlined for simplicity
Padding(
padding: const EdgeInsets.fromLTRB(16, 11, 12, 0),
child: Row(
@@ -280,7 +260,6 @@ class _LikeCollectionSelectorSheetState
allLiked: _allLiked,
onLikeAll: _likeAll,
),
- // Album list
Flexible(
child: Scrollbar(
thumbVisibility: true,
@@ -457,8 +436,8 @@ class _AlbumListItem extends StatelessWidget {
final textTheme = getEnteTextTheme(context);
final isDarkTheme = Theme.of(context).brightness == Brightness.dark;
final heartContainerBg = isDarkTheme
- ? const Color(0x1A08C225) // ~10% opacity for dark
- : const Color(0x0F08C225); // ~6% opacity for light
+ ? const Color(0x1A08C225)
+ : const Color(0x0F08C225);
return GestureDetector(
onTap: onTap,
diff --git a/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart b/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
index 3233b55eb8..00af084fb6 100644
--- a/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
+++ b/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
@@ -21,7 +21,6 @@ import "package:photos/ui/social/widgets/resolved_social_user_name.dart";
const _shrinkWrapThreshold = 30;
-/// Shows the likes bottom sheet for a file
Future<void> showLikesBottomSheet(
BuildContext context, {
required int fileID,
@@ -93,7 +92,6 @@ class _LikesBottomSheetState extends State<LikesBottomSheet> {
includeHidden: _isOpenedFromHiddenCollection(),
);
- // Fetch like counts and thumbnails in parallel
final sharedCollections = await Future.wait(
sharedCollectionsList.map((collection) async {
final likes = await SocialDataProvider.instance
@@ -111,13 +109,11 @@ class _LikesBottomSheetState extends State<LikesBottomSheet> {
if (!mounted) return;
- // If no shared collections, close the sheet
if (sharedCollections.isEmpty) {
Navigator.of(context).pop();
return;
}
- // Validate selected collection is in the shared list
final isSelectedInShared = sharedCollections.any(
(info) => info.collection.id == _selectedCollectionID,
);
@@ -144,7 +140,6 @@ class _LikesBottomSheetState extends State<LikesBottomSheet> {
setState(() => _isLoading = true);
try {
- // Sync reactions from server before loading locally
await SocialDataProvider.instance.syncFileReactions(
_selectedCollectionID,
widget.fileID,
diff --git a/mobile/apps/photos/lib/ui/social/widgets/collection_selector_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/collection_selector_widget.dart
index 52e33d4692..c6bcff73e8 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/collection_selector_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/collection_selector_widget.dart
@@ -4,7 +4,6 @@ import "package:photos/models/file/file.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/viewer/file/thumbnail_widget.dart";
-/// Holds collection info with comment count for the collection selector
class CollectionCommentInfo {
final Collection collection;
final int commentCount;
@@ -17,7 +16,6 @@ class CollectionCommentInfo {
});
}
-/// Holds collection info with like count for the likes bottom sheet
class CollectionLikeInfo {
final Collection collection;
final int likeCount;
diff --git a/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
index 02631e146a..a95650e42f 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
@@ -38,16 +38,12 @@ class CommentBubbleWidget extends StatefulWidget {
final User Function(Comment) userResolver;
final VoidCallback? onCommentDeleted;
- /// Whether this comment should be visually highlighted.
final bool isHighlighted;
- /// Callback invoked when auto-highlight animation completes (dismissed).
final VoidCallback? onAutoHighlightDismissed;
- /// Callback invoked when the user taps on the parent quote preview.
final VoidCallback? onParentQuoteTap;
- /// Callback invoked when the user taps the visible author header.
final VoidCallback? onAuthorTap;
const CommentBubbleWidget({
@@ -125,7 +121,6 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget>
_loadData();
_measureContent();
- // Trigger auto-highlight if widget is created with isHighlighted = true
if (widget.isHighlighted) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted) {
@@ -148,7 +143,6 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget>
_measureContent();
}
- // Trigger auto-highlight when isHighlighted becomes true
if (widget.isHighlighted && !oldWidget.isHighlighted) {
_triggerAutoHighlight();
}
@@ -170,14 +164,12 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget>
}
Future<void> _loadData() async {
- // Load parent if reply
if (widget.comment.isReply && widget.onFetchParent != null) {
setState(() => _isLoadingParent = true);
_parentComment = await widget.onFetchParent!();
if (mounted) setState(() => _isLoadingParent = false);
}
- // Load reactions
setState(() => _isLoadingReactions = true);
_reactions = await widget.onFetchReactions();
_isLiked = _reactions.any(
@@ -235,7 +227,6 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget>
return;
}
- // Refresh reactions after successful toggle (best-effort, no rollback if fails)
_reactions = await widget.onFetchReactions();
if (mounted) {
setState(() {
@@ -246,7 +237,7 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget>
void _showHighlight() {
if (_isAutoHighlight) {
- return; // Don't allow long-press during auto-highlight
+ return;
}
HapticFeedback.mediumImpact();
setState(() => _dragOffset = 0.0);
@@ -265,7 +256,6 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget>
_overlayController.show();
_overlayAnimationController.forward();
- // Auto-dismiss after 700ms
Future.delayed(const Duration(milliseconds: 700), () {
if (mounted && _isAutoHighlight) {
_hideAutoHighlight();
@@ -416,7 +406,6 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget>
_overlayAnimationController.status == AnimationStatus.reverse;
return Stack(
children: [
- // Full-screen barrier with black opacity
GestureDetector(
onTap: _isAutoHighlight ? _hideAutoHighlight : _hideHighlight,
child: Builder(
@@ -431,7 +420,6 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget>
},
),
),
- // Highlighted comment + popup menu
CompositedTransformFollower(
link: _layerLink,
showWhenUnlinked: false,
diff --git a/mobile/apps/photos/lib/ui/social/widgets/delete_comment_confirmation_dialog.dart b/mobile/apps/photos/lib/ui/social/widgets/delete_comment_confirmation_dialog.dart
index 4bc4a89e0f..8b4d0b5216 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/delete_comment_confirmation_dialog.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/delete_comment_confirmation_dialog.dart
@@ -4,8 +4,6 @@ import "package:flutter/material.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/components/buttons/icon_button_widget.dart";
-/// Shows a bottom sheet confirmation dialog for deleting a comment.
-/// Returns true if confirmed, null if cancelled.
Future<bool?> showDeleteCommentConfirmationDialog(
BuildContext context, {
required String commentText,
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 2263d5b534..c6e51a3f4b 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
@@ -15,32 +15,24 @@ import "package:photos/ui/social/widgets/resolved_social_user_name.dart";
import "package:photos/ui/social/widgets/shared_photos_grid.dart";
import "package:photos/ui/viewer/file/thumbnail_widget.dart";
-/// Widget that displays a single feed item.
class FeedItemWidget extends StatelessWidget {
final FeedItem feedItem;
final String heroTagPrefix;
final bool enableThumbnailHero;
final int currentUserID;
- /// Called when the user taps anywhere on the feed item.
final VoidCallback? onTap;
- /// Called when the user taps a specific shared photo in the shared grid.
final ValueChanged<int>? onSharedPhotoTap;
- /// Called when the user taps shared-feed header text/avatar area.
final VoidCallback? onSharedHeaderTap;
- /// Called when the user taps the primary actor avatar or name.
final ValueChanged<User>? onPrimaryActorTap;
- /// Called when the user taps the +N extra-count badge in the shared grid.
final VoidCallback? onSharedExtraCountTap;
- /// Map of anonUserID -> decrypted display name for the collection.
final Map<String, String> anonDisplayNames;
- /// Whether this is the last item in the feed (hides timeline line).
final bool isLastItem;
const FeedItemWidget({
@@ -60,7 +52,6 @@ class FeedItemWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
- // Shared feed items have a different layout with photos grid below.
if (feedItem.type == FeedItemType.sharedPhoto ||
feedItem.type == FeedItemType.sharedCollection) {
return _buildSharedPhotoLayout(context);
@@ -77,7 +68,6 @@ class FeedItemWidget extends StatelessWidget {
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- // Left side - tappable for comments
Expanded(
child: GestureDetector(
onTap: onTap,
@@ -86,17 +76,14 @@ class FeedItemWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
- // First row: Icon with timeline + Avatars
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
- // Feed type icon with timeline line
_FeedTypeIconWithTimeline(
type: feedItem.type,
showTimeline: !isLastItem,
),
const SizedBox(width: 10),
- // Stacked avatars
_StackedAvatars(
feedItem: feedItem,
currentUserID: currentUserID,
@@ -106,7 +93,6 @@ class FeedItemWidget extends StatelessWidget {
],
),
const SizedBox(height: 4),
- // Second row: Text content with left padding
Padding(
padding: const EdgeInsets.only(left: 42),
child: _FeedTextContent(
@@ -121,7 +107,6 @@ class FeedItemWidget extends StatelessWidget {
),
),
const SizedBox(width: 12),
- // Photo thumbnail
if (feedItem.fileID != null)
GestureDetector(
onTap: onTap,
@@ -156,26 +141,22 @@ class FeedItemWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
- // Header row: Icon + Avatar + Text
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- // Feed type icon with timeline line
_FeedTypeIconWithTimeline(
type: feedItem.type,
showTimeline: !isLastItem,
timelineExtensionHeight: hasSharedPhotos
? 400
- : 95, // Longer only when grid exists
+ : 95,
),
const SizedBox(width: 10),
- // Avatar and text
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
- // Avatar
_StackedAvatars(
feedItem: feedItem,
currentUserID: currentUserID,
@@ -183,7 +164,6 @@ class FeedItemWidget extends StatelessWidget {
onPrimaryActorTap: onPrimaryActorTap,
),
const SizedBox(height: 4),
- // Text content
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: onSharedHeaderTap,
@@ -202,7 +182,6 @@ class FeedItemWidget extends StatelessWidget {
),
],
),
- // Photos grid below with left padding to align with text
if (hasSharedPhotos)
Padding(
padding: const EdgeInsets.only(left: 42, top: 12),
@@ -221,18 +200,12 @@ class FeedItemWidget extends StatelessWidget {
}
}
-/// Displays the feed type icon with optional timeline line passing through center.
-///
-/// The timeline line connects feed items vertically, passing through the icon center.
class _FeedTypeIconWithTimeline extends StatelessWidget {
final FeedItemType type;
final bool showTimeline;
- /// Height of the timeline line extending below the icon.
- /// Extends from icon center through text content and padding to next item's icon.
final double timelineExtensionHeight;
- /// Width of the dashed timeline line.
static const double _timelineWidth = 1.5;
const _FeedTypeIconWithTimeline({
@@ -244,7 +217,6 @@ class _FeedTypeIconWithTimeline extends StatelessWidget {
@override
Widget build(BuildContext context) {
final colorScheme = getEnteColorScheme(context);
- // Timeline color: black with 8% opacity for light, white with 20% for dark
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
final timelineColor = isDarkMode
? const Color(0x33FFFFFF)
@@ -256,17 +228,15 @@ class _FeedTypeIconWithTimeline extends StatelessWidget {
child: Stack(
clipBehavior: Clip.none,
children: [
- // Timeline line (behind the icon) - dashed
if (showTimeline)
Positioned(
- left: (32 - _timelineWidth) / 2, // Center the line
- top: 16, // Start from icon center
+ left: (32 - _timelineWidth) / 2,
+ top: 16,
child: CustomPaint(
size: Size(_timelineWidth, timelineExtensionHeight),
painter: _DashedLinePainter(color: timelineColor),
),
),
- // Icon container
Container(
width: 32,
height: 32,
@@ -359,7 +329,6 @@ class _FeedTypeIconWithTimeline extends StatelessWidget {
}
}
-/// Displays stacked user avatars (max 2, overlapping).
class _StackedAvatars extends StatelessWidget {
final FeedItem feedItem;
final int currentUserID;
@@ -386,15 +355,13 @@ class _StackedAvatars extends StatelessWidget {
);
}
- // Stacked avatars with overlap
return _wrapActorTap(
SizedBox(
- width: 28 + 21, // First avatar + second avatar offset
+ width: 28 + 21,
height: 28,
child: Stack(
clipBehavior: Clip.none,
children: [
- // First (front) avatar
Positioned(
left: 0,
child: Container(
@@ -408,9 +375,8 @@ class _StackedAvatars extends StatelessWidget {
child: UserAvatarWidget(actors.first, type: AvatarType.regular),
),
),
- // Second (back) avatar
Positioned(
- left: 21, // Overlap by 7px (28 - 21 = 7)
+ left: 21,
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
@@ -468,7 +434,6 @@ class _StackedAvatars extends StatelessWidget {
),
);
} else {
- // Get user from collections service
final user = CollectionsService.instance.resolveUserIdentity(
userID,
feedItem.collectionID,
@@ -481,7 +446,6 @@ class _StackedAvatars extends StatelessWidget {
}
}
-/// Displays the text content: usernames and action description.
class _FeedTextContent extends StatelessWidget {
final FeedItem feedItem;
final int currentUserID;
@@ -526,7 +490,6 @@ class _FeedTextContent extends StatelessWidget {
},
),
const SizedBox(height: 2),
- // Action description
Text.rich(
_getActionDescriptionSpan(
context,
@@ -549,7 +512,6 @@ class _FeedTextContent extends StatelessWidget {
EnteColorScheme colorScheme,
) {
if (!feedItem.hasMultipleActors) {
- // Single user
return Text(
primaryName,
style: textTheme.small.copyWith(
@@ -561,7 +523,6 @@ class _FeedTextContent extends StatelessWidget {
);
}
- // Multiple users: "Username and X others"
final othersCount = feedItem.additionalActorCount;
final othersText = othersCount == 1
? context.strings.and1Other
@@ -706,7 +667,6 @@ class _FeedTextContent extends StatelessWidget {
}
}
-/// Displays the photo thumbnail for the feed item.
class _FeedThumbnail extends StatefulWidget {
final int fileID;
final int collectionID;
@@ -811,14 +771,11 @@ class _FeedThumbnailState extends State<_FeedThumbnail> {
}
}
-/// Custom painter for drawing a dashed vertical line.
class _DashedLinePainter extends CustomPainter {
final Color color;
- /// Dash length per Figma spec: 7.5px
static const double _dashHeight = 7.5;
- /// Gap between dashes per Figma spec: 4.5px
static const double _dashGap = 4.5;
const _DashedLinePainter({required this.color});
diff --git a/mobile/apps/photos/lib/ui/social/widgets/file_social_overlay.dart b/mobile/apps/photos/lib/ui/social/widgets/file_social_overlay.dart
index 8cdbd685b6..c9c0a7ca33 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/file_social_overlay.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/file_social_overlay.dart
@@ -43,14 +43,13 @@ Duration _motionDuration(BuildContext context, int milliseconds) {
: Duration(milliseconds: milliseconds);
}
-/// Social content for a file. The host owns placement and visibility effects.
class FileSocialOverlay extends StatefulWidget {
final EnteFile file;
final int? currentUserID;
- /// The collection the viewer was opened from, or null when there is no
- /// opening collection context. Memories must not pass a deduped file row's
- /// collection ID here.
+ // The collection the viewer was opened from, or null when there is no
+ // opening collection context. Memories must not pass a deduped file row's
+ // collection ID here.
final int? openingCollectionID;
final VoidCallback? onInteractionStart;
final VoidCallback? onInteractionEnd;
diff --git a/mobile/apps/photos/lib/ui/social/widgets/reply_preview_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/reply_preview_widget.dart
index dd7f75b59e..c851287544 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/reply_preview_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/reply_preview_widget.dart
@@ -26,7 +26,6 @@ class ReplyPreviewWidget extends StatelessWidget {
final textTheme = getEnteTextTheme(context);
return Container(
- // padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 24),
padding: const EdgeInsets.fromLTRB(12, 24, 12, 12),
decoration: const BoxDecoration(
color: Colors.transparent,
diff --git a/mobile/apps/photos/lib/ui/social/widgets/shared_photos_grid.dart b/mobile/apps/photos/lib/ui/social/widgets/shared_photos_grid.dart
index a75a4f8f49..d24d26b6ef 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/shared_photos_grid.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/shared_photos_grid.dart
@@ -6,33 +6,19 @@ import "package:photos/models/file/file.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/viewer/file/thumbnail_widget.dart";
-/// Displays a grid of shared photos with different layouts based on count.
-///
-/// Layouts:
-/// - 1 photo: Full width, aspect ratio based on image
-/// - 2 photos: Vertical stack (two rows)
-/// - 3 photos: 2 on top, 1 on bottom spanning full width
-/// - 4+ photos: 2x2 grid with "+N" overlay on last cell if more than 4
class SharedPhotosGrid extends StatefulWidget {
- /// List of file IDs to display.
final List<int> fileIDs;
- /// Collection ID for loading files.
final int collectionID;
- /// Called when user taps on the grid.
final VoidCallback? onTap;
- /// Called when user taps an individual photo thumbnail.
final ValueChanged<int>? onPhotoTap;
- /// Called when user taps the +N extra-count badge.
final VoidCallback? onExtraCountTap;
- /// Prefix used for Hero tags while opening shared photos.
final String heroTagPrefix;
- /// Size of the grid (width). Height is calculated based on layout.
final double gridSize;
const SharedPhotosGrid({
@@ -72,7 +58,6 @@ class _SharedPhotosGridState extends State<SharedPhotosGrid> {
Future<void> _loadFiles() async {
setState(() => _isLoading = true);
- // Load up to 4 files for display using batch query
final filesToLoad = widget.fileIDs.take(4).toList();
final files = await FilesDB.instance.getUploadedFilesBatch(
filesToLoad,
@@ -187,7 +172,6 @@ class _SharedPhotosGridState extends State<SharedPhotosGrid> {
return Column(
children: [
- // Top row: 2 photos
Row(
children: [
SizedBox(
@@ -204,7 +188,6 @@ class _SharedPhotosGridState extends State<SharedPhotosGrid> {
],
),
const SizedBox(height: gap),
- // Bottom row: 1 photo spanning full width
SizedBox(
height: itemHeight,
width: widget.gridSize,
@@ -221,7 +204,6 @@ class _SharedPhotosGridState extends State<SharedPhotosGrid> {
return Column(
children: [
- // Top row
Row(
children: [
SizedBox(
@@ -238,7 +220,6 @@ class _SharedPhotosGridState extends State<SharedPhotosGrid> {
],
),
const SizedBox(height: gap),
- // Bottom row
Row(
children: [
SizedBox(
@@ -247,7 +228,6 @@ class _SharedPhotosGridState extends State<SharedPhotosGrid> {
child: _buildSharedPhotoThumbnail(files[2]),
),
const SizedBox(width: gap),
- // Fourth photo with optional +N overlay
SizedBox(
height: itemHeight,
width: itemWidth,
diff --git a/mobile/apps/photos/lib/ui/tabs/home_widget.dart b/mobile/apps/photos/lib/ui/tabs/home_widget.dart
index 57c0a26249..d902df3899 100644
--- a/mobile/apps/photos/lib/ui/tabs/home_widget.dart
+++ b/mobile/apps/photos/lib/ui/tabs/home_widget.dart
@@ -111,7 +111,6 @@ class _HomeWidgetState extends State<HomeWidget> {
final ValueNotifier<bool> _christmasPullReleasedNotifier =
ValueNotifier<bool>(false);
- // for receiving media files
// ignore: unused_field
StreamSubscription? _intentDataStreamSubscription;
List<SharedMediaFile>? _sharedFiles;
@@ -210,7 +209,6 @@ class _HomeWidgetState extends State<HomeWidget> {
) {
_startWithoutAccount = false;
setState(() {});
- // fetch user flags on login
if (!isLocalGalleryMode) {
flagService.flags;
}
@@ -284,10 +282,8 @@ class _HomeWidgetState extends State<HomeWidget> {
});
});
- // Initialize deep link subscription for public albums on both iOS and Android
_initDeepLinkSubscriptionForPublicAlbums();
- // For sharing images coming from outside the app
_initMediaShareSubscription();
_scheduleChangeLogCheck(delay: const Duration(seconds: 1));
@@ -389,7 +385,6 @@ class _HomeWidgetState extends State<HomeWidget> {
return;
}
- // Check for action=join parameter to show join dialog
final shouldShowJoinDialog =
uri.queryParameters['action'] == 'join' &&
Configuration.instance.isLoggedIn();
@@ -572,7 +567,6 @@ class _HomeWidgetState extends State<HomeWidget> {
}
void _initMediaShareSubscription() {
- // For sharing images/public links coming from outside the app while the app is in the memory
_intentDataStreamSubscription = ReceiveSharingIntent.instance
.getMediaStream()
.listen(
@@ -583,7 +577,6 @@ class _HomeWidgetState extends State<HomeWidget> {
_logger.severe("getIntentDataStream error: $err");
},
);
- // For sharing images/public links coming from outside the app while the app is closed
ReceiveSharingIntent.instance.getInitialMedia().then((
List<SharedMediaFile> value,
) {
@@ -596,7 +589,6 @@ class _HomeWidgetState extends State<HomeWidget> {
return;
}
- // Check if this is a public album link
if (_isPublicAlbumUrl(value[0].path)) {
final uri = Uri.parse(value[0].path);
unawaited(_handlePublicAlbumLink(uri, "sharedIntent.getMediaStream"));
@@ -669,7 +661,6 @@ class _HomeWidgetState extends State<HomeWidget> {
if (!mounted) {
return;
}
- // Check if this is a public album link
if (value.isNotEmpty && _isPublicAlbumUrl(value[0].path)) {
final uri = Uri.parse(value[0].path);
unawaited(_handlePublicAlbumLink(uri, "sharedIntent.getInitialMedia"));
@@ -751,11 +742,6 @@ class _HomeWidgetState extends State<HomeWidget> {
Future<void> _initDeepLinkSubscriptionForPublicAlbums() async {
final appLinks = AppLinks();
- // Handle public album deep links:
- // - iOS: Universal Links (https://albums.ente.io/... or
- // https://albums.ente.com/...)
- // - Android: App Links (https://albums...) or custom scheme
- // (ente://albums...)
try {
final initialUri = await appLinks.getInitialLink();
if (initialUri != null) {
@@ -935,8 +921,7 @@ class _HomeWidgetState extends State<HomeWidget> {
],
),
- ///To fix the status bar not adapting it's color when switching
- ///screens the have different appbar colours.
+ // Keep an AppBar so the status bar color follows the current screen.
appBar: isOnOnlineGrantPermissionScreen
? null
: PreferredSize(
@@ -1170,12 +1155,9 @@ class _HomeWidgetState extends State<HomeWidget> {
}
Future<bool> _initDeepLinks() async {
- // Platform messages may fail, so we use a try/catch PlatformException.
final appLinks = AppLinks();
try {
final initialLink = await appLinks.getInitialLink();
- // Parse the link and warn the user, if it is not correct,
- // but keep in mind it could be `null`.
if (initialLink != null) {
_logger.info("Initial link received: host ${initialLink.host}");
if (!mounted) return false;
@@ -1185,12 +1167,9 @@ class _HomeWidgetState extends State<HomeWidget> {
_logger.info("No initial link received.");
}
} on PlatformException {
- // Handle exception by warning the user their action did not succeed
- // return?
_logger.severe("PlatformException thrown while getting initial link");
}
- // Attach a listener to the stream
_authDeepLinkSubscription = appLinks.uriLinkStream.listen(
(link) {
_logger.info("Link received: host ${link.host}");
@@ -1239,7 +1218,6 @@ class _HomeWidgetState extends State<HomeWidget> {
context: context,
builder: (context) => const ChangeLogPage(),
);
- // Do not show change dialog again
await updateService.hideChangeLog();
if (!mounted) {
return;