π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Mark legacy bottom sheet adapters
ashilknbf495249eabe
diff --git a/mobile/apps/photos/lib/ui/components/action_sheet_widget.dart b/mobile/apps/photos/lib/ui/components/action_sheet_widget.dartindex 69dbb01107..5ab5fb2b2b 100644--- a/mobile/apps/photos/lib/ui/components/action_sheet_widget.dart+++ b/mobile/apps/photos/lib/ui/components/action_sheet_widget.dart@@ -10,7 +10,11 @@ import 'package:photos/ui/components/buttons/button_widget.dart';enum ActionSheetType { defaultActionSheet, iconOnly }-///Returns null if dismissed+/// Compatibility adapter for legacy Photos action sheets.+///+/// Preserves existing [ButtonWidget]/[ButtonResult] behavior while rendering+/// through [BottomSheetComponent]. Prefer [BottomSheetComponent] directly for+/// new sheets.Future<ButtonResult?> showActionSheet({required BuildContext context,required List<ButtonWidget> buttons,@@ -35,7 +39,7 @@ Future<ButtonResult?> showActionSheet({isDismissible: isDismissible,enableDrag: enableDrag,builder: (_) {- return ActionSheetWidget(+ return LegacyActionSheetWidget(title: title,illustration: illustration,bodyWidget: bodyWidget,@@ -49,7 +53,7 @@ Future<ButtonResult?> showActionSheet({);}-class ActionSheetWidget extends StatelessWidget {+class LegacyActionSheetWidget extends StatelessWidget {final String? title;final Widget? illustration;final Widget? bodyWidget;@@ -59,7 +63,7 @@ class ActionSheetWidget extends StatelessWidget {final ActionSheetType actionSheetType;final bool isCheckIconGreen;- const ActionSheetWidget({+ const LegacyActionSheetWidget({required this.actionButtons,required this.actionSheetType,required this.isCheckIconGreen,@@ -103,7 +107,7 @@ class ActionSheetWidget extends StatelessWidget {title: title,illustration: effectiveIllustration,content: hasDefaultContent- ? _ActionSheetContent(+ ? _LegacyActionSheetContent(bodyWidget: bodyWidget,body: body,bodyHighlight: bodyHighlight,@@ -129,13 +133,13 @@ class ActionSheetWidget extends StatelessWidget {}}-class _ActionSheetContent extends StatelessWidget {+class _LegacyActionSheetContent extends StatelessWidget {final Widget? bodyWidget;final String? body;final String? bodyHighlight;final TextAlign? textAlign;- const _ActionSheetContent({+ const _LegacyActionSheetContent({this.bodyWidget,this.body,this.bodyHighlight,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.dartindex d7060c0689..35e317a600 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,6 +11,11 @@ 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.class ButtonComponentAdapter extends StatelessWidget {const ButtonComponentAdapter({required this.button, super.key});diff --git a/mobile/apps/photos/lib/ui/components/dialog_widget.dart b/mobile/apps/photos/lib/ui/components/dialog_widget.dartindex 44fcf3e55b..01d28150c2 100644--- a/mobile/apps/photos/lib/ui/components/dialog_widget.dart+++ b/mobile/apps/photos/lib/ui/components/dialog_widget.dart@@ -9,7 +9,11 @@ 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';-///Will return null if dismissed by tapping outside+/// Compatibility adapter for legacy Photos dialogs.+///+/// Preserves existing [ButtonWidget]/[ButtonResult] behavior while rendering+/// through [BottomSheetComponent]. Prefer [BottomSheetComponent] directly for+/// new sheets.Future<ButtonResult?> showDialogWidget({required BuildContext context,required String title,@@ -25,7 +29,7 @@ Future<ButtonResult?> showDialogWidget({enableDrag: isDismissible,useRootNavigator: useRootNavigator,builder: (_) {- return DialogWidget(+ return LegacyDialogWidget(title: title,body: body,buttons: buttons,@@ -35,12 +39,12 @@ Future<ButtonResult?> showDialogWidget({);}-class DialogWidget extends StatelessWidget {+class LegacyDialogWidget extends StatelessWidget {final String title;final String? body;final List<ButtonWidget> buttons;final IconData? icon;- const DialogWidget({+ const LegacyDialogWidget({required this.title,this.body,required this.buttons,@@ -68,7 +72,7 @@ class DialogWidget extends StatelessWidget {illustration: icon == null? null: Icon(icon, size: 48, color: colors.iconColor),- content: hasBody ? _DialogBody(body!) : null,+ content: hasBody ? _LegacyDialogBody(body!) : null,actions: [for (final button in visibleButtons)ButtonComponentAdapter(button: button),@@ -84,8 +88,8 @@ class DialogWidget extends StatelessWidget {}}-class _DialogBody extends StatelessWidget {- const _DialogBody(this.body);+class _LegacyDialogBody extends StatelessWidget {+ const _LegacyDialogBody(this.body);final String body;@@ -105,7 +109,7 @@ class _DialogBody extends StatelessWidget {}}-class TextInputDialog extends StatefulWidget {+class LegacyTextInputDialog extends StatefulWidget {final String title;final String? body;final String submitButtonLabel;@@ -126,7 +130,7 @@ class TextInputDialog extends StatefulWidget {final List<TextInputFormatter>? textInputFormatter;final TextInputType? textInputType;final bool popnavAfterSubmission;- const TextInputDialog({+ const LegacyTextInputDialog({required this.title,this.body,required this.submitButtonLabel,@@ -151,10 +155,10 @@ class TextInputDialog extends StatefulWidget {});@override- State<TextInputDialog> createState() => _TextInputDialogState();+ State<LegacyTextInputDialog> createState() => _LegacyTextInputDialogState();}-class _TextInputDialogState extends State<TextInputDialog> {+class _LegacyTextInputDialogState extends State<LegacyTextInputDialog> {static const _loadingSurfaceDelay = Duration(milliseconds: 300);static const _successDisplayDuration = Duration(seconds: 1);@@ -210,7 +214,7 @@ class _TextInputDialogState extends State<TextInputDialog> {illustration: widget.icon == null? null: Icon(widget.icon, size: 48, color: colors.iconColor),- content: _TextInputDialogContent(+ content: _LegacyTextInputDialogContent(body: widget.body,input: TextInputComponent(controller: _textEditingController,@@ -338,8 +342,8 @@ class _TextInputDialogState extends State<TextInputDialog> {}}-class _TextInputDialogContent extends StatelessWidget {- const _TextInputDialogContent({+class _LegacyTextInputDialogContent extends StatelessWidget {+ const _LegacyTextInputDialogContent({required this.input,this.body,this.alignedMessage,diff --git a/mobile/apps/photos/lib/utils/dialog_util.dart b/mobile/apps/photos/lib/utils/dialog_util.dartindex 93a72e092e..2e784da89d 100644--- a/mobile/apps/photos/lib/utils/dialog_util.dart+++ b/mobile/apps/photos/lib/utils/dialog_util.dart@@ -18,7 +18,7 @@ import 'package:photos/ui/components/dialog_widget.dart';import 'package:photos/ui/components/models/button_type.dart';import "package:photos/utils/email_util.dart";-///Will return null if dismissed by tapping outside+/// Legacy info-dialog helper backed by [showDialogWidget].Future<ButtonResult?> showInfoDialog(BuildContext context, {String title = "",@@ -43,7 +43,7 @@ Future<ButtonResult?> showInfoDialog();}-///Will return null if dismissed by tapping outside+/// Legacy error-dialog helper backed by [showDialogWidget].Future<ButtonResult?> showErrorDialog(BuildContext context,String title,@@ -68,6 +68,7 @@ Future<ButtonResult?> showErrorDialog();}+/// Legacy exception-dialog helper backed by [showDialogWidget].Future<ButtonResult?> showErrorDialogForException({required BuildContext context,required Exception exception,@@ -155,7 +156,7 @@ String parseErrorForUI(return genericError;}-///Will return null if dismissed by tapping outside+/// Legacy parsed-error dialog helper backed by [showDialogWidget].Future<ButtonResult?> showGenericErrorDialog({required BuildContext context,bool isDismissible = true,@@ -233,7 +234,7 @@ Future<void> showGenericErrorBottomSheet({);}-///Will return null if dismissed by tapping outside+/// Legacy two-choice dialog helper backed by [showDialogWidget].Future<ButtonResult?> showChoiceDialog(BuildContext context, {required String title,@@ -276,7 +277,11 @@ Future<ButtonResult?> showChoiceDialog();}-///Will return null if dismissed by tapping outside+/// Compatibility adapter for legacy Photos choice sheets.+///+/// Preserves existing two-choice [ButtonResult] behavior while rendering+/// through [BottomSheetComponent]. Prefer [BottomSheetComponent] directly for+/// new sheets.Future<ButtonResult?> showChoiceActionSheet(BuildContext context, {required String title,@@ -344,7 +349,10 @@ ProgressDialog createProgressDialog(return dialog;}-/// Returns null on successful submit, ButtonResult on cancel, and Exception on submit failure.+/// Compatibility adapter for legacy Photos text-input dialogs.+///+/// Returns null on successful submit, [ButtonResult] on cancel, and [Exception]+/// on submit failure. Prefer [BottomSheetComponent] directly for new sheets.Future<dynamic> showTextInputDialog(BuildContext context, {required String title,@@ -373,7 +381,7 @@ Future<dynamic> showTextInputDialog(context: context,useRootNavigator: useRootNavigator,builder: (_) {- return TextInputDialog(+ return LegacyTextInputDialog(title: title,message: message,label: label,