From 3918b77c6cf9f77ccf41ec1b75c512d56ce98688 Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Fri, 14 Aug 2026 20:09:16 -0700 Subject: [PATCH] fix(swift-ios): remove done status from thread headers --- .../Features/Chat/ThreadDetailView.swift | 47 +++++++++---------- .../Features/Workspace/DailyUXModels.swift | 22 +++++++++ .../HomeThreadMetadataTests.swift | 21 +++++++++ 3 files changed, 66 insertions(+), 24 deletions(-) diff --git a/apps/swift-ios/Features/Chat/ThreadDetailView.swift b/apps/swift-ios/Features/Chat/ThreadDetailView.swift index 8e9931b784..a8d59d8b47 100644 --- a/apps/swift-ios/Features/Chat/ThreadDetailView.swift +++ b/apps/swift-ios/Features/Chat/ThreadDetailView.swift @@ -192,23 +192,31 @@ public struct ThreadDetailView: View { @ViewBuilder private func headerStatus(at now: Date) -> some View { - HStack(spacing: 5) { - if let icon = headerStatusIcon { - Image(systemName: icon) - } - if let duration = currentThread.homeWorkingDuration(at: now) { - Text(duration) - .monospaced() - .monospacedDigit() - } else { - Text(currentThread.homeStatusLabel ?? "Ready") + let duration = currentThread.homeWorkingDuration(at: now) + if let label = duration ?? currentThread.detailHeaderStatusLabel { + HStack(spacing: 5) { + if let icon = currentThread.detailHeaderStatusIcon { + Image(systemName: icon) + } + headerStatusText(label, isDuration: duration != nil) } + .font(T3Typography.status) + .foregroundStyle(headerStatusColor) + .lineLimit(1) + .accessibilityElement(children: .combine) + .accessibilityLabel(currentThread.homeStatusAccessibilityLabel(at: now)) + } + } + + @ViewBuilder + private func headerStatusText(_ label: String, isDuration: Bool) -> some View { + if isDuration { + Text(label) + .monospaced() + .monospacedDigit() + } else { + Text(label) } - .font(T3Typography.status) - .foregroundStyle(headerStatusColor) - .lineLimit(1) - .accessibilityElement(children: .combine) - .accessibilityLabel(currentThread.homeStatusAccessibilityLabel(at: now)) } private var threadActionsMenu: some View { @@ -283,15 +291,6 @@ public struct ThreadDetailView: View { return "workspace" } - private var headerStatusIcon: String? { - switch currentThread.homeStatus { - case .working: "circle.dotted" - case .done: "checkmark.circle" - case .failed: "exclamationmark.circle" - case .approval, .input, .monitoring, .ready: nil - } - } - private var headerStatusColor: Color { switch currentThread.homeStatus { case .working: T3Colors.statusRunning diff --git a/apps/swift-ios/Features/Workspace/DailyUXModels.swift b/apps/swift-ios/Features/Workspace/DailyUXModels.swift index 5d603c5489..d90475738b 100644 --- a/apps/swift-ios/Features/Workspace/DailyUXModels.swift +++ b/apps/swift-ios/Features/Workspace/DailyUXModels.swift @@ -715,6 +715,28 @@ extension FeatureThread { } } + var detailHeaderStatusLabel: String? { + switch homeStatus { + case .done: + nil + case .ready: + "Ready" + case .approval, .input, .working, .monitoring, .failed: + homeStatusLabel + } + } + + var detailHeaderStatusIcon: String? { + switch homeStatus { + case .working: + "circle.dotted" + case .failed: + "exclamationmark.circle" + case .done, .approval, .input, .monitoring, .ready: + nil + } + } + func homeRowStatusLabel(at now: Date) -> String { switch homeStatus { case .done, .ready: diff --git a/apps/swift-ios/Tests/FeatureTests/HomeThreadMetadataTests.swift b/apps/swift-ios/Tests/FeatureTests/HomeThreadMetadataTests.swift index b598824b9a..6e84dbe911 100644 --- a/apps/swift-ios/Tests/FeatureTests/HomeThreadMetadataTests.swift +++ b/apps/swift-ios/Tests/FeatureTests/HomeThreadMetadataTests.swift @@ -53,6 +53,27 @@ struct HomeThreadMetadataTests { #expect(idle.homeRowStatusLabel(at: now) == "2m") } + @Test + func completedDetailHeadersDoNotShowAStatusBadge() { + let completed = FeatureThread( + id: "completed", + projectID: "project", + title: "Completed task", + state: .completed + ) + let working = FeatureThread( + id: "working", + projectID: "project", + title: "Working task", + state: .working + ) + + #expect(completed.detailHeaderStatusLabel == nil) + #expect(completed.detailHeaderStatusIcon == nil) + #expect(working.detailHeaderStatusLabel == "Working") + #expect(working.detailHeaderStatusIcon == "circle.dotted") + } + @Test func workingDurationMatchesTheCompactWebFormatAndClampsFutureDates() { let thread = FeatureThread(