Guido Schmit 9dd41420b6 fix: safe performance and crash-safety fixes
- TimeGridView: remember Instant.now() (keyed on the day) and the day-header
  DateTimeFormatter instead of rebuilding both on every recomposition/frame —
  fixes flicker in the past-event dimming and avoids repeated allocation.
- CalendarViewModel.refreshFromCache: short-circuit the non-group filter pass
  when both hiddenKeys and banishedKeys are empty, mirroring the existing
  group-mode short-circuit.
- CalendarViewModel.setCalendarHiddenSynced: wrap the server PATCH in
  runCatching and surface failures via state.error instead of silently
  dropping them (the local toggle would otherwise diverge from the server
  unnoticed).
- CalendarViewModel.afterMutation: refetch only the already-cached range
  (force-bypassing loadRange's cache check) instead of invalidateCache() +
  initialLoad(), which reloaded the entire ±cacheMonths window and froze the
  UI on every single event save.
- CalendarrRoot: replace calendarVm!! with a null-safe ?.let, falling back to
  the splash screen instead of crashing if the VM isn't ready yet.
- GroupsScreen: replace existing!!.icon!! / g.icon!! double force-unwraps
  with safe-call chains (existing?.icon?.takeIf { GroupIcons.isKey(it) }).

Deliberately out of scope: R8/minify settings, MonthView's cache window
size (MONTHS_BACK/MONTHS_AHEAD), and mergeIntoCache's merge logic (already
reviewed as correct). No debounce added to setCalendarHiddenSynced — would
need new machinery beyond this fix's scope.
2026-07-02 18:30:21 +02:00
Description
No description provided
GPL-3.0 1.2 MiB
Languages
Kotlin 100%