From 4df9807141ef780d783122963d05b9cc3931e031 Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Fri, 14 Aug 2026 17:48:27 -0700 Subject: [PATCH] fix(swift-ios): remove done badges from thread rows --- .../Features/Workspace/DailyUXModels.swift | 9 ++++++++ .../Features/Workspace/WorkspaceView.swift | 10 +++------ .../HomeThreadMetadataTests.swift | 22 +++++++++++++++++++ 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/apps/swift-ios/Features/Workspace/DailyUXModels.swift b/apps/swift-ios/Features/Workspace/DailyUXModels.swift index 46783dd978..5d603c5489 100644 --- a/apps/swift-ios/Features/Workspace/DailyUXModels.swift +++ b/apps/swift-ios/Features/Workspace/DailyUXModels.swift @@ -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) diff --git a/apps/swift-ios/Features/Workspace/WorkspaceView.swift b/apps/swift-ios/Features/Workspace/WorkspaceView.swift index df2d1f80e7..7a8f33b28c 100644 --- a/apps/swift-ios/Features/Workspace/WorkspaceView.swift +++ b/apps/swift-ios/Features/Workspace/WorkspaceView.swift @@ -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 } } diff --git a/apps/swift-ios/Tests/FeatureTests/HomeThreadMetadataTests.swift b/apps/swift-ios/Tests/FeatureTests/HomeThreadMetadataTests.swift index b385e0df8d..b598824b9a 100644 --- a/apps/swift-ios/Tests/FeatureTests/HomeThreadMetadataTests.swift +++ b/apps/swift-ios/Tests/FeatureTests/HomeThreadMetadataTests.swift @@ -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(