Included a settings icon to every assistant that lets you edit the settings (#327)

This commit is contained in:
Peer Schütt authored and GitHub committed 2025-03-12 11:31:01 +01:00
1 parent 8a23b54e56
commit 200964422d
98 files changed
+685 -411

No files matched your search

@@ -0,0 +1,28 @@
using AIStudio.Dialogs;
using DialogOptions = AIStudio.Dialogs.DialogOptions;
namespace AIStudio.Dialogs.Settings;
public partial class SettingsDialogAssistantBias : SettingsDialogBase
{
private async Task ResetBiasOfTheDayHistory()
{
var dialogParameters = new DialogParameters
{
{ "Message", "Are you sure you want to reset your bias-of-the-day statistics? The system will no longer remember which biases you already know. As a result, biases you are already familiar with may be addressed again." },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>("Reset your bias-of-the-day statistics", dialogParameters, DialogOptions.FULLSCREEN);
var dialogResult = await dialogReference.Result;
if (dialogResult is null || dialogResult.Canceled)
return;
this.SettingsManager.ConfigurationData.BiasOfTheDay.UsedBias.Clear();
this.SettingsManager.ConfigurationData.BiasOfTheDay.DateLastBiasDrawn = DateOnly.MinValue;
await this.SettingsManager.StoreSettings();
await this.MessageBus.SendMessage<bool>(this, Event.CONFIGURATION_CHANGED);
}
}