Repository: CodeEditApp/CodeEdit
File: CodeEditModules/Modules/AppPreferences/src/Sections/SourceControlPreferences/SourceControlGeneralView.swift (Swift)

Code before:
                Toggle("Include upstream changes",
                       isOn: $prefs.preferences.sourceControl.general.includeUpstreamChanges)
                    .toggleStyle(.checkbox)
                    .padding(.leading, 20)
            }

            PreferencesSection("Comparison View", hideLabels: true) {
                Picker("Comparison View",
                       selection: $prefs.preferences.sourceControl.general.comparisonView) {
                    Text("Local Revision on Left Side")
                        .tag(AppPreferences.ComparisonView.localLeft)
                    Text("Local Revision on Right Side")
                        .tag(AppPreferences.ComparisonView.localRight)
                }
                .frame(width: 200)
            }

            PreferencesSection("Source Control Navigator", hideLabels: true) {
                Picker("Source Control Navigator",
                       selection: $prefs.preferences.sourceControl.general.controlNavigator) {
                    Text("Sort by Name")
                        .tag(AppPreferences.ControlNavigator.sortName)
                    Text("Sort by Date")
                        .tag(AppPreferences.ControlNavigator.sortDate)
                }
                .frame(width: 200)
            }

            PreferencesSection("Default Branch Name", hideLabels: false) {
                TextField("main", text: $branchName)
                    .frame(width: 200)
                Text("Branch names cannot contain spaces, backslashes, or other symbols")
                    .font(.system(size: 12))
                    .foregroundColor(.secondary)
            }
        }
        .frame(height: 350)
        .background(EffectView(material: .contentBackground))
    }
}

struct SourceControlGeneralView_Previews: PreviewProvider {
    static var previews: some View {
        SourceControlGeneralView(isChecked: true, branchName: "main")
    }
}

Review comment (suggestion):
Add a

```swift
private let inputWidth: Double = 200
```

and use this instead of _magic numbers_.

Code after:
                    .toggleStyle(.checkbox)

                Toggle("Include upstream changes",
                       isOn: $prefs.preferences.sourceControl.general.includeUpstreamChanges)
                    .toggleStyle(.checkbox)
                    .padding(.leading, 20)
            }

            PreferencesSection("Comparison View", hideLabels: true) {
                Picker("Comparison View",
                       selection: $prefs.preferences.sourceControl.general.revisionComparisonLayout) {
                    Text("Local Revision on Left Side")
                        .tag(AppPreferences.RevisionComparisonLayout.localLeft)
                    Text("Local Revision on Right Side")
                        .tag(AppPreferences.RevisionComparisonLayout.localRight)
                }
                .frame(width: inputWidth)
            }

            PreferencesSection("Source Control Navigator", hideLabels: true) {
                Picker("Source Control Navigator",
                       selection: $prefs.preferences.sourceControl.general.controlNavigatorOrder) {
                    Text("Sort by Name")
                        .tag(AppPreferences.ControlNavigatorOrder.sortByName)
                    Text("Sort by Date")
                        .tag(AppPreferences.ControlNavigatorOrder.sortByDate)
                }
                .frame(width: inputWidth)
            }

            PreferencesSection("Default Branch Name", hideLabels: false) {
                TextField("main", text: $branchName)
                    .frame(width: inputWidth)
                Text("Branch names cannot contain spaces, backslashes, or other symbols")
                    .font(.system(size: 12))
                    .foregroundColor(.secondary)
            }
        }
        .frame(height: 350)
        .background(EffectView(material: .contentBackground))
    }
}

struct SourceControlGeneralView_Previews: PreviewProvider {
    static var previews: some View {
        SourceControlGeneralView(isChecked: true, branchName: "main")
    }
}