Description
Create GitHubIntegrationFeature/Views/GitHubPreferencesView.swift:
public struct GitHubPreferencesView: View {
public let store: StoreOf<GitHubFeature>
public init(store: StoreOf<GitHubFeature>)
}
States (by auth)
- Not signed in (
.signedOut):
- Title
"Connect to GitHub", description "Sign in to show CI status for your branches"
- Button
"Sign in with GitHub" → .signInTapped
- Scope disclaimer (smaller muted text):
"Relay will request the repo scope, which grants read and write access to all your repositories. Only read functionality is currently used. We plan to migrate to GitHub Apps with narrower permissions in a future update."
- Signing in (
.signingIn): ProgressView() + "Authorizing…".
- Signed in (
.signedIn(info)):
"Signed in as @\(login)"
- Rate limit:
"API: \(remaining) / \(limit) requests remaining, resets in \(resetIn)"
- Buttons:
"Sign out" (.signOutTapped), "Refresh now" (.refreshNowTapped(nil)), "Copy diagnostic info"
- Error (
.error(err)): use preferencesErrorState(for: err) from T-14 — card with title/message/action.
Diagnostic copy
On click, pasteboard receives:
Relay GitHub Integration diagnostic
Date: <ISO8601>
Signed in as: @<login>
Scopes: <repo, ...>
Rate limit: <remaining>/<limit>, resets at <resetAt ISO8601>
Last fetch: <lastFetchedAt> (Xs ago) | null
Last error: <err.humanDescription> | none
Client version: Relay/<bundleVersion>
Never include token, code, state, code_verifier.
Integration
Add "GitHub" section (icon cloud.fill) to existing Settings/Preferences window.
Spec reference
See swarm-report/github-integration-decomposition.md#t-11. Diagnostic copy — sanctioned addition (BA support-load risk).
Relationships
Acceptance criteria
Complexity
M
Suggested agent
developer-workflow:swiftui-developer
Module / Layer
GitHubIntegrationFeature / UI (Views)
Description
Create
GitHubIntegrationFeature/Views/GitHubPreferencesView.swift:States (by
auth).signedOut):"Connect to GitHub", description"Sign in to show CI status for your branches""Sign in with GitHub"→.signInTapped"Relay will request the repo scope, which grants read and write access to all your repositories. Only read functionality is currently used. We plan to migrate to GitHub Apps with narrower permissions in a future update.".signingIn):ProgressView()+"Authorizing…"..signedIn(info)):"Signed in as @\(login)""API: \(remaining) / \(limit) requests remaining, resets in \(resetIn)""Sign out"(.signOutTapped),"Refresh now"(.refreshNowTapped(nil)),"Copy diagnostic info".error(err)): usepreferencesErrorState(for: err)from T-14 — card with title/message/action.Diagnostic copy
On click, pasteboard receives:
Never include
token,code,state,code_verifier.Integration
Add "GitHub" section (icon
cloud.fill) to existing Settings/Preferences window.Spec reference
See
swarm-report/github-integration-decomposition.md#t-11. Diagnostic copy — sanctioned addition (BA support-load risk).Relationships
Acceptance criteria
"Authorizing…"@username+ rate limit + 3 buttons.signInTapped, Sign out.signOutTapped, Refresh.refreshNowTapped(nil)token,code,verifier,state(unit-tested by grepping pasteboard)@Previewfor 4 auth statesComplexity
M
Suggested agent
developer-workflow:swiftui-developerModule / Layer
GitHubIntegrationFeature/ UI (Views)