Made dialog parameter usage explicit with generic types (#543)
Some checks are pending
Build and Release / Read metadata (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions

This commit is contained in:
Thorsten Sommer 2025-08-28 18:51:44 +02:00 committed by GitHub
parent e03289b680
commit f1c2a65450
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 47 additions and 46 deletions

View File

@ -473,9 +473,9 @@ public partial class AssistantERI : AssistantBaseCore<SettingsDialogERIServer>
if(this.selectedERIServer is null)
return;
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", string.Format(T("Are you sure you want to delete the ERI server preset '{0}'?"), this.selectedERIServer.ServerName) },
{ x => x.Message, string.Format(T("Are you sure you want to delete the ERI server preset '{0}'?"), this.selectedERIServer.ServerName) },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>(T("Delete ERI server preset"), dialogParameters, DialogOptions.FULLSCREEN);
@ -827,9 +827,9 @@ public partial class AssistantERI : AssistantBaseCore<SettingsDialogERIServer>
? string.Format(T("The embedding '{0}' is used in one or more retrieval processes. Are you sure you want to delete it?"), embeddingInfo.EmbeddingName)
: string.Format(T("Are you sure you want to delete the embedding '{0}'?"), embeddingInfo.EmbeddingName);
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", message },
{ x => x.Message, message },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>(T("Delete Embedding"), dialogParameters, DialogOptions.FULLSCREEN);
@ -890,9 +890,9 @@ public partial class AssistantERI : AssistantBaseCore<SettingsDialogERIServer>
private async Task DeleteRetrievalProcess(RetrievalInfo retrievalInfo)
{
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", string.Format(T("Are you sure you want to delete the retrieval process '{0}'?"), retrievalInfo.Name) },
{ x => x.Message, string.Format(T("Are you sure you want to delete the retrieval process '{0}'?"), retrievalInfo.Name) },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>(T("Delete Retrieval Process"), dialogParameters, DialogOptions.FULLSCREEN);

View File

@ -587,9 +587,9 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
//
if (this.SettingsManager.ConfigurationData.Workspace.StorageBehavior is WorkspaceStorageBehavior.STORE_CHATS_MANUALLY && this.hasUnsavedChanges)
{
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", "Are you sure you want to start a new chat? All unsaved changes will be lost." },
{ x => x.Message, "Are you sure you want to start a new chat? All unsaved changes will be lost." },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>("Delete Chat", dialogParameters, DialogOptions.FULLSCREEN);
@ -695,9 +695,9 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
if (this.SettingsManager.ConfigurationData.Workspace.StorageBehavior is WorkspaceStorageBehavior.STORE_CHATS_MANUALLY && this.hasUnsavedChanges)
{
var confirmationDialogParameters = new DialogParameters
var confirmationDialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", T("Are you sure you want to move this chat? All unsaved changes will be lost.") },
{ x => x.Message, T("Are you sure you want to move this chat? All unsaved changes will be lost.") },
};
var confirmationDialogReference = await this.DialogService.ShowAsync<ConfirmDialog>("Unsaved Changes", confirmationDialogParameters, DialogOptions.FULLSCREEN);
@ -706,11 +706,11 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
return;
}
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<WorkspaceSelectionDialog>
{
{ "Message", T("Please select the workspace where you want to move the chat to.") },
{ "SelectedWorkspace", this.ChatThread?.WorkspaceId },
{ "ConfirmText", T("Move chat") },
{ x => x.Message, T("Please select the workspace where you want to move the chat to.") },
{ x => x.SelectedWorkspace, this.ChatThread?.WorkspaceId },
{ x => x.ConfirmText, T("Move chat") },
};
var dialogReference = await this.DialogService.ShowAsync<WorkspaceSelectionDialog>(T("Move Chat to Workspace"), dialogParameters, DialogOptions.FULLSCREEN);

View File

@ -90,9 +90,9 @@ public partial class SettingsPanelEmbeddings : SettingsPanelBase
private async Task DeleteEmbeddingProvider(EmbeddingProvider provider)
{
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", string.Format(T("Are you sure you want to delete the embedding provider '{0}'?"), provider.Name) },
{ x => x.Message, string.Format(T("Are you sure you want to delete the embedding provider '{0}'?"), provider.Name) },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>(T("Delete Embedding Provider"), dialogParameters, DialogOptions.FULLSCREEN);

View File

@ -96,9 +96,9 @@ public partial class SettingsPanelProviders : SettingsPanelBase
[SuppressMessage("Usage", "MWAIS0001:Direct access to `Providers` is not allowed")]
private async Task DeleteLLMProvider(AIStudio.Settings.Provider provider)
{
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", string.Format(T("Are you sure you want to delete the provider '{0}'?"), provider.InstanceName) },
{ x => x.Message, string.Format(T("Are you sure you want to delete the provider '{0}'?"), provider.InstanceName) },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>(T("Delete LLM Provider"), dialogParameters, DialogOptions.FULLSCREEN);
@ -114,9 +114,9 @@ public partial class SettingsPanelProviders : SettingsPanelBase
}
else
{
var issueDialogParameters = new DialogParameters
var issueDialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", string.Format(T("Couldn't delete the provider '{0}'. The issue: {1}. We can ignore this issue and delete the provider anyway. Do you want to ignore it and delete this provider?"), provider.InstanceName, deleteSecretResponse.Issue) },
{ x => x.Message, string.Format(T("Couldn't delete the provider '{0}'. The issue: {1}. We can ignore this issue and delete the provider anyway. Do you want to ignore it and delete this provider?"), provider.InstanceName, deleteSecretResponse.Issue) },
};
var issueDialogReference = await this.DialogService.ShowAsync<ConfirmDialog>(T("Delete LLM Provider"), issueDialogParameters, DialogOptions.FULLSCREEN);

View File

@ -315,9 +315,9 @@ public partial class Workspaces : MSGComponentBase
// Check if the chat has unsaved changes:
if (switchToChat && await MessageBus.INSTANCE.SendMessageUseFirstResult<bool, bool>(this, Event.HAS_CHAT_UNSAVED_CHANGES))
{
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", T("Are you sure you want to load another chat? All unsaved changes will be lost.") },
{ x => x.Message, T("Are you sure you want to load another chat? All unsaved changes will be lost.") },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>(T("Load Chat"), dialogParameters, DialogOptions.FULLSCREEN);
@ -356,10 +356,10 @@ public partial class Workspaces : MSGComponentBase
if (askForConfirmation)
{
var workspaceName = await WorkspaceBehaviour.LoadWorkspaceName(chat.WorkspaceId);
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{
"Message", (chat.WorkspaceId == Guid.Empty) switch
x => x.Message, (chat.WorkspaceId == Guid.Empty) switch
{
true => string.Format(T("Are you sure you want to delete the temporary chat '{0}'?"), chat.Name),
false => string.Format(T("Are you sure you want to delete the chat '{0}' in the workspace '{1}'?"), chat.Name, workspaceName),
@ -492,9 +492,9 @@ public partial class Workspaces : MSGComponentBase
// Determine how many chats are in the workspace:
var chatCount = Directory.EnumerateDirectories(workspacePath).Count();
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", string.Format(T("Are you sure you want to delete the workspace '{0}'? This will also delete {1} chat(s) in this workspace."), workspaceName, chatCount) },
{ x => x.Message, string.Format(T("Are you sure you want to delete the workspace '{0}'? This will also delete {1} chat(s) in this workspace."), workspaceName, chatCount) },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>(T("Delete Workspace"), dialogParameters, DialogOptions.FULLSCREEN);
@ -512,11 +512,11 @@ public partial class Workspaces : MSGComponentBase
if (chat is null)
return;
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<WorkspaceSelectionDialog>
{
{ "Message", T("Please select the workspace where you want to move the chat to.") },
{ "SelectedWorkspace", chat.WorkspaceId },
{ "ConfirmText", T("Move chat") },
{ x => x.Message, T("Please select the workspace where you want to move the chat to.") },
{ x => x.SelectedWorkspace, chat.WorkspaceId },
{ x => x.ConfirmText, T("Move chat") },
};
var dialogReference = await this.DialogService.ShowAsync<WorkspaceSelectionDialog>(T("Move Chat to Workspace"), dialogParameters, DialogOptions.FULLSCREEN);
@ -559,9 +559,9 @@ public partial class Workspaces : MSGComponentBase
// Check if the chat has unsaved changes:
if (await MessageBus.INSTANCE.SendMessageUseFirstResult<bool, bool>(this, Event.HAS_CHAT_UNSAVED_CHANGES))
{
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", T("Are you sure you want to create a another chat? All unsaved changes will be lost.") },
{ x => x.Message, T("Are you sure you want to create a another chat? All unsaved changes will be lost.") },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>(T("Create Chat"), dialogParameters, DialogOptions.FULLSCREEN);

View File

@ -83,9 +83,9 @@ public partial class PandocDialog : MSGComponentBase
private async Task RejectLicense()
{
var message = T("Pandoc is open-source and free, but if you reject its license, you can't install it and some MindWork AI Studio features will be limited (like the integration of Office files) or unavailable (like the generation of Office files). You can change your decision anytime. Are you sure you want to reject the license?");
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", message },
{ x => x.Message, message },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>(T("Reject Pandoc's Licence"), dialogParameters, DialogOptions.FULLSCREEN);

View File

@ -8,9 +8,9 @@ public partial class SettingsDialogAssistantBias : SettingsDialogBase
private async Task ResetBiasOfTheDayHistory()
{
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", T("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.") },
{ x => x.Message, T("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>(T("Reset your bias-of-the-day statistics"), dialogParameters, DialogOptions.FULLSCREEN);

View File

@ -82,9 +82,9 @@ public partial class SettingsDialogChatTemplate : SettingsDialogBase
private async Task DeleteChatTemplate(ChatTemplate chatTemplate)
{
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", string.Format(T("Are you sure you want to delete the chat template '{0}'?"), chatTemplate.Name) },
{ x => x.Message, string.Format(T("Are you sure you want to delete the chat template '{0}'?"), chatTemplate.Name) },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>(T("Delete Chat Template"), dialogParameters, DialogOptions.FULLSCREEN);

View File

@ -151,9 +151,9 @@ public partial class SettingsDialogDataSources : SettingsDialogBase
private async Task DeleteDataSource(IDataSource dataSource)
{
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", string.Format(T("Are you sure you want to delete the data source '{0}' of type {1}?"), dataSource.Name, dataSource.Type.GetDisplayName()) },
{ x => x.Message, string.Format(T("Are you sure you want to delete the data source '{0}' of type {1}?"), dataSource.Name, dataSource.Type.GetDisplayName()) },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>(T("Delete Data Source"), dialogParameters, DialogOptions.FULLSCREEN);

View File

@ -51,9 +51,9 @@ public partial class SettingsDialogProfiles : SettingsDialogBase
private async Task DeleteProfile(Profile profile)
{
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", string.Format(T("Are you sure you want to delete the profile '{0}'?"), profile.Name) },
{ x => x.Message, string.Format(T("Are you sure you want to delete the profile '{0}'?"), profile.Name) },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>(T("Delete Profile"), dialogParameters, DialogOptions.FULLSCREEN);

View File

@ -306,9 +306,9 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, ILan
{
if (await MessageBus.INSTANCE.SendMessageUseFirstResult<bool, bool>(this, Event.HAS_CHAT_UNSAVED_CHANGES))
{
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{ "Message", T("Are you sure you want to leave the chat page? All unsaved changes will be lost.") },
{ x => x.Message, T("Are you sure you want to leave the chat page? All unsaved changes will be lost.") },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>(T("Leave Chat Page"), dialogParameters, DialogOptions.FULLSCREEN);

View File

@ -121,10 +121,10 @@ public static class WorkspaceBehaviour
if (askForConfirmation)
{
var workspaceName = await LoadWorkspaceName(chat.WorkspaceId);
var dialogParameters = new DialogParameters
var dialogParameters = new DialogParameters<ConfirmDialog>
{
{
"Message", (chat.WorkspaceId == Guid.Empty) switch
x => x.Message, (chat.WorkspaceId == Guid.Empty) switch
{
true => TB($"Are you sure you want to delete the temporary chat '{chat.Name}'?"),
false => TB($"Are you sure you want to delete the chat '{chat.Name}' in the workspace '{workspaceName}'?"),

View File

@ -5,6 +5,7 @@
- Improved memory usage in several areas of the app.
- Improved plugin management for configuration plugins so that hot reload detects when a provider or chat template has been removed.
- Improved the dialog for naming chats and workspaces to ensure valid inputs are entered.
- Improved the dialog invocation by making parameter provision more robust.
- Changed the configuration plugin setting name for how often to check for updates from `UpdateBehavior` to `UpdateInterval`.
- Fixed a bug in various assistants where some text fields were not reset when resetting.
- Fixed the input field header in the dialog for naming chats and workspaces.