Added the prompt guide to the settings of the Prompt Optimizer and to configuration plugins (#1165)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-05 14:27:58 +01:00
1 parent a3d38c5db4
commit 974244ae51
19 files changed
+290 -26

No files matched your search

@@ -45,6 +45,17 @@ public partial class ConfigurationFile : ConfigurationBaseCore
[Parameter]
public FileTypeFilter[]? Filter { get; set; }
/// <summary>
/// Shows a button at the end of the field which empties it.
/// </summary>
/// <remarks>
/// For settings where an empty path means something of its own, such as the default prompt guide
/// or no template at all. MudBlazor shows the button only while the field holds a path and can be
/// edited, so a locked setting keeps its path.
/// </remarks>
[Parameter]
public bool Clearable { get; set; }
[Inject]
private RustService RustService { get; init; } = null!;
@@ -134,6 +145,20 @@ public partial class ConfigurationFile : ConfigurationBaseCore
await this.OptionChanged(path);
}
/// <summary>
/// Empties the field at once.
/// </summary>
/// <remarks>
/// The text field reports the empty text as well, which would apply it only after the delay meant
/// for typing. A click needs no such delay, so the timer stops and the change applies right away.
/// </remarks>
private async Task ClearFile()
{
this.timer.Stop();
this.internalText = string.Empty;
await this.OptionChanged(string.Empty);
}
private async Task OptionChanged(string updatedText)
{
this.TextUpdate(updatedText);