feat(ui): constrain decimal input and add stacked timed toasts with uniform actions

This commit is contained in:
2026-11-02 19:19:07 +01:00
parent 22e509d982
commit 86a73b862a
24 changed files with 315 additions and 103 deletions
@@ -5,9 +5,10 @@ namespace Duempelkas.Infrastructure.Services;
public class SettingsService : ISettingsService
{
private static readonly string SettingsPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"Duempelkas", "settings.json");
private readonly string SettingsPath;
public SettingsService(string? directory = null) => SettingsPath = Path.Combine(directory ?? Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Duempelkas"), "settings.json");
private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true };
@@ -24,7 +25,7 @@ public class SettingsService : ISettingsService
await SaveAsync(settings);
}
private static async Task<AppSettings> LoadAsync()
private async Task<AppSettings> LoadAsync()
{
if (!File.Exists(SettingsPath))
return new AppSettings();
@@ -40,7 +41,7 @@ public class SettingsService : ISettingsService
}
}
private static async Task SaveAsync(AppSettings settings)
private async Task SaveAsync(AppSettings settings)
{
var dir = Path.GetDirectoryName(SettingsPath)!;
Directory.CreateDirectory(dir);