Fix data loss risk, reminder bugs; theme, credits, tests

- Store tasks in %APPDATA% (single-file extract dir lost data on update),
  atomic serialized saves, corrupt-file backup, migration of old tasks.json
- Reminders without description never showed (empty balloon text threw)
- Catch up missed reminders on start; monthly recurrence no longer drifts
- Task dialog: date pick kept 00:00, cancel leaked recurrence changes
- CSV import understands quoted fields written by export
- Confirm before deleting; name folders on create; tasks sorted by date
- Single instance, autostart starts hidden in tray, tray icon disposed
- Theme helper for all dialogs, MDL2/Path icons instead of emojis,
  fixed folder selection/badge, localized counts and messages
- Credits (c) Michael Media + Discord link, exe Company/Copyright
- Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 14:08:53 +01:00
parent 5ca2770829
commit 1918712f7f
42 changed files with 1620 additions and 820 deletions

View File

@@ -1,6 +1,7 @@
#nullable enable
using System;
using System.Windows;
using System.Windows.Input;
using ReminderOrganizer.Core;
using ReminderOrganizer.Models;
using ReminderOrganizer.Services;
using ReminderOrganizer.ViewModels;
@@ -13,27 +14,21 @@ namespace ReminderOrganizer
public ReminderTask TaskResult => _viewModel.TaskResult;
public TaskWindow() : this(null)
{
}
public TaskWindow(ReminderTask? existingTask)
public TaskWindow(ReminderTask? existingTask, bool darkMode)
{
InitializeComponent();
var localizationService = ServiceLocator.Services.GetService(typeof(ILocalizationService)) as ILocalizationService;
if (localizationService == null)
{
System.Diagnostics.Debug.WriteLine("[TaskWindow] LocalizationService is null!");
localizationService = new LocalizationService(ServiceLocator.Services.GetService(typeof(IDataService)) as IDataService
?? throw new InvalidOperationException("DataService not found"));
}
Theme.Apply(Resources, darkMode);
var localizationService = (ILocalizationService)ServiceLocator.Services.GetService(typeof(ILocalizationService))!;
_viewModel = new TaskViewModel(localizationService, existingTask);
_viewModel.RequestClose += OnRequestClose;
DataContext = _viewModel;
Loaded += (_, _) =>
{
NameBox.Focus();
NameBox.SelectAll();
};
}
private void OnRequestClose(object? sender, bool result)
@@ -42,9 +37,9 @@ namespace ReminderOrganizer
Close();
}
private void Window_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.LeftButton == System.Windows.Input.MouseButtonState.Pressed)
if (e.LeftButton == MouseButtonState.Pressed && e.OriginalSource is not System.Windows.Controls.TextBox)
{
DragMove();
}