Commit b3ba6ca101

b3ba6ca1015c269a80fab7c3d74d221e22f67622

parent: 0db705cded

Verified · cmc

cmc <hello@cleberg.net> · 2026-10-16 17:10 UTC

Reminder titles without TODO keyword and priority

The notification title is the heading's title; the leader in the body
drops its colon ("9:00 · Scheduled · todo").

Layout: unified · split

Sources/OrgCore/Agenda/Reminders.swift +5 −4
@@ -43,11 +43,12 @@ public enum Reminders {
4343 event > now else { continue }
4444 let fire = max(event.addingTimeInterval(-Double((item.warntime ?? lead) * 60)), now.addingTimeInterval(1))
4545 let clockText = String(format: "%d:%02d", time / 100, time % 100)
46 let title = item.text.trimmingCharacters(in: .whitespaces)
47 let leader = item.extra.trimmingCharacters(in: .whitespaces)
46 // `Scheduled:` reads `Scheduled` beside the time.
47 var leader = item.extra.trimmingCharacters(in: .whitespaces)
48 if leader.hasSuffix(":") { leader.removeLast() }
4849 reminders.append(Reminder(
49 id: "orgstar.\(path)|\(item.headingLine ?? title)|\(day.day)|\(time)|\(item.kind.rawValue)",
50 fireDate: fire, eventDate: event, title: title,
50 id: "orgstar.\(path)|\(item.headingLine ?? item.text.trimmingCharacters(in: .whitespaces))|\(day.day)|\(time)|\(item.kind.rawValue)",
51 fireDate: fire, eventDate: event, title: item.title,
5152 body: ([clockText] + (leader.isEmpty ? [] : [leader]) + [item.category]).joined(separator: " · "),
5253 path: path, offset: item.markerOffset ?? item.headingOffset ?? 0
5354 ))
Tests/OrgCoreTests/AgendaTests.swift +4 −4
@@ -411,7 +411,7 @@ struct ReminderTests {
411411
412412 @Test func timedEntriesWithTheirWarnings() {
413413 let text = """
414 * TODO Call
414 * TODO [#A] Call [1/2]
415415 SCHEDULED: <2026-10-05 Mon 14:00>
416416 * Meeting
417417 :PROPERTIES:
@@ -432,14 +432,14 @@ struct ReminderTests {
432432 let source = AgendaSource(path: "/n/a.org", text: text)
433433 let now = Self.date(5, 9, 30)
434434 let reminders = Reminders.upcoming([source], now: now, calendar: Self.utc)
435 #expect(reminders.map(\.title) == ["Soon", "TODO Call", "Meeting", "TODO Report due"])
435 #expect(reminders.map(\.title) == ["Soon", "Call", "Meeting", "Report due"])
436436 #expect(reminders[0].fireDate == now.addingTimeInterval(1))
437437 #expect(reminders[1].fireDate == Self.date(5, 13, 48))
438 #expect(reminders[1].body == "14:00 · Scheduled: · a")
438 #expect(reminders[1].body == "14:00 · Scheduled · a")
439439 #expect(reminders[2].fireDate == Self.date(6, 9, 30))
440440 #expect(reminders[3].eventDate == Self.date(7, 17, 0))
441441 #expect(Reminders.upcoming([source], now: now, calendar: Self.utc, limit: 2).count == 2)
442 #expect(Reminders.upcoming([source], now: now, calendar: Self.utc, days: 1).map(\.title) == ["Soon", "TODO Call"])
442 #expect(Reminders.upcoming([source], now: now, calendar: Self.utc, days: 1).map(\.title) == ["Soon", "Call"])
443443 }
444444
445445 @Test func repeatsFillTheWeek() {