iOS: show more events in the "Next 7 days" widget

The per-day cap of 3 made busy days collapse to "+N" so only ~6-7 events
showed total. Raise it (25) and let the total-row cap govern; extraLarge
fills up to 40 rows.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Scarriffle
2026-06-09 21:32:59 +02:00
parent 864eb31072
commit 69a32121df
2 changed files with 9 additions and 4 deletions

View File

@@ -3,15 +3,20 @@ import WidgetKit
private let rowHeight: CGFloat = 16
private let dayHeaderHeight: CGFloat = 14
private let maxEventsPerDay: Int = 3
private let maxTotalRows: Int = 22
// Show all events of a day (the total-row cap below governs how much fits);
// a low per-day cap previously made busy days collapse to "+N" far too early.
private let maxEventsPerDay: Int = 25
struct UpcomingWidgetView: View {
let entry: CalendarrEntry
@Environment(\.widgetFamily) private var family
private var snapshot: WidgetSnapshot? { entry.snapshot }
private var lang: String { snapshot?.language ?? "system" }
// Fill the available height: extraLarge (iPad) fits far more rows.
private var maxTotalRows: Int { family == .systemExtraLarge ? 40 : 22 }
private var groupedWithLimits: [(Date, [WidgetEvent], Int)] {
guard let s = snapshot else { return [] }
let cal = Calendar.current