krz/orgstar

A native macOS editor for org-mode files. editor org-mode swift

Commit f39ba0744e

f39ba0744efe77f5e1e0212d58eba0070114a615

parent: 640a8729ac

Verified · cmc

cmc <hello@cleberg.net> · 2026-10-09 05:35 UTC

Agenda: shorter past-scheduled gutter

Past-scheduled rows show "5w ago" instead of "Sched. 5w ago"; the scheduled icon and "ago" (against "late" for deadlines) carry the kind. The iOS gutter keeps its text on one line, scaling down to 0.8 for long ages.

Layout: unified · split

Sources/OrgPresentation/AgendaRows.swift +2 −2
@@ -42,7 +42,7 @@ public struct AgendaEvent: Sendable, Equatable, Identifiable {
42/// 42///
43/// The gutter holds the time (`08:00`, `13:50–14:30`) or, untimed, a short status: 43/// The gutter holds the time (`08:00`, `13:50–14:30`) or, untimed, a short status:
44/// deadlines `Due today`, `Due in 2d`, `3d late`, `Due` (on a day other than today); 44/// deadlines `Due today`, `Due in 2d`, `3d late`, `Due` (on a day other than today);
45/// scheduled `Scheduled`, `Sched. 4d ago`; habits `Habit`; timestamps, diary sexps and 45/// scheduled `Scheduled`, `4d ago`; habits `Habit`; timestamps, diary sexps and
46/// calendar events `All day`; ranges `Day 2/5`; log mode `Closed`, `Clocked`, `State`; TODO 46/// calendar events `All day`; ranges `Day 2/5`; log mode `Closed`, `Clocked`, `State`; TODO
47/// and match lists nothing. Ages use `AgendaAge.compact`. 47/// and match lists nothing. Ages use `AgendaAge.compact`.
48public struct AgendaRow: Sendable, Equatable, Identifiable { 48public struct AgendaRow: Sendable, Equatable, Identifiable {
@@ -115,7 +115,7 @@ public struct AgendaRow: Sendable, Equatable, Identifiable {
115 } else { 115 } else {
116 icon = .scheduled 116 icon = .scheduled
117 let on = planning ?? day 117 let on = planning ?? day
118 untimed = on < day ? "Sched. \(AgendaAge.compact(day - on)) ago" : "Scheduled" 118 untimed = on < day ? "\(AgendaAge.compact(day - on)) ago" : "Scheduled"
119 } 119 }
120 status = late ? .overdue : .normal 120 status = late ? .overdue : .normal
121 case .timestamp, .sexp: 121 case .timestamp, .sexp:
Sources/OrgstarMobile/AgendaScreen.swift +2 −3
@@ -645,10 +645,9 @@ struct AgendaRowView: View {
645 Text(row.gutter) 645 Text(row.gutter)
646 .font(.caption.weight(.medium).monospacedDigit()) 646 .font(.caption.weight(.medium).monospacedDigit())
647 .foregroundStyle(statusColor) 647 .foregroundStyle(statusColor)
648 .lineLimit(2) 648 .lineLimit(1)
649 .allowsTightening(true) 649 .allowsTightening(true)
650 .minimumScaleFactor(0.85) 650 .minimumScaleFactor(0.8)
651 .fixedSize(horizontal: false, vertical: true)
652 } 651 }
653 } 652 }
654 } 653 }
Tests/OrgPresentationTests/AgendaRowsTests.swift +2 −2
@@ -68,8 +68,8 @@ struct AgendaRowsTests {
68 #expect(row?.status == status, "\(title)", sourceLocation: sourceLocation) 68 #expect(row?.status == status, "\(title)", sourceLocation: sourceLocation)
69 #expect(row?.icon == icon, "\(title)", sourceLocation: sourceLocation) 69 #expect(row?.icon == icon, "\(title)", sourceLocation: sourceLocation)
70 } 70 }
71 check("Pay rent", "Sched. 4d ago", .overdue, .scheduled) 71 check("Pay rent", "4d ago", .overdue, .scheduled)
72 check("Ancient chore", "Sched. 1y 4mo ago", .overdue, .scheduled) 72 check("Ancient chore", "1y 4mo ago", .overdue, .scheduled)
73 check("Send forms", "3d late", .overdue, .deadline) 73 check("Send forms", "3d late", .overdue, .deadline)
74 check("File taxes", "Due today", .dueSoon, .deadline) 74 check("File taxes", "Due today", .dueSoon, .deadline)
75 check("Renew passport", "Due in 4d", .dueSoon, .deadline) 75 check("Renew passport", "Due in 4d", .dueSoon, .deadline)
docs/plans/2026-10-08-agenda-redesign.md +1 −1
@@ -32,7 +32,7 @@ Timed rows show `08:00` or `13:50–14:30` (zero-padded, en dash; past midnight
32| Deadline, on today, upcoming | `Due in 2d` | due-soon | 32| Deadline, on today, upcoming | `Due in 2d` | due-soon |
33| Deadline, on another day | `Due` | overdue if before today, else normal | 33| Deadline, on another day | `Due` | overdue if before today, else normal |
34| Scheduled | `Scheduled` | overdue if before today, else normal | 34| Scheduled | `Scheduled` | overdue if before today, else normal |
35| Scheduled, carried to today | `Sched. 4d ago` | overdue | 35| Scheduled, carried to today | `4d ago` | overdue |
36| Habit | `Habit` | overdue if scheduled before today | 36| Habit | `Habit` | overdue if scheduled before today |
37| Timestamp, diary sexp | `All day` | normal | 37| Timestamp, diary sexp | `All day` | normal |
38| Range, middle days | `Day 2/5` | normal | 38| Range, middle days | `Day 2/5` | normal |