TF-4141 Add the AI needs-action option into the user settings.
This commit is contained in:
@@ -9,7 +9,8 @@ enum PreferencesOptionType {
|
||||
senderPriority(isLocal: false),
|
||||
thread(isLocal: true),
|
||||
spamReport(isLocal: true),
|
||||
aiScribe(isLocal: true);
|
||||
aiScribe(isLocal: true),
|
||||
aiNeedsAction(isLocal: false);
|
||||
|
||||
final bool isLocal;
|
||||
|
||||
@@ -27,6 +28,8 @@ enum PreferencesOptionType {
|
||||
return appLocalizations.spamReports;
|
||||
case PreferencesOptionType.aiScribe:
|
||||
return appLocalizations.aiScribe;
|
||||
case PreferencesOptionType.aiNeedsAction:
|
||||
return appLocalizations.aiNeedsAction;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +45,8 @@ enum PreferencesOptionType {
|
||||
return appLocalizations.spamReportsSettingExplanation;
|
||||
case PreferencesOptionType.aiScribe:
|
||||
return appLocalizations.aiScribeSettingExplanation;
|
||||
case PreferencesOptionType.aiNeedsAction:
|
||||
return appLocalizations.aiNeedsActionSettingExplanation;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +62,8 @@ enum PreferencesOptionType {
|
||||
return appLocalizations.spamReportToggleDescription;
|
||||
case PreferencesOptionType.aiScribe:
|
||||
return appLocalizations.aiScribeToggleDescription;
|
||||
case PreferencesOptionType.aiNeedsAction:
|
||||
return appLocalizations.aiNeedsActionToggleDescription;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +82,8 @@ enum PreferencesOptionType {
|
||||
return preferencesSetting.spamReportConfig.isEnabled;
|
||||
case PreferencesOptionType.aiScribe:
|
||||
return preferencesSetting.aiScribeConfig.isEnabled;
|
||||
case PreferencesOptionType.aiNeedsAction:
|
||||
return settingOption?.isAINeedsActionEnabled ?? false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ class PreferencesController extends BaseController {
|
||||
|
||||
final _manageAccountDashBoardController = Get.find<ManageAccountDashBoardController>();
|
||||
|
||||
bool get isAIScribeAvailable {
|
||||
bool get isAICapabilitySupported {
|
||||
return _manageAccountDashBoardController.isAICapabilitySupported;
|
||||
}
|
||||
|
||||
@@ -183,6 +183,11 @@ class PreferencesController extends BaseController {
|
||||
displaySenderPriority: !isEnabled,
|
||||
);
|
||||
break;
|
||||
case PreferencesOptionType.aiNeedsAction:
|
||||
newSettingOption = settingOption.value?.copyWith(
|
||||
aiNeedsActionEnabled: !isEnabled,
|
||||
);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -68,17 +68,20 @@ class PreferencesView extends GetWidget<PreferencesController> with AppLoaderMix
|
||||
final availableSettingOptions = [
|
||||
if (settingOption != null)
|
||||
...PreferencesOptionType.values.where(
|
||||
(optionType) => !optionType.isLocal,
|
||||
(type) =>
|
||||
!type.isLocal &&
|
||||
type != PreferencesOptionType.aiNeedsAction,
|
||||
),
|
||||
if (localSettingOption.configs.isNotEmpty)
|
||||
...PreferencesOptionType.values.where(
|
||||
(optionType) => optionType.isLocal,
|
||||
).where((optionType) {
|
||||
if (optionType == PreferencesOptionType.aiScribe) {
|
||||
return controller.isAIScribeAvailable && !PlatformInfo.isMobile;
|
||||
}
|
||||
return true;
|
||||
}),
|
||||
(type) =>
|
||||
type.isLocal &&
|
||||
(type != PreferencesOptionType.aiScribe ||
|
||||
controller.isAICapabilitySupported),
|
||||
),
|
||||
if (settingOption != null &&
|
||||
controller.isAICapabilitySupported)
|
||||
PreferencesOptionType.aiNeedsAction,
|
||||
];
|
||||
|
||||
return Expanded(
|
||||
|
||||
Reference in New Issue
Block a user