Skip to content

armgit / ente

Public Imported from GitHub
0

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

ML continuous toggle for local gallery mode

laurenspriemceb4c1937f0a
diff --git a/mobile/apps/photos/lib/ui/settings/ml/ml_user_dev_screen.dart b/mobile/apps/photos/lib/ui/settings/ml/ml_user_dev_screen.dart
index caa23b83a7..bd1ee9ae32 100644
--- a/mobile/apps/photos/lib/ui/settings/ml/ml_user_dev_screen.dart
+++ b/mobile/apps/photos/lib/ui/settings/ml/ml_user_dev_screen.dart
@@ -169,6 +169,51 @@ class _MLUserDeveloperOptionsState extends State<MLUserDeveloperOptions> {
widget.mlIsEnabled
? const SizedBox(height: 24)
: const SizedBox.shrink(),
+ widget.mlIsEnabled
+ ? MenuItemWidget(
+ captionedTextWidget: const CaptionedTextWidget(
+ title: "Run ML on interactions",
+ ),
+ menuItemColor: colorScheme.fillFaint,
+ trailingWidget: ToggleSwitchWidget(
+ value: () =>
+ localSettings.runMLDuringInteractionOverride,
+ onChanged: () async {
+ try {
+ final enabled = !localSettings
+ .runMLDuringInteractionOverride;
+ await computeController
+ .setMLDebugInteractionOverride(
+ turnOn: enabled,
+ );
+ _logger.info(
+ 'run ML during interaction is turned ${enabled ? 'on' : 'off'}',
+ );
+ if (mounted) {
+ setState(() {});
+ }
+ } catch (e, s) {
+ _logger.warning(
+ 'run ML during interaction toggle failed ',
+ e,
+ s,
+ );
+ await showGenericErrorDialog(
+ context: context,
+ error: e,
+ );
+ }
+ },
+ ),
+ singleBorderRadius: 8,
+ alignCaptionedTextToLeft: true,
+ isBottomBorderRadiusRemoved: true,
+ isGestureDetectorDisabled: true,
+ )
+ : const SizedBox.shrink(),
+ widget.mlIsEnabled
+ ? const SizedBox(height: 24)
+ : const SizedBox.shrink(),
widget.mlIsEnabled
? _buildThresholdsCard(context)
: const SizedBox.shrink(),