Description
Create MacApp/Packages/GitHubIntegration/Sources/GitHubIntegrationFeature/ErrorPresentation.swift — design artifact + code contract.
(1) Docstring — mandatory mapping table
error × surface → UX response:
| Error |
Badge |
Popover |
Preferences |
.unauthorized |
grey triangle ⚠ |
banner «Session expired — sign in again» + Sign-in button |
red card «Your token was revoked — please Sign in again» |
.forbidden(.saml) |
grey triangle |
banner «SSO authorization required» + deep link to https://github.com/orgs/<org>/sso?authorization_request=... |
red card with SSO deep link |
.forbidden(.scope) |
grey triangle |
banner «Insufficient permissions — re-authorize with updated scope» + Sign-in |
red card «Scope mismatch» + Sign-in |
.forbidden(.rateLimit) / .rateLimited(resetAt:) |
.stale overlay + tooltip «Rate limited — retries at Xm:Ys» |
banner «GitHub rate limit reached — retrying in …» |
rate limit remaining = 0 with countdown |
.notFound |
hidden |
banner «Repository or branch not found» |
N/A |
.networkError |
.stale |
banner «Network error — check connection» + Retry |
red card |
.serverError / .decodingFailed |
grey triangle |
banner «GitHub returned an unexpected response — retry later» + Retry |
red card with error code |
.forbidden(.other) |
grey triangle |
generic banner |
generic red card |
(2) Public helpers (single source of truth)
public struct BadgeVisual {
public let symbol: String
public let color: Color
public let pulse: Bool
}
public func badgeIcon(for status: CIStatusView) -> BadgeVisual
public struct ErrorBannerConfig {
public enum Action { case signIn, retry, ssoLink(URL), none }
public let title: String
public let message: String
public let action: Action
}
public func bannerConfig(for error: GitHubAPIError) -> ErrorBannerConfig
public struct ErrorCardConfig {
public let title: String
public let message: String
public let primaryAction: ErrorBannerConfig.Action
}
public func preferencesErrorState(for error: GitHubAuthError) -> ErrorCardConfig
T-9, T-10, T-11 consume these helpers exclusively.
(3) Unit tests
At least one test per error row — asserts helpers return the documented config.
Spec reference
See swarm-report/github-integration-decomposition.md#t-14 (BA review M-1 addition).
Relationships
Acceptance criteria
Complexity
S
Suggested agent
developer-workflow:swift-engineer
Module / Layer
GitHubIntegrationFeature / UX contract
Description
Create
MacApp/Packages/GitHubIntegration/Sources/GitHubIntegrationFeature/ErrorPresentation.swift— design artifact + code contract.(1) Docstring — mandatory mapping table
error × surface → UX response:.unauthorized.forbidden(.saml)https://github.com/orgs/<org>/sso?authorization_request=....forbidden(.scope).forbidden(.rateLimit)/.rateLimited(resetAt:).staleoverlay + tooltip «Rate limited — retries at Xm:Ys».notFound.networkError.stale.serverError/.decodingFailed.forbidden(.other)(2) Public helpers (single source of truth)
T-9, T-10, T-11 consume these helpers exclusively.
(3) Unit tests
At least one test per error row — asserts helpers return the documented config.
Spec reference
See
swarm-report/github-integration-decomposition.md#t-14(BA review M-1 addition).Relationships
Acceptance criteria
ErrorPresentation.swiftexists; docstring contains the full mapping table verbatimComplexity
S
Suggested agent
developer-workflow:swift-engineerModule / Layer
GitHubIntegrationFeature/ UX contract