[mob][photos] Rename "hidden" to "ignored"

This commit is contained in:
laurenspriem 2024-05-03 16:17:56 +05:30
parent 662dc1a32b
commit 319dc055de
3 changed files with 22 additions and 24 deletions

View file

@ -293,8 +293,9 @@ class ClusterFeedbackService {
return true;
}
Future<void> hideCluster(int clusterID) async {
await PersonService.instance.addPerson('(hidden)', clusterID, isHidden: true);
Future<void> ignoreCluster(int clusterID) async {
await PersonService.instance
.addPerson('(ignored)', clusterID, isHidden: true);
Bus.instance.fire(PeopleChangedEvent());
return;
}

View file

@ -45,7 +45,7 @@ class ClusterAppBar extends StatefulWidget {
enum ClusterPopupAction {
setCover,
breakupCluster,
hide,
ignore,
}
class _AppBarWidgetState extends State<ClusterAppBar> {
@ -110,8 +110,8 @@ class _AppBarWidgetState extends State<ClusterAppBar> {
items.addAll(
[
EntePopupMenuItem(
"Hide person",
value: ClusterPopupAction.hide,
"Ignore person",
value: ClusterPopupAction.ignore,
icon: Icons.hide_image_outlined,
),
EntePopupMenuItem(
@ -132,8 +132,8 @@ class _AppBarWidgetState extends State<ClusterAppBar> {
if (value == ClusterPopupAction.breakupCluster) {
// ignore: unawaited_futures
await _breakUpCluster(context);
} else if (value == ClusterPopupAction.hide) {
await _onHideClusterClicked(context);
} else if (value == ClusterPopupAction.ignore) {
await _onIgnoredClusterClicked(context);
}
// else if (value == ClusterPopupAction.setCover) {
// await setCoverPhoto(context);
@ -197,19 +197,19 @@ class _AppBarWidgetState extends State<ClusterAppBar> {
}
}
Future<void> _onHideClusterClicked(BuildContext context) async {
Future<void> _onIgnoredClusterClicked(BuildContext context) async {
await showChoiceDialog(
context,
title: "Are you sure you want to hide this person?",
title: "Are you sure you want to ignore this person?",
body:
"The person will not be displayed in the discovery tap anymore. You can unhide the person by going to the hidden person grouping from the file info of one of the photos.",
"The person grouping will not be displayed in the discovery tap anymore. Photos will remain untouched.",
firstButtonLabel: "Yes, confirm",
firstButtonOnTap: () async {
try {
await ClusterFeedbackService.instance.hideCluster(widget.clusterID);
await ClusterFeedbackService.instance.ignoreCluster(widget.clusterID);
Navigator.of(context).pop(); // Close the cluster page
} catch (e, s) {
_logger.severe('Hiding a cluster failed', e, s);
_logger.severe('Ignoring a cluster failed', e, s);
// await showGenericErrorDialog(context: context, error: e);
}
},

View file

@ -47,8 +47,7 @@ enum PeoplPopupAction {
remove,
viewPhotos,
confirmPhotos,
hide,
unhide,
unignore,
}
class _AppBarWidgetState extends State<PeopleAppBar> {
@ -214,14 +213,14 @@ class _AppBarWidgetState extends State<PeopleAppBar> {
items.addAll(
[
const PopupMenuItem(
value: PeoplPopupAction.unhide,
value: PeoplPopupAction.unignore,
child: Row(
children: [
Icon(Icons.visibility_outlined),
Padding(
padding: EdgeInsets.all(8),
),
Text("Unhide person"),
Text("Show person"),
],
),
),
@ -259,10 +258,8 @@ class _AppBarWidgetState extends State<PeopleAppBar> {
await _renameAlbum(context);
} else if (value == PeoplPopupAction.setCover) {
await setCoverPhoto(context);
} else if (value == PeoplPopupAction.hide) {
// ignore: unawaited_futures
} else if (value == PeoplPopupAction.unhide) {
await _unhidePerson(context);
} else if (value == PeoplPopupAction.unignore) {
await _showPerson(context);
} else if (value == PeoplPopupAction.remove) {
await PersonService.instance.deletePerson(widget.person.remoteID);
}
@ -274,12 +271,12 @@ class _AppBarWidgetState extends State<PeopleAppBar> {
return actions;
}
Future<void> _unhidePerson(BuildContext context) async {
Future<void> _showPerson(BuildContext context) async {
bool assignName = false;
await showChoiceDialog(
context,
title: "Are you sure you want to unhide this person?",
firstButtonLabel: "Yes, unhide person",
title: "Are you sure you want to show this person in people section again??",
firstButtonLabel: "Yes, show person",
firstButtonOnTap: () async {
try {
await PersonService.instance
@ -287,7 +284,7 @@ class _AppBarWidgetState extends State<PeopleAppBar> {
Bus.instance.fire(PeopleChangedEvent());
assignName = true;
} catch (e, s) {
_logger.severe('Unhiding and naming person failed', e, s);
_logger.severe('Unignoring/showing and naming person failed', e, s);
// await showGenericErrorDialog(context: context, error: e);
}
},