Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0abc12f

Browse files
Fix Alignment In Git Clone Panel (#2131)
### Description Removes all hard-coded locations and widths in the git clone panel, swapping them out for correct SwiftUI layout. This fixes an issue on macOS Tahoe but is not limited to Tahoe intentionally. This should not be hardcoded on any platform and does not change the layout of the panel on Sequoia or lower. ### Related Issues * closes #2120 * closes #2116 ### Checklist - [x] I read and understood the [contributing guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md) as well as the [code of conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md) - [x] The issues this PR addresses are related to each other - [x] My changes generate no new warnings - [x] My code builds and runs on my machine - [x] My changes are all related to the related issue above - [x] I documented my code ### Screenshots <img width="513" height="258" alt="Screenshot 2025年09月11日 at 1 43 36 PM" src="https://github.com/user-attachments/assets/f36f379d-e020-40cf-93f2-2a4456f84a5c" />
1 parent 5f48f0a commit 0abc12f

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

‎CodeEdit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎CodeEdit/Features/SourceControl/Clone/GitCloneView.swift

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ struct GitCloneView: View {
2828

2929
var body: some View {
3030
VStack(spacing: 8) {
31-
HStack {
31+
HStack(alignment:.top) {
3232
Image(nsImage: NSApp.applicationIconImage)
3333
.resizable()
3434
.frame(width: 64, height: 64)
35-
.padding(.bottom, 50)
3635
VStack(alignment: .leading) {
37-
Text("Clone a repository")
36+
Text("Clone a Repository")
3837
.bold()
3938
.padding(.bottom, 2)
4039
Text("Enter a git repository URL:")
@@ -46,9 +45,9 @@ struct GitCloneView: View {
4645
TextField("Git Repository URL", text: $viewModel.repoUrlStr)
4746
.lineLimit(1)
4847
.padding(.bottom, 15)
49-
.frame(width: 300)
5048

5149
HStack {
50+
Spacer()
5251
Button("Cancel") {
5352
dismiss()
5453
}
@@ -58,11 +57,8 @@ struct GitCloneView: View {
5857
.keyboardShortcut(.defaultAction)
5958
.disabled(!viewModel.isValidUrl(url: viewModel.repoUrlStr))
6059
}
61-
.offset(x: 185)
62-
.alignmentGuide(.leading) { context in
63-
context[.leading]
64-
}
6560
}
61+
.frame(width: 300)
6662
}
6763
.padding(.top, 20)
6864
.padding(.horizontal, 20)
@@ -71,28 +67,32 @@ struct GitCloneView: View {
7167
viewModel.checkClipboard()
7268
}
7369
.sheet(isPresented: $viewModel.isCloning) {
74-
NavigationStack {
75-
VStack {
76-
ProgressView(
77-
viewModel.cloningProgress.state.label,
78-
value: viewModel.cloningProgress.progress,
79-
total: 100
80-
)
81-
}
82-
}
83-
.toolbar {
84-
ToolbarItem {
85-
Button("Cancel Cloning") {
86-
viewModel.cloningTask?.cancel()
87-
viewModel.cloningTask = nil
88-
viewModel.isCloning = false
89-
}
90-
}
70+
cloningSheet
71+
}
72+
}
73+
}
74+
75+
@ViewBuilder private var cloningSheet: some View {
76+
NavigationStack {
77+
VStack {
78+
ProgressView(
79+
viewModel.cloningProgress.state.label,
80+
value: viewModel.cloningProgress.progress,
81+
total: 100
82+
)
83+
}
84+
}
85+
.toolbar {
86+
ToolbarItem {
87+
Button("Cancel Cloning") {
88+
viewModel.cloningTask?.cancel()
89+
viewModel.cloningTask = nil
90+
viewModel.isCloning = false
9191
}
92-
.padding()
93-
.frame(width: 350)
9492
}
9593
}
94+
.padding()
95+
.frame(width: 350)
9696
}
9797

9898
func cloneRepository() {

‎CodeEdit/Features/SourceControl/Clone/ViewModels/GitCloneViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class GitCloneViewModel: ObservableObject {
184184
dialog.prompt = "Clone"
185185
dialog.nameFieldStringValue = saveName
186186
dialog.nameFieldLabel = "Clone as"
187-
dialog.title = "Clone"
187+
dialog.title = "Clone a Repository"
188188

189189
guard dialog.runModal() == NSApplication.ModalResponse.OK,
190190
let result = dialog.url else {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /