2026-11-29 14:42:16 +01:00
|
|
|
|
#nullable enable
|
2026-11-25 13:44:02 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.ObjectModel;
|
2026-11-29 14:42:16 +01:00
|
|
|
|
using System.Globalization;
|
2026-11-29 15:06:19 +01:00
|
|
|
|
using System.Linq;
|
2026-11-25 13:44:02 +01:00
|
|
|
|
using ReminderOrganizer.Core;
|
|
|
|
|
|
|
|
|
|
|
|
namespace ReminderOrganizer.Models
|
|
|
|
|
|
{
|
|
|
|
|
|
public class ReminderTask : ViewModelBase
|
|
|
|
|
|
{
|
|
|
|
|
|
private string _id = Guid.NewGuid().ToString();
|
|
|
|
|
|
private string _name = "New Task";
|
|
|
|
|
|
private string _description = "";
|
|
|
|
|
|
private DateTime _reminderDate = DateTime.Now.AddHours(1);
|
|
|
|
|
|
private bool _isNotified = false;
|
|
|
|
|
|
private bool _isRecurring = false;
|
|
|
|
|
|
private RecurrenceType _recurrenceType = RecurrenceType.Yearly;
|
|
|
|
|
|
|
|
|
|
|
|
public string Id
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _id;
|
|
|
|
|
|
set => SetProperty(ref _id, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string Name
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _name;
|
|
|
|
|
|
set => SetProperty(ref _name, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string Description
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _description;
|
|
|
|
|
|
set => SetProperty(ref _description, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public DateTime ReminderDate
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _reminderDate;
|
2026-11-29 14:42:16 +01:00
|
|
|
|
set { if (SetProperty(ref _reminderDate, value)) RaiseDisplay(); }
|
2026-11-25 13:44:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsNotified
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _isNotified;
|
2026-11-29 14:42:16 +01:00
|
|
|
|
set { if (SetProperty(ref _isNotified, value)) OnPropertyChanged(nameof(RelativeDate)); }
|
2026-11-25 13:44:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsRecurring
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _isRecurring;
|
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>
2026-11-25 15:03:36 +01:00
|
|
|
|
set { if (SetProperty(ref _isRecurring, value)) OnPropertyChanged(nameof(AgeText)); }
|
2026-11-25 13:44:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public RecurrenceType RecurrenceType
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _recurrenceType;
|
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>
2026-11-25 15:03:36 +01:00
|
|
|
|
set { if (SetProperty(ref _recurrenceType, value)) OnPropertyChanged(nameof(AgeText)); }
|
2026-11-25 13:44:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
Snooze notifications, morning summary, ICS import, data folder sync
- Windows toast notifications with snooze (10 min / 1 h / tomorrow) and
done buttons; balloon fallback; works when Windows starts the app
- Recurring entries snooze via SnoozedUntil without moving their date;
lead reminders keep the real date
- Morning summary once a day from a chosen hour (pure DailySummary)
- iCalendar import incl. Google birthday calendar, folded lines, UTC,
alarms, own export round trip, duplicates skipped by UID, undo
- Data folder selectable (location.json pointer), file watcher reloads
changes from another PC (own writes ignored)
- Themed date picker calendar, WPF tray menu, arrow/Home/End/Space keys
- 90 tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 20:37:20 +01:00
|
|
|
|
private DateTime? _snoozedUntil;
|
|
|
|
|
|
/// <summary>Snoozed reminder for recurring entries (the real date stays unchanged).</summary>
|
|
|
|
|
|
public DateTime? SnoozedUntil
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _snoozedUntil;
|
|
|
|
|
|
set => SetProperty(ref _snoozedUntil, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// "Remind me again later": one-off tasks move their date; recurring tasks and anniversaries keep their
|
|
|
|
|
|
/// date (it already moved to the next occurrence) and get an extra reminder at <c>now + delay</c>.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="keepDate">true for a lead ("in 2 days") reminder: the real date must not move.</param>
|
|
|
|
|
|
public void Snooze(DateTime until, bool keepDate = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (IsRecurring || keepDate)
|
|
|
|
|
|
{
|
|
|
|
|
|
SnoozedUntil = until;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
ReminderDate = until;
|
|
|
|
|
|
IsNotified = false;
|
|
|
|
|
|
IsPreNotified = true; // the lead reminder is long past
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
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>
2026-11-25 15:03:36 +01:00
|
|
|
|
private int _leadDays;
|
|
|
|
|
|
/// <summary>Extra reminder this many days before the date (0 = none).</summary>
|
|
|
|
|
|
public int LeadDays
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _leadDays;
|
|
|
|
|
|
set => SetProperty(ref _leadDays, Math.Max(0, value));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private bool _isPreNotified;
|
|
|
|
|
|
/// <summary>Lead reminder already shown for the current occurrence.</summary>
|
|
|
|
|
|
public bool IsPreNotified
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _isPreNotified;
|
|
|
|
|
|
set => SetProperty(ref _isPreNotified, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int? _birthYear;
|
|
|
|
|
|
/// <summary>Optional, for yearly birthdays: shows "turns 40".</summary>
|
|
|
|
|
|
public int? BirthYear
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _birthYear;
|
|
|
|
|
|
set { if (SetProperty(ref _birthYear, value)) OnPropertyChanged(nameof(AgeText)); }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>Age reached on the next date (yearly tasks with birth year only).</summary>
|
|
|
|
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
|
|
|
|
public int? UpcomingAge =>
|
|
|
|
|
|
BirthYear is int y && IsRecurring && RecurrenceType == RecurrenceType.Yearly && ReminderDate.Year > y
|
|
|
|
|
|
? ReminderDate.Year - y : null;
|
|
|
|
|
|
|
2026-11-29 15:06:19 +01:00
|
|
|
|
/// <summary>Set once by the app: (task, years) → "turns 40" / "10th anniversary · Tin" …</summary>
|
|
|
|
|
|
public static Func<ReminderTask, int, string>? AgeFormatter { get; set; }
|
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>
2026-11-25 15:03:36 +01:00
|
|
|
|
|
|
|
|
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
2026-11-29 15:06:19 +01:00
|
|
|
|
public string? AgeText => UpcomingAge is int a ? (AgeFormatter?.Invoke(this, a) ?? a.ToString()) : null;
|
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>
2026-11-25 15:03:36 +01:00
|
|
|
|
|
2026-11-29 15:06:19 +01:00
|
|
|
|
private bool _isAnniversary;
|
|
|
|
|
|
/// <summary>Anniversary (birthday, wedding …): yearly, date only, reminded at <see cref="BirthdayHour"/>.
|
|
|
|
|
|
/// Stored as "IsBirthday" for compatibility with older files.</summary>
|
|
|
|
|
|
[System.Text.Json.Serialization.JsonPropertyName("IsBirthday")]
|
|
|
|
|
|
public bool IsAnniversary
|
2026-11-29 14:42:16 +01:00
|
|
|
|
{
|
2026-11-29 15:06:19 +01:00
|
|
|
|
get => _isAnniversary;
|
|
|
|
|
|
set { if (SetProperty(ref _isAnniversary, value)) RaiseDisplay(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string? _categoryId;
|
|
|
|
|
|
/// <summary>Anniversary category (see <see cref="Category"/>); null = birthday.</summary>
|
|
|
|
|
|
public string? CategoryId
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _categoryId;
|
|
|
|
|
|
set { if (SetProperty(ref _categoryId, value)) RaiseDisplay(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>Set once by the app: id → category.</summary>
|
|
|
|
|
|
public static Func<string?, Category?>? CategoryLookup { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
|
|
|
|
public Category? Category => IsAnniversary ? CategoryLookup?.Invoke(CategoryId ?? Category.BirthdayId) : null;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>Accent color: category for anniversaries, otherwise folder.</summary>
|
|
|
|
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
|
|
|
|
public string AccentColor => Category?.Color ?? FolderColor;
|
|
|
|
|
|
|
|
|
|
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
|
|
|
|
public string? CategoryGlyph => Category?.Glyph;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>Call after categories were edited.</summary>
|
|
|
|
|
|
public void RefreshCategory()
|
|
|
|
|
|
{
|
|
|
|
|
|
OnPropertyChanged(nameof(Category));
|
|
|
|
|
|
RaiseDisplay();
|
2026-11-29 14:42:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public const int BirthdayHour = 9;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>Set once by the app: culture for month names, relative-date formatter.</summary>
|
|
|
|
|
|
public static Func<CultureInfo>? DisplayCulture { get; set; }
|
|
|
|
|
|
public static Func<DateTime, DateTime, string>? RelativeFormatter { get; set; }
|
Professional redesign: native window, settings, calmer UI
- WindowChrome: resizable, snap layouts, native shadow, DWM rounded
corners; size/position remembered; fade-in after load (no theme flash)
- Menu bar replaced by a settings window (theme system/light/dark,
language, sound, autostart, categories, data, shortcuts, about)
- Shared styles in Themes/Controls.xaml; neutral palette with one accent
applied to Application.Resources (context menus/tooltips themed)
- Rows: To-Do style check left, title + details, relative date right,
actions on hover, visible selection (Enter edits, Del deletes)
- No glow/scale effects; subtle animations (dialogs, snackbar, chevrons)
- Checking a recurring task moves it to the next date (with undo)
- Themed combo box, date picker, check box; neutral dialog headers
- New flat app icon (tools/make_icon.py)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 18:10:45 +01:00
|
|
|
|
public static Func<RecurrenceType, string>? RecurrenceFormatter { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>"Weekly" etc. for recurring appointments (empty for one-off tasks and anniversaries).</summary>
|
|
|
|
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
|
|
|
|
public string RecurrenceText => IsRecurring && !IsAnniversary ? RecurrenceFormatter?.Invoke(RecurrenceType) ?? RecurrenceType.ToString() : "";
|
2026-11-29 14:42:16 +01:00
|
|
|
|
|
|
|
|
|
|
/// <summary>"19. März" for birthdays, otherwise "19.03.2027 09:00".</summary>
|
|
|
|
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
2026-11-29 15:06:19 +01:00
|
|
|
|
public string DisplayDate => IsAnniversary
|
2026-11-29 14:42:16 +01:00
|
|
|
|
? ReminderDate.ToString(DayMonthPattern(DisplayCulture?.Invoke() ?? CultureInfo.CurrentCulture), DisplayCulture?.Invoke() ?? CultureInfo.CurrentCulture)
|
|
|
|
|
|
: ReminderDate.ToString("dd.MM.yyyy HH:mm", CultureInfo.InvariantCulture);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>"heute", "morgen", "in 5 Tagen", "vor 2 Tagen".</summary>
|
|
|
|
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
|
|
|
|
public string RelativeDate => IsNotified ? "" : RelativeFormatter?.Invoke(ReminderDate, DateTime.Now) ?? "";
|
|
|
|
|
|
|
|
|
|
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
|
|
|
|
public int DaysUntil => (ReminderDate.Date - DateTime.Today).Days;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>Day number + short month for the card view.</summary>
|
|
|
|
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
|
|
|
|
public string DayText => ReminderDate.Day.ToString(CultureInfo.InvariantCulture);
|
|
|
|
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
|
|
|
|
public string MonthText => ReminderDate.ToString("MMM", DisplayCulture?.Invoke() ?? CultureInfo.CurrentCulture).TrimEnd('.').ToUpperInvariant();
|
|
|
|
|
|
|
|
|
|
|
|
public static string DayMonthPattern(CultureInfo c) => c.TwoLetterISOLanguageName == "de" ? "d. MMMM" : "MMMM d";
|
|
|
|
|
|
|
|
|
|
|
|
private void RaiseDisplay()
|
|
|
|
|
|
{
|
|
|
|
|
|
OnPropertyChanged(nameof(DisplayDate));
|
|
|
|
|
|
OnPropertyChanged(nameof(RelativeDate));
|
|
|
|
|
|
OnPropertyChanged(nameof(DaysUntil));
|
|
|
|
|
|
OnPropertyChanged(nameof(DayText));
|
|
|
|
|
|
OnPropertyChanged(nameof(MonthText));
|
|
|
|
|
|
OnPropertyChanged(nameof(AgeText));
|
2026-11-29 15:06:19 +01:00
|
|
|
|
OnPropertyChanged(nameof(AccentColor));
|
|
|
|
|
|
OnPropertyChanged(nameof(CategoryGlyph));
|
2026-11-29 14:42:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>Next birthday on/after <paramref name="today"/> at BirthdayHour (29 Feb → 28 Feb in other years).</summary>
|
|
|
|
|
|
public static DateTime NextBirthday(int day, int month, DateTime today)
|
|
|
|
|
|
{
|
|
|
|
|
|
DateTime For(int year) => new(year, month, Math.Min(day, DateTime.DaysInMonth(year, month)), BirthdayHour, 0, 0);
|
|
|
|
|
|
var d = For(today.Year);
|
|
|
|
|
|
return d.Date >= today.Date ? d : For(today.Year + 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
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>
2026-11-25 15:03:36 +01:00
|
|
|
|
private string _folderName = "";
|
|
|
|
|
|
/// <summary>Runtime only: name of the folder holding this task (for the "Upcoming" view).</summary>
|
|
|
|
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
|
|
|
|
public string FolderName { get => _folderName; set => SetProperty(ref _folderName, value); }
|
|
|
|
|
|
|
|
|
|
|
|
private string _folderColor = Folder.DefaultColor;
|
|
|
|
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
2026-11-29 15:06:19 +01:00
|
|
|
|
public string FolderColor { get => _folderColor; set { if (SetProperty(ref _folderColor, value)) OnPropertyChanged(nameof(AccentColor)); } }
|
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>
2026-11-25 15:03:36 +01:00
|
|
|
|
|
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>
2026-11-25 14:08:53 +01:00
|
|
|
|
public DateTime GetNextOccurrence() => GetNextOccurrence(DateTime.Now);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// First occurrence after <paramref name="now"/>. Steps are counted from the original
|
|
|
|
|
|
/// date, so "31 Jan monthly" gives 29 Feb, 31 Mar, 30 Apr … instead of drifting to the 28th.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public DateTime GetNextOccurrence(DateTime now)
|
2026-11-25 13:44:02 +01:00
|
|
|
|
{
|
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>
2026-11-25 14:08:53 +01:00
|
|
|
|
var start = ReminderDate;
|
|
|
|
|
|
if (start > now) return start;
|
|
|
|
|
|
|
|
|
|
|
|
// Jump close to "now" first so long gaps (app off for years) don't loop thousands of times.
|
|
|
|
|
|
int k = RecurrenceType switch
|
|
|
|
|
|
{
|
|
|
|
|
|
RecurrenceType.Daily => Math.Max(0, (int)((now - start).TotalDays) - 1),
|
|
|
|
|
|
RecurrenceType.Weekly => Math.Max(0, (int)((now - start).TotalDays / 7) - 1),
|
|
|
|
|
|
RecurrenceType.Monthly => Math.Max(0, (now.Year - start.Year) * 12 + now.Month - start.Month - 1),
|
|
|
|
|
|
_ => Math.Max(0, now.Year - start.Year - 1)
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
DateTime next;
|
|
|
|
|
|
do
|
2026-11-25 13:44:02 +01:00
|
|
|
|
{
|
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>
2026-11-25 14:08:53 +01:00
|
|
|
|
k++;
|
2026-11-25 13:44:02 +01:00
|
|
|
|
next = RecurrenceType switch
|
|
|
|
|
|
{
|
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>
2026-11-25 14:08:53 +01:00
|
|
|
|
RecurrenceType.Daily => start.AddDays(k),
|
|
|
|
|
|
RecurrenceType.Weekly => start.AddDays(7 * k),
|
|
|
|
|
|
RecurrenceType.Monthly => start.AddMonths(k),
|
|
|
|
|
|
_ => start.AddYears(k)
|
2026-11-25 13:44:02 +01:00
|
|
|
|
};
|
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>
2026-11-25 14:08:53 +01:00
|
|
|
|
} while (next <= now);
|
2026-11-25 13:44:02 +01:00
|
|
|
|
return next;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
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>
2026-11-25 14:08:53 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Marks every due task: one-off tasks become notified, recurring ones move to their next date.
|
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>
2026-11-25 15:03:36 +01:00
|
|
|
|
/// Also emits lead reminders (LeadDays before the date) once per occurrence.
|
|
|
|
|
|
/// Returns what should be shown now; for lead reminders <see cref="DueReminder.Date"/> is the upcoming date.
|
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>
2026-11-25 14:08:53 +01:00
|
|
|
|
/// </summary>
|
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>
2026-11-25 15:03:36 +01:00
|
|
|
|
public static System.Collections.Generic.List<DueReminder> ProcessDue(System.Collections.Generic.IEnumerable<Folder> folders, DateTime now)
|
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>
2026-11-25 14:08:53 +01:00
|
|
|
|
{
|
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>
2026-11-25 15:03:36 +01:00
|
|
|
|
var due = new System.Collections.Generic.List<DueReminder>();
|
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>
2026-11-25 14:08:53 +01:00
|
|
|
|
foreach (var folder in folders)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var task in folder.Tasks)
|
|
|
|
|
|
{
|
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>
2026-11-25 15:03:36 +01:00
|
|
|
|
if (task.IsNotified) continue;
|
Snooze notifications, morning summary, ICS import, data folder sync
- Windows toast notifications with snooze (10 min / 1 h / tomorrow) and
done buttons; balloon fallback; works when Windows starts the app
- Recurring entries snooze via SnoozedUntil without moving their date;
lead reminders keep the real date
- Morning summary once a day from a chosen hour (pure DailySummary)
- iCalendar import incl. Google birthday calendar, folded lines, UTC,
alarms, own export round trip, duplicates skipped by UID, undo
- Data folder selectable (location.json pointer), file watcher reloads
changes from another PC (own writes ignored)
- Themed date picker calendar, WPF tray menu, arrow/Home/End/Space keys
- 90 tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 20:37:20 +01:00
|
|
|
|
// snoozed reminder of a recurring entry: fire once, keep the real date
|
|
|
|
|
|
if (task.SnoozedUntil is DateTime snoozed && snoozed <= now)
|
|
|
|
|
|
{
|
|
|
|
|
|
due.Add(new DueReminder(task, task.ReminderDate, false, task.UpcomingAge));
|
|
|
|
|
|
task.SnoozedUntil = null;
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
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>
2026-11-25 15:03:36 +01:00
|
|
|
|
if (task.ReminderDate <= now)
|
|
|
|
|
|
{
|
|
|
|
|
|
due.Add(new DueReminder(task, task.ReminderDate, false, task.UpcomingAge));
|
|
|
|
|
|
task.IsPreNotified = false;
|
|
|
|
|
|
if (task.IsRecurring)
|
|
|
|
|
|
task.ReminderDate = task.GetNextOccurrence(now);
|
|
|
|
|
|
else
|
|
|
|
|
|
task.IsNotified = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (task.LeadDays > 0 && !task.IsPreNotified && now >= task.ReminderDate.AddDays(-task.LeadDays))
|
|
|
|
|
|
{
|
|
|
|
|
|
due.Add(new DueReminder(task, task.ReminderDate, true, task.UpcomingAge));
|
|
|
|
|
|
task.IsPreNotified = true;
|
|
|
|
|
|
}
|
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>
2026-11-25 14:08:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return due;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-25 13:44:02 +01:00
|
|
|
|
public ReminderTask() { }
|
|
|
|
|
|
|
|
|
|
|
|
public ReminderTask(string name, string description, DateTime reminderDate)
|
|
|
|
|
|
{
|
|
|
|
|
|
Name = name;
|
|
|
|
|
|
Description = description;
|
|
|
|
|
|
ReminderDate = reminderDate;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
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>
2026-11-25 15:03:36 +01:00
|
|
|
|
/// <summary>One notification to show. Age is the age reached on <paramref name="Date"/> (birthdays).</summary>
|
|
|
|
|
|
public record DueReminder(ReminderTask Task, DateTime Date, bool IsLead, int? Age);
|
|
|
|
|
|
|
2026-11-25 13:44:02 +01:00
|
|
|
|
public enum RecurrenceType
|
|
|
|
|
|
{
|
|
|
|
|
|
Daily,
|
|
|
|
|
|
Weekly,
|
|
|
|
|
|
Monthly,
|
|
|
|
|
|
Yearly
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class Folder : ViewModelBase
|
|
|
|
|
|
{
|
|
|
|
|
|
private string _id = Guid.NewGuid().ToString();
|
|
|
|
|
|
private string _name = "New Folder";
|
|
|
|
|
|
private ObservableCollection<ReminderTask> _tasks = new();
|
|
|
|
|
|
|
|
|
|
|
|
public string Id
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _id;
|
|
|
|
|
|
set => SetProperty(ref _id, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string Name
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _name;
|
|
|
|
|
|
set => SetProperty(ref _name, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ObservableCollection<ReminderTask> Tasks
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _tasks;
|
|
|
|
|
|
set => SetProperty(ref _tasks, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
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>
2026-11-25 15:03:36 +01:00
|
|
|
|
public const string DefaultColor = "#6366F1";
|
|
|
|
|
|
public static readonly string[] Palette =
|
|
|
|
|
|
{ "#6366F1", "#3B82F6", "#14B8A6", "#22C55E", "#F59E0B", "#F97316", "#EF4444", "#EC4899", "#64748B" };
|
|
|
|
|
|
|
|
|
|
|
|
private string _color = DefaultColor;
|
|
|
|
|
|
public string Color
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _color;
|
|
|
|
|
|
set => SetProperty(ref _color, string.IsNullOrWhiteSpace(value) ? DefaultColor : value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-25 13:44:02 +01:00
|
|
|
|
public Folder() { }
|
|
|
|
|
|
|
|
|
|
|
|
public Folder(string name)
|
|
|
|
|
|
{
|
|
|
|
|
|
Name = name;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class AppData
|
|
|
|
|
|
{
|
|
|
|
|
|
public ObservableCollection<Folder> Folders { get; set; } = new();
|
2026-11-25 14:52:25 +01:00
|
|
|
|
/// <summary>"de"/"en"; empty = not chosen yet → Windows display language.</summary>
|
|
|
|
|
|
public string Language { get; set; } = "";
|
|
|
|
|
|
/// <summary>null = not chosen yet → Windows app theme.</summary>
|
|
|
|
|
|
public bool? IsDarkMode { get; set; }
|
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>
2026-11-25 15:03:36 +01:00
|
|
|
|
public bool PlaySound { get; set; } = true;
|
|
|
|
|
|
public bool HideDone { get; set; }
|
Professional redesign: native window, settings, calmer UI
- WindowChrome: resizable, snap layouts, native shadow, DWM rounded
corners; size/position remembered; fade-in after load (no theme flash)
- Menu bar replaced by a settings window (theme system/light/dark,
language, sound, autostart, categories, data, shortcuts, about)
- Shared styles in Themes/Controls.xaml; neutral palette with one accent
applied to Application.Resources (context menus/tooltips themed)
- Rows: To-Do style check left, title + details, relative date right,
actions on hover, visible selection (Enter edits, Del deletes)
- No glow/scale effects; subtle animations (dialogs, snackbar, chevrons)
- Checking a recurring task moves it to the next date (with undo)
- Themed combo box, date picker, check box; neutral dialog headers
- New flat app icon (tools/make_icon.py)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 18:10:45 +01:00
|
|
|
|
/// <summary>"system", "light", "dark" (empty = from IsDarkMode of older files).</summary>
|
|
|
|
|
|
public string ThemeMode { get; set; } = "";
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>Last window position/size (device-independent pixels).</summary>
|
|
|
|
|
|
public double? WindowLeft { get; set; }
|
|
|
|
|
|
public double? WindowTop { get; set; }
|
|
|
|
|
|
public double? WindowWidth { get; set; }
|
|
|
|
|
|
public double? WindowHeight { get; set; }
|
|
|
|
|
|
public bool WindowMaximized { get; set; }
|
|
|
|
|
|
|
Snooze notifications, morning summary, ICS import, data folder sync
- Windows toast notifications with snooze (10 min / 1 h / tomorrow) and
done buttons; balloon fallback; works when Windows starts the app
- Recurring entries snooze via SnoozedUntil without moving their date;
lead reminders keep the real date
- Morning summary once a day from a chosen hour (pure DailySummary)
- iCalendar import incl. Google birthday calendar, folded lines, UTC,
alarms, own export round trip, duplicates skipped by UID, undo
- Data folder selectable (location.json pointer), file watcher reloads
changes from another PC (own writes ignored)
- Themed date picker calendar, WPF tray menu, arrow/Home/End/Space keys
- 90 tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 20:37:20 +01:00
|
|
|
|
/// <summary>Morning summary: on/off, hour, last day it was shown.</summary>
|
|
|
|
|
|
public bool DailySummary { get; set; } = true;
|
|
|
|
|
|
public int SummaryHour { get; set; } = 8;
|
|
|
|
|
|
public DateTime? LastSummaryDate { get; set; }
|
|
|
|
|
|
|
2026-11-29 14:42:16 +01:00
|
|
|
|
/// <summary>"list", "compact" or "cards".</summary>
|
|
|
|
|
|
public string ViewMode { get; set; } = "list";
|
2026-11-29 15:06:19 +01:00
|
|
|
|
/// <summary>Group the list by month (collapsible).</summary>
|
|
|
|
|
|
public bool GroupByMonth { get; set; }
|
|
|
|
|
|
/// <summary>Anniversary categories (birthday, wedding, … and own ones). Filled with defaults on first start.</summary>
|
|
|
|
|
|
public ObservableCollection<Category> Categories { get; set; } = new();
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>Adds missing default categories (keeps user edits of existing ones).</summary>
|
|
|
|
|
|
public bool EnsureDefaultCategories(Func<string, string> L)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool changed = false;
|
|
|
|
|
|
int insertAt = 0;
|
|
|
|
|
|
foreach (var def in Category.Defaults(L))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Categories.Any(c => c.Id == def.Id)) { insertAt++; continue; }
|
|
|
|
|
|
Categories.Insert(Math.Min(insertAt++, Categories.Count), def);
|
|
|
|
|
|
changed = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return changed;
|
|
|
|
|
|
}
|
2026-11-29 14:42:16 +01:00
|
|
|
|
/// <summary>Folders and yearly tasks were checked for birthdays once.</summary>
|
|
|
|
|
|
public bool BirthdaysMigrated { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public static bool LooksLikeBirthdayFolder(string? name) =>
|
|
|
|
|
|
name != null && (name.Contains("geburtstag", StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
|
|
name.Contains("birthday", StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>Yearly tasks in a "Geburtstage"/"Birthdays" folder become birthday entries (one-time).</summary>
|
|
|
|
|
|
public int MigrateBirthdays()
|
|
|
|
|
|
{
|
2026-11-29 15:06:19 +01:00
|
|
|
|
int n = 0;
|
|
|
|
|
|
if (!BirthdaysMigrated)
|
|
|
|
|
|
{
|
|
|
|
|
|
BirthdaysMigrated = true;
|
|
|
|
|
|
n += MarkYearly(LooksLikeBirthdayFolder, Category.BirthdayId);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!WeddingsMigrated)
|
|
|
|
|
|
{
|
|
|
|
|
|
WeddingsMigrated = true;
|
|
|
|
|
|
n += MarkYearly(LooksLikeWeddingFolder, Category.WeddingId);
|
|
|
|
|
|
}
|
|
|
|
|
|
return n;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool WeddingsMigrated { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public static bool LooksLikeWeddingFolder(string? name) =>
|
|
|
|
|
|
name != null && (name.Contains("hochzeit", StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
|
|
name.Contains("wedding", StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
|
|
name.Contains("jahrestag", StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
|
|
name.Contains("anniversar", StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>Category a new anniversary in this folder should get (null = no hint).</summary>
|
|
|
|
|
|
public static string? CategoryHintForFolder(string? name) =>
|
|
|
|
|
|
LooksLikeBirthdayFolder(name) ? Category.BirthdayId : LooksLikeWeddingFolder(name) ? Category.WeddingId : null;
|
|
|
|
|
|
|
|
|
|
|
|
private int MarkYearly(Func<string?, bool> folderMatches, string categoryId)
|
|
|
|
|
|
{
|
2026-11-29 14:42:16 +01:00
|
|
|
|
int n = 0;
|
|
|
|
|
|
foreach (var f in Folders)
|
|
|
|
|
|
{
|
2026-11-29 15:06:19 +01:00
|
|
|
|
if (!folderMatches(f.Name)) continue;
|
2026-11-29 14:42:16 +01:00
|
|
|
|
foreach (var t in f.Tasks)
|
|
|
|
|
|
{
|
2026-11-29 15:06:19 +01:00
|
|
|
|
if (t.IsAnniversary || !t.IsRecurring || t.RecurrenceType != RecurrenceType.Yearly) continue;
|
|
|
|
|
|
t.IsAnniversary = true;
|
|
|
|
|
|
t.CategoryId = categoryId;
|
2026-11-29 14:42:16 +01:00
|
|
|
|
n++;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return n;
|
|
|
|
|
|
}
|
2026-11-25 13:44:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-11-29 14:42:16 +01:00
|
|
|
|
|