Skip to content

Add repository onboarding to macOS - #424

Merged
SergeSerb2 merged 1 commit into
mainfrom
surgecode/project-onboarding
Jul 31, 2026
Merged

Add repository onboarding to macOS#424
SergeSerb2 merged 1 commit into
mainfrom
surgecode/project-onboarding

Conversation

@SergeSerb2

Copy link
Copy Markdown
Owner

Summary

  • Expand New Session’s Add Project path with import, clone, create, and publish onboarding.
  • Accept direct Git URLs or GitHub, GitLab, Bitbucket, and Azure DevOps repository names.
  • Let users select SSH or HTTPS, clone into an explicit destination, initialize Git repositories, and create public or private remotes for local folders.
  • Add native T3Kit wrappers for the existing source-control and vcs.init RPCs, centralize operation sequencing in AppModel, and cover the workflow with mock-backed tests.

This brings the macOS client up to the repository onboarding capabilities already exposed by the server RPC surface.

Area

  • apps/mac — native macOS app
  • apps/windows — Windows desktop app
  • apps/mobile — iPhone companion app
  • apps/server — backend server
  • Shared packages (packages/contracts, packages/shared, packages/client-runtime, …) or relay (infra/relay)
  • Build, CI, or release tooling
  • Docs

Release size

  • size:XS — tiny internal, documentation, or narrowly scoped fix
  • size:S — small user-visible fix or contained improvement
  • size:M — normal feature or meaningful behavior change
  • size:L — broad feature or substantial cross-package change
  • size:XL — release-system, architecture, or ecosystem-scale change

Verification

  • pnpm run verify --all passes (check + typecheck + tests; adds lint:mobile and the Swift suite)

  • pnpm run test:mac passes (required for apps/mac changes)

  • Manually verified (describe below)

  • pnpm run verify passed, including 836 SurgeCodeMac tests plus T3Kit and SidecarKit suites.

  • pnpm run test:mac --filter ProjectOnboardingTests passed (2 tests).

  • pnpm run verify --all passed formatting and typechecking, then had one load-sensitive timeout in the unrelated server AcpJsonRpcConnection.test.ts suite; the exact file passed all 16 tests immediately in isolation with vp test run src/provider/acp/AcpJsonRpcConnection.test.ts.

Screenshots / Recordings

Not captured: GUI computer-control/screenshot tooling was unavailable in this worktree. The Add Project surface is covered by the native build and model tests above.

Release notes

Add project onboarding can now import folders, clone provider repositories or Git URLs, initialize new Git repositories, and publish local folders.

@SergeSerb2 SergeSerb2 added the size:M Normal feature or meaningful behavior change label Jul 31, 2026 — with ChatGPT Codex Connector

@SergeSerb2 SergeSerb2 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comprehensive repository onboarding feature adds four flows: import folder, clone repository, initialize repository, and publish folder. Well-structured implementation with consistent patterns across UI, model, backend protocol, and implementations. Type-safe request enums, proper async/error handling, and defensive validations. Test coverage is basic but covers the happy path.

Strengths:

  • Clean separation of concerns (request types → model orchestration → backend protocol → implementations)
  • All backend conformers updated (Live, Mock, default protocol)
  • UI properly gates options by mode (e.g., hides git-URL when publishing)
  • Defensive nil-safety checks and state reset on mode changes
  • RPC contract types are properly Sendable/Codable

Minor observations:

  • Protocol params for clone (provider, repository, remoteURL) all optional with no type-level validation—UI ensures valid combos, backend can validate; acceptable
  • Tests only cover happy path (request properties, registration); no error cases or RPC mocking
  • Onboarding error silently returns nil; relies on model.report(error) to surface it to user (consistent with SurgeCode patterns but could be more explicit)

SurgeCode auto-review · model=codex/gpt-5.6-luna · head=76be4829af35

@@ -476,7 +612,45 @@ struct NewSessionSheet: View {
}

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

info: When onboardProject returns nil (after calling model.report(error)), the UI silently does nothing. This is consistent with the model-driven error-reporting pattern, but consider making it explicit: store the onboarding error in a @State and display it, or ensure the model's lastError is visibly wired to the sheet. Current behavior relies on error being shown via the model's external error state.

public func cloneRepository(
provider: SourceControlProviderKind? = nil,
repository: String? = nil,
remoteURL: String? = nil,

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Parameters provider, repository, and remoteURL are all optional, with no type-level constraint that at least one must be present (e.g., provider+repository or remoteURL alone). The UI builds valid combos and the backend can validate, but consider a docstring clarifying the contract: "either provider+repository or remoteURL must be non-nil."

#expect(model.projects.contains { $0.path == request.projectPath })
}
}
}

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Test coverage is limited to happy-path registration and enum properties. Consider adding tests for: error cases in onboardProject (backend failure, path already registered), deduplication when a path is already a known project, and the model state after onboarding (projects array updated, project returned matches expectations).

@SergeSerb2
SergeSerb2 marked this pull request as ready for review July 31, 2026 15:25
@SergeSerb2
SergeSerb2 merged commit cfabe91 into main Jul 31, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M Normal feature or meaningful behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant