Applied several small fixes (#536)
Some checks failed
Build and Release / Read metadata (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis updater) (push) Has been cancelled
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) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg updater) (push) Has been cancelled
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) Has been cancelled
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) Has been cancelled
Build and Release / Prepare & create release (push) Has been cancelled
Build and Release / Publish release (push) Has been cancelled

This commit is contained in:
Thorsten Sommer 2025-08-15 21:16:51 +02:00 committed by GitHub
parent 9ca2860079
commit 7d10bb00f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 103 additions and 9 deletions

View File

@ -5,6 +5,7 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FNV/@EntryIndexedValue">FNV</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GWDG/@EntryIndexedValue">GWDG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HF/@EntryIndexedValue">HF</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IERI/@EntryIndexedValue">IERI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LLM/@EntryIndexedValue">LLM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LM/@EntryIndexedValue">LM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MSG/@EntryIndexedValue">MSG</s:String>
@ -20,6 +21,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=groq/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=gwdg/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=huggingface/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ieri/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=mwais/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ollama/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=tauri_0027s/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@ -384,7 +384,17 @@ public abstract partial class AssistantBase<TSettings> : AssistantLowerBase wher
protected override void DisposeResources()
{
this.formChangeTimer.Dispose();
try
{
this.formChangeTimer.Stop();
this.formChangeTimer.Dispose();
}
catch
{
// ignore
}
base.DisposeResources();
}
#endregion

View File

@ -92,4 +92,23 @@ public partial class ConfigurationText : ConfigurationBaseCore
await this.SettingsManager.StoreSettings();
await this.InformAboutChange();
}
#region Overrides of MSGComponentBase
protected override void DisposeResources()
{
try
{
this.timer.Stop();
this.timer.Dispose();
}
catch
{
// ignore
}
base.DisposeResources();
}
#endregion
}

View File

@ -4,7 +4,7 @@ using Timer = System.Timers.Timer;
namespace AIStudio.Components;
public partial class DebouncedTextField : MudComponentBase
public partial class DebouncedTextField : MudComponentBase, IDisposable
{
[Parameter]
public string Label { get; set; } = string.Empty;
@ -51,6 +51,7 @@ public partial class DebouncedTextField : MudComponentBase
private readonly Timer debounceTimer = new();
private string text = string.Empty;
private string lastParameterText = string.Empty;
private bool isInitialized;
#region Overrides of ComponentBase
@ -68,20 +69,30 @@ public partial class DebouncedTextField : MudComponentBase
this.InvokeAsync(() => this.WhenTextCanged(this.text));
};
this.isInitialized = true;
await base.OnInitializedAsync();
}
protected override void OnParametersSet()
protected override async Task OnParametersSetAsync()
{
// Ensure the timer uses the latest debouncing interval:
if (!this.isInitialized)
return;
if(Math.Abs(this.debounceTimer.Interval - this.DebounceTime.TotalMilliseconds) > 1)
this.debounceTimer.Interval = this.DebounceTime.TotalMilliseconds;
// Only sync when the parent's parameter actually changed since the last change:
if (this.Text != this.lastParameterText)
{
this.text = this.Text;
this.lastParameterText = this.Text;
this.debounceTimer.Stop();
this.debounceTimer.Start();
}
this.debounceTimer.Stop();
this.debounceTimer.Start();
await base.OnParametersSetAsync();
}
#endregion
@ -92,4 +103,21 @@ public partial class DebouncedTextField : MudComponentBase
this.debounceTimer.Stop();
this.debounceTimer.Start();
}
#region IDisposable
public void Dispose()
{
try
{
this.debounceTimer.Stop();
this.debounceTimer.Dispose();
}
catch
{
// ignore
}
}
#endregion
}

View File

@ -100,6 +100,23 @@ public partial class Chat : MSGComponentBase
#region Overrides of MSGComponentBase
protected override void DisposeResources()
{
try
{
this.splitterSaveTimer.Stop();
this.splitterSaveTimer.Dispose();
}
catch
{
// ignore
}
base.DisposeResources();
}
#endregion
protected override Task ProcessIncomingMessage<T>(ComponentBase? sendingComponent, Event triggeredEvent, T? data) where T : default
{
switch (triggeredEvent)
@ -111,6 +128,4 @@ public partial class Chat : MSGComponentBase
return Task.CompletedTask;
}
#endregion
}

View File

@ -152,4 +152,23 @@ public partial class Writer : MSGComponentBase
this.suggestion = string.Join(' ', words.Skip(1));
this.StateHasChanged();
}
#region Overrides of MSGComponentBase
protected override void DisposeResources()
{
try
{
this.typeTimer.Stop();
this.typeTimer.Dispose();
}
catch
{
// ignore
}
base.DisposeResources();
}
#endregion
}

View File

@ -1,2 +1,3 @@
# v0.9.51, build 226 (2025-08-xx xx:xx UTC)
- Improved memory usage in several areas of the app.
- Fixed a bug in various assistants where some text fields were not reset when resetting.