Upcoming view, search/filters, lead reminders, birthdays, folder colors, ICS, sound, undo

- Upcoming: all folders grouped by overdue/today/tomorrow/7 days/later/done
- Search (Ctrl+F) + All/Today/Overdue filters + hide done (persisted)
- Lead reminder 1/2/3 days or 1 week before; birth year shows age
- Several due reminders are combined into one balloon
- Folder colors and reordering (drag, context menu)
- iCalendar export with RRULE and VALARM
- Generated reminder chime (ComfyUI / Stable Audio), can be turned off
- Undo snackbar for deleted tasks/folders (Ctrl+Z), Ctrl+N, Del, Esc
- 41 tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 15:03:36 +01:00
parent 90898d7040
commit 693d79019a
23 changed files with 1388 additions and 205 deletions

View File

@@ -70,6 +70,34 @@ namespace ReminderOrganizer.ViewModels
}
public bool IsInPast => !IsRecurring && ReminderDate <= DateTime.Now;
// lead reminder: index into LeadOptions
public static readonly int[] LeadOptions = { 0, 1, 2, 3, 7 };
private int _selectedLeadIndex;
public int SelectedLeadIndex
{
get => _selectedLeadIndex;
set => SetProperty(ref _selectedLeadIndex, Math.Clamp(value, 0, LeadOptions.Length - 1));
}
public string LeadLabel => _localizationService.GetString("LeadReminder");
public string LeadNone => _localizationService.GetString("LeadNone");
public string Lead1 => _localizationService.GetString("LeadOneDay");
public string Lead2 => string.Format(_localizationService.GetString("LeadDays"), 2);
public string Lead3 => string.Format(_localizationService.GetString("LeadDays"), 3);
public string Lead7 => _localizationService.GetString("LeadWeek");
// birthday
private string _birthYearText = "";
public string BirthYearText
{
get => _birthYearText;
set { if (SetProperty(ref _birthYearText, value ?? "")) OnPropertyChanged(nameof(BirthYearError)); }
}
public int? ParsedBirthYear =>
int.TryParse(BirthYearText.Trim(), out var y) && y >= 1900 && y <= DateTime.Now.Year ? y : null;
public bool BirthYearError => BirthYearText.Trim().Length > 0 && ParsedBirthYear == null;
public bool IsYearly => IsRecurring && SelectedRecurrenceIndex == (int)RecurrenceType.Yearly;
public string BirthYearLabel => _localizationService.GetString("BirthYear");
public string PastDateWarning => _localizationService.GetString("PastDateWarning");
public string NextOccurrenceLabel => _localizationService.GetString("NextOccurrence");
public string QuickLabel => _localizationService.GetString("Quick");
@@ -121,6 +149,7 @@ namespace ReminderOrganizer.ViewModels
{
// Only copied to the task in Save() – Cancel must not change anything.
SetProperty(ref _isRecurring, value);
OnPropertyChanged(nameof(IsYearly));
OnPropertyChanged(nameof(NextOccurrenceText));
OnPropertyChanged(nameof(IsInPast));
}
@@ -133,6 +162,7 @@ namespace ReminderOrganizer.ViewModels
{
if (value < 0) return;
SetProperty(ref _selectedRecurrenceIndex, value);
OnPropertyChanged(nameof(IsYearly));
OnPropertyChanged(nameof(IsDailySelected));
OnPropertyChanged(nameof(IsWeeklySelected));
OnPropertyChanged(nameof(IsMonthlySelected));
@@ -224,6 +254,8 @@ namespace ReminderOrganizer.ViewModels
_reminderDate = existingTask.ReminderDate;
_isRecurring = existingTask.IsRecurring;
_selectedRecurrenceIndex = (int)existingTask.RecurrenceType;
_selectedLeadIndex = Math.Max(0, Array.IndexOf(LeadOptions, existingTask.LeadDays));
_birthYearText = existingTask.BirthYear?.ToString() ?? "";
}
SaveCommand = new RelayCommand(Save, CanSave);
@@ -239,7 +271,7 @@ namespace ReminderOrganizer.ViewModels
OnPropertyChanged(nameof(SelectedMinuteIndex));
}
private bool CanSave() => !string.IsNullOrWhiteSpace(Name);
private bool CanSave() => !string.IsNullOrWhiteSpace(Name) && !BirthYearError;
private void ValidateInput()
{
@@ -279,6 +311,12 @@ namespace ReminderOrganizer.ViewModels
{
if (!CanSave()) return;
var leadDays = LeadOptions[SelectedLeadIndex];
bool timingChanged = _originalTask.ReminderDate != ReminderDate || _originalTask.LeadDays != leadDays;
_originalTask.LeadDays = leadDays;
_originalTask.BirthYear = IsYearly ? ParsedBirthYear : null;
if (timingChanged || _isNewTask) _originalTask.IsPreNotified = false;
_originalTask.Name = Name.Trim();
_originalTask.Description = Description?.Trim() ?? "";
_originalTask.IsRecurring = IsRecurring;