fix: update ML service event handling and improve UI element dimensions

This commit is contained in:
Prateek Sunal
2025-07-25 19:56:28 +05:30
parent ad9cb3cb8d
commit b8c7079c94
3 changed files with 27 additions and 24 deletions

View File

@@ -70,31 +70,33 @@ class MLService {
_logger.info("client: $client");
// Listen on ComputeController
Bus.instance.on<ComputeControlEvent>().listen((event) {
if (!flagService.hasGrantedMLConsent) {
return;
}
if (!isProcessBg) {
Bus.instance.on<ComputeControlEvent>().listen((event) {
if (!flagService.hasGrantedMLConsent) {
return;
}
_mlControllerStatus = event.shouldRun;
if (_mlControllerStatus) {
if (_shouldPauseIndexingAndClustering) {
_cancelPauseIndexingAndClustering();
_logger.info(
"MLController allowed running ML, faces indexing undoing previous pause",
);
_mlControllerStatus = event.shouldRun;
if (_mlControllerStatus) {
if (_shouldPauseIndexingAndClustering) {
_cancelPauseIndexingAndClustering();
_logger.info(
"MLController allowed running ML, faces indexing undoing previous pause",
);
} else {
_logger.info(
"MLController allowed running ML, faces indexing starting",
);
}
unawaited(runAllML());
} else {
_logger.info(
"MLController allowed running ML, faces indexing starting",
"MLController stopped running ML, faces indexing will be paused (unless it's fetching embeddings)",
);
pauseIndexingAndClustering();
}
unawaited(runAllML());
} else {
_logger.info(
"MLController stopped running ML, faces indexing will be paused (unless it's fetching embeddings)",
);
pauseIndexingAndClustering();
}
});
});
}
_isInitialized = true;
_logger.info('init done');

View File

@@ -1,4 +1,5 @@
import "dart:async";
import "dart:ui";
import 'package:flutter/material.dart';
import "package:flutter_spinkit/flutter_spinkit.dart";
@@ -66,7 +67,7 @@ class _SmartAlbumsStatusWidgetState extends State<SmartAlbumsStatusWidget>
firstCurve: Curves.easeInOutExpo,
secondCurve: Curves.easeInOutExpo,
sizeCurve: Curves.easeInOutExpo,
crossFadeState: !(_syncingCollection == null ||
crossFadeState: (_syncingCollection == null ||
_syncingCollection!.$1 != widget.collection?.id)
? CrossFadeState.showSecond
: CrossFadeState.showFirst,
@@ -80,9 +81,7 @@ class _SmartAlbumsStatusWidgetState extends State<SmartAlbumsStatusWidget>
.copyWith(left: 14),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: EnteTheme.isDark(context)
? Colors.white.withOpacity(0.20)
: Colors.black.withOpacity(0.65),
color: Colors.black.withOpacity(0.65),
),
child: Row(
mainAxisSize: MainAxisSize.min,

View File

@@ -540,6 +540,8 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
(value?[widget.collection!.id]?.personIDs.isEmpty ?? true)
? "assets/auto-add-people.png"
: "assets/edit-auto-add-people.png",
width: 20,
height: 20,
color: EnteTheme.isDark(context) ? Colors.white : Colors.black,
),
),