Skip to content

Welcome: Clone Repository quick action#166

Merged
kirich1409 merged 1 commit intomainfrom
feature/clone-repo-welcome
Apr 17, 2026
Merged

Welcome: Clone Repository quick action#166
kirich1409 merged 1 commit intomainfrom
feature/clone-repo-welcome

Conversation

@kirich1409
Copy link
Copy Markdown
Contributor

Summary

  • Adds a third "Clone Repository" Quick Action to the Welcome screen.
  • Opens a sheet with URL field + destination folder picker (NSOpenPanel) + Clone/Cancel buttons. Shows a ProgressView while cloning and an Alert on failure.
  • Implements GitCloneClient dependency wrapping Process on /usr/bin/git. Task cancellation terminates the subprocess via withTaskCancellationHandler so TCA's .cancel(id:) aborts the clone.
  • On success, the cloned folder is added via the existing projectRepository and opened via delegate(.projectSelected(URL)) — no new routing plumbing.
  • Auth scope: user's existing git credentials (SSH keys / credential helper). No explicit credential management.

Files

  • MacApp/Relay/Welcome/GitCloneClient.swift (new) — dependency + live Process-based clone runner.
  • MacApp/Relay/Welcome/CloneRepositorySheet.swift (new) — sheet content view.
  • MacApp/Relay/Welcome/WelcomeFeature.swift — adds CloneState sub-state, clone actions, cancellable effect.
  • MacApp/Relay/Welcome/WelcomeView.swift — new Clone Repository button (Cmd+Shift+C) + sheet presentation.
  • MacApp/RelayTests/WelcomeFeatureTests.swift — 13 new tests for state transitions and effect wiring.

Test plan

  • cd MacApp && swiftlint lint --strict — 0 violations.
  • xcodebuild build -project MacApp/Relay.xcodeproj -scheme Relay -destination 'platform=macOS,arch=arm64' CODE_SIGN_IDENTITY=- — BUILD SUCCEEDED.
  • xcodebuild test ... -only-testing:RelayTests — all 33 unit tests pass (including 13 new clone tests).
  • Manual: open app → Welcome → Clone Repository → paste a git URL, pick a folder, clone → app navigates into the cloned project.
  • Manual: cancel mid-clone → subprocess terminates, sheet stays open.
  • Manual: invalid URL / missing destination → Clone button stays disabled.
  • Manual: clone failure (e.g. private repo no keys) → alert shows auth error.

Pre-existing unrelated failures

RelayUITests (7 tests) fail on the local test runner — they are end-to-end UI tests that require a project to be open and are unrelated to this PR (no UI test files were touched).

Closes #149

🤖 Generated with Claude Code

Add a third Quick Action on the Welcome screen that opens a sheet to
clone a git repository. URL field + destination folder (NSOpenPanel) +
Clone/Cancel buttons with a progress indicator while running and an
alert on failure. Clone runs via Process on /usr/bin/git with user's
existing credentials (SSH/credential helper); task cancellation
terminates the subprocess. On success the cloned folder is added to
recent projects and opened via the existing projectSelected delegate.

Closes #149

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 17, 2026 12:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a “Clone Repository” quick action to the Welcome screen, wiring a new sheet-driven clone flow into WelcomeFeature using a cancellable Process-based git runner so successful clones are added to the project repository and opened via the existing delegate path.

Changes:

  • Introduces GitCloneClient dependency + CloneError for running /usr/bin/git clone with task cancellation support.
  • Adds CloneRepositorySheet UI and Welcome screen button/sheet presentation.
  • Extends WelcomeFeature with transient clone sub-state/actions and adds unit tests for the new flow.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
MacApp/Relay/Welcome/GitCloneClient.swift New dependency wrapping git clone via Process, with cancellation support and error classification.
MacApp/Relay/Welcome/CloneRepositorySheet.swift New SwiftUI sheet for URL/destination inputs, progress display, and error alert.
MacApp/Relay/Welcome/WelcomeFeature.swift Adds clone sub-state/actions, effect wiring, and cancellation handling.
MacApp/Relay/Welcome/WelcomeView.swift Adds “Clone Repository…” quick action and presents the clone sheet.
MacApp/RelayTests/WelcomeFeatureTests.swift Adds coverage for clone sheet state transitions and success/failure paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread MacApp/Relay/Welcome/CloneRepositorySheet.swift
Comment thread MacApp/Relay/Welcome/GitCloneClient.swift
Comment thread MacApp/Relay/Welcome/WelcomeFeature.swift
@kirich1409 kirich1409 merged commit f462cd0 into main Apr 17, 2026
14 checks passed
@kirich1409 kirich1409 deleted the feature/clone-repo-welcome branch April 17, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clone repository from Welcome Screen

2 participants