Import/export fixes, icon, and graphing

This commit is contained in:
2025-09-13 00:42:15 -06:00
parent ce220c7220
commit a3e60ce995
11 changed files with 388 additions and 230 deletions

View File

@@ -95,16 +95,16 @@ struct AddEditProblemView: View {
loadExistingProblem()
setupInitialGym()
}
.onChange(of: selectedGym) { _ in
.onChange(of: selectedGym) {
updateAvailableOptions()
}
.onChange(of: selectedClimbType) { _ in
.onChange(of: selectedClimbType) {
updateDifficultySystem()
}
.onChange(of: selectedDifficultySystem) { _ in
.onChange(of: selectedDifficultySystem) {
resetGradeIfNeeded()
}
.onChange(of: selectedPhotos) { _ in
.onChange(of: selectedPhotos) {
Task {
await loadSelectedPhotos()
}
@@ -171,7 +171,7 @@ struct AddEditProblemView: View {
@ViewBuilder
private func ClimbTypeSection() -> some View {
if let gym = selectedGym {
if selectedGym != nil {
Section("Climb Type") {
ForEach(availableClimbTypes, id: \.self) { climbType in
HStack {
@@ -227,8 +227,13 @@ struct AddEditProblemView: View {
.font(.headline)
if selectedDifficultySystem == .custom || availableGrades.isEmpty {
TextField("Enter custom grade", text: $difficultyGrade)
TextField("Enter custom grade (numbers only)", text: $difficultyGrade)
.textFieldStyle(.roundedBorder)
.keyboardType(.numberPad)
.onChange(of: difficultyGrade) {
// Filter out non-numeric characters
difficultyGrade = difficultyGrade.filter { $0.isNumber }
}
} else {
Menu {
if !difficultyGrade.isEmpty {