fix(swift-ios): remove done badges from thread rows

This commit is contained in:
Theo Browne committed 2026-08-14 17:48:27 -07:00
1 parent 7093830048
commit 4df9807141
3 files changed
+34 -7

No files matched your search

@@ -715,6 +715,15 @@ extension FeatureThread {
}
}
func homeRowStatusLabel(at now: Date) -> String {
switch homeStatus {
case .done, .ready:
SidebarRelativeAge.compact(since: updatedAt, now: now)
case .approval, .input, .working, .monitoring, .failed:
homeStatusLabel ?? SidebarRelativeAge.compact(since: updatedAt, now: now)
}
}
func homeWorkingDuration(at now: Date) -> String? {
guard homeStatus == .working, let workingStartedAt else { return nil }
return HomeWorkingDuration.compact(since: workingStartedAt, now: now)
@@ -955,14 +955,12 @@ struct FeatureThreadRow: View {
@ViewBuilder
private func status(at now: Date) -> some View {
let label = thread.homeStatusLabel
?? SidebarRelativeAge.compact(since: thread.updatedAt, now: now)
HStack(spacing: 5) {
if let icon = statusIcon {
Image(systemName: icon)
.font(.system(size: 11, weight: .semibold))
}
Text(label)
Text(thread.homeRowStatusLabel(at: now))
if let duration = thread.homeWorkingDuration(at: now) {
Text(duration)
.font(.system(.footnote, design: .monospaced, weight: .semibold))
@@ -976,9 +974,8 @@ struct FeatureThreadRow: View {
private var statusIcon: String? {
switch thread.homeStatus {
case .working: "circle.dotted"
case .done: "checkmark.circle"
case .failed: "exclamationmark.circle"
case .approval, .input, .monitoring, .ready: nil
case .approval, .input, .monitoring, .done, .ready: nil
}
}
@@ -989,8 +986,7 @@ struct FeatureThreadRow: View {
case .approval: T3Colors.warning
case .input: T3Colors.statusInput
case .failed: T3Colors.danger
case .done: T3Colors.success
case .ready: T3Colors.textTertiary
case .done, .ready: T3Colors.textTertiary
}
}
@@ -31,6 +31,28 @@ struct HomeThreadMetadataTests {
}
}
@Test
func completedAndIdleRowsUseQuietRelativeAges() {
let updatedAt = now.addingTimeInterval(-120)
let completed = FeatureThread(
id: "completed",
projectID: "project",
title: "Done task",
updatedAt: updatedAt,
state: .completed
)
let idle = FeatureThread(
id: "idle",
projectID: "project",
title: "Idle task",
updatedAt: updatedAt,
state: .idle
)
#expect(completed.homeRowStatusLabel(at: now) == "2m")
#expect(idle.homeRowStatusLabel(at: now) == "2m")
}
@Test
func workingDurationMatchesTheCompactWebFormatAndClampsFutureDates() {
let thread = FeatureThread(