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 {
43 event > now else { continue } 43 event > now else { continue }
44 let fire = max(event.addingTimeInterval(-Double((item.warntime ?? lead) * 60)), now.addingTimeInterval(1)) 44 let fire = max(event.addingTimeInterval(-Double((item.warntime ?? lead) * 60)), now.addingTimeInterval(1))
45 let clockText = String(format: "%d:%02d", time / 100, time % 100) 45 let clockText = String(format: "%d:%02d", time / 100, time % 100)
46 let title = item.text.trimmingCharacters(in: .whitespaces) 46 // `Scheduled:` reads `Scheduled` beside the time.
47 let leader = item.extra.trimmingCharacters(in: .whitespaces) 47 var leader = item.extra.trimmingCharacters(in: .whitespaces)
48 if leader.hasSuffix(":") { leader.removeLast() }
48 reminders.append(Reminder( 49 reminders.append(Reminder(
49 id: "orgstar.\(path)|\(item.headingLine ?? title)|\(day.day)|\(time)|\(item.kind.rawValue)", 50 id: "orgstar.\(path)|\(item.headingLine ?? item.text.trimmingCharacters(in: .whitespaces))|\(day.day)|\(time)|\(item.kind.rawValue)",
50 fireDate: fire, eventDate: event, title: title, 51 fireDate: fire, eventDate: event, title: item.title,
51 body: ([clockText] + (leader.isEmpty ? [] : [leader]) + [item.category]).joined(separator: " · "), 52 body: ([clockText] + (leader.isEmpty ? [] : [leader]) + [item.category]).joined(separator: " · "),
52 path: path, offset: item.markerOffset ?? item.headingOffset ?? 0 53 path: path, offset: item.markerOffset ?? item.headingOffset ?? 0
53 )) 54 ))
Tests/OrgCoreTests/AgendaTests.swift +4 −4
@@ -411,7 +411,7 @@ struct ReminderTests {
411 411
412 @Test func timedEntriesWithTheirWarnings() { 412 @Test func timedEntriesWithTheirWarnings() {
413 let text = """ 413 let text = """
414 * TODO Call 414 * TODO [#A] Call [1/2]
415 SCHEDULED: <2026-10-05 Mon 14:00> 415 SCHEDULED: <2026-10-05 Mon 14:00>
416 * Meeting 416 * Meeting
417 :PROPERTIES: 417 :PROPERTIES:
@@ -432,14 +432,14 @@ struct ReminderTests {
432 let source = AgendaSource(path: "/n/a.org", text: text) 432 let source = AgendaSource(path: "/n/a.org", text: text)
433 let now = Self.date(5, 9, 30) 433 let now = Self.date(5, 9, 30)
434 let reminders = Reminders.upcoming([source], now: now, calendar: Self.utc) 434 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"])
436 #expect(reminders[0].fireDate == now.addingTimeInterval(1)) 436 #expect(reminders[0].fireDate == now.addingTimeInterval(1))
437 #expect(reminders[1].fireDate == Self.date(5, 13, 48)) 437 #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")
439 #expect(reminders[2].fireDate == Self.date(6, 9, 30)) 439 #expect(reminders[2].fireDate == Self.date(6, 9, 30))
440 #expect(reminders[3].eventDate == Self.date(7, 17, 0)) 440 #expect(reminders[3].eventDate == Self.date(7, 17, 0))
441 #expect(Reminders.upcoming([source], now: now, calendar: Self.utc, limit: 2).count == 2) 441 #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"])
443 } 443 }
444 444
445 @Test func repeatsFillTheWeek() { 445 @Test func repeatsFillTheWeek() {