diff options
| author | Christian Cleberg <[email protected]> | 2026-03-18 22:56:34 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-03-18 22:56:34 -0500 |
| commit | ffc0ef0988b5e7d01951c23af85a1cf026b3da9f (patch) | |
| tree | 868cef24e91ddaa5e7d5e39362d97ec6a94107c9 /Hutch/Views/Repositories/RepositoryRowView.swift | |
| parent | ed48e72520c51e4635cd3840dbc569bdd74c950f (diff) | |
| download | hutch-ffc0ef0988b5e7d01951c23af85a1cf026b3da9f.tar.gz hutch-ffc0ef0988b5e7d01951c23af85a1cf026b3da9f.tar.bz2 hutch-ffc0ef0988b5e7d01951c23af85a1cf026b3da9f.zip | |
add Home dashboard and repository build status indicators
Diffstat (limited to 'Hutch/Views/Repositories/RepositoryRowView.swift')
| -rw-r--r-- | Hutch/Views/Repositories/RepositoryRowView.swift | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Hutch/Views/Repositories/RepositoryRowView.swift b/Hutch/Views/Repositories/RepositoryRowView.swift index 9f8cd15..f8fd205 100644 --- a/Hutch/Views/Repositories/RepositoryRowView.swift +++ b/Hutch/Views/Repositories/RepositoryRowView.swift @@ -2,6 +2,7 @@ import SwiftUI struct RepositoryRowView: View { let repository: RepositorySummary + let buildStatus: RepositoryBuildStatus var body: some View { VStack(alignment: .leading, spacing: 4) { @@ -20,6 +21,9 @@ struct RepositoryRowView: View { .foregroundStyle(.cyan) } + if buildStatus != .none { + RepositoryBuildStatusIndicator(status: buildStatus) + } VisibilityBadge(visibility: repository.visibility) } @@ -53,6 +57,47 @@ struct RepositoryRowView: View { } } +private struct RepositoryBuildStatusIndicator: View { + let status: RepositoryBuildStatus + + var body: some View { + Circle() + .fill(color) + .frame(width: 8, height: 8) + .overlay { + Circle() + .strokeBorder(.primary.opacity(0.08)) + } + .accessibilityLabel(accessibilityLabel) + } + + private var color: Color { + switch status { + case .success: + .green + case .failed: + .red + case .running: + .orange + case .none: + .clear + } + } + + private var accessibilityLabel: String { + switch status { + case .success: + "Latest build succeeded" + case .failed: + "Latest build failed" + case .running: + "Latest build is running" + case .none: + "No recent builds" + } + } +} + // MARK: - VisibilityBadge struct VisibilityBadge: View { |
