New builds for iOS 1.0.3 and Android 1.5.1

This commit is contained in:
2025-09-27 18:47:09 -06:00
parent 298ba6149b
commit 5d1748765f
19 changed files with 1157 additions and 1034 deletions

View File

@@ -13,10 +13,9 @@ struct ProblemsView: View {
// Apply search filter
if !searchText.isEmpty {
filtered = filtered.filter { problem in
(problem.name?.localizedCaseInsensitiveContains(searchText) ?? false)
return problem.name?.localizedCaseInsensitiveContains(searchText) ?? false
|| (problem.description?.localizedCaseInsensitiveContains(searchText) ?? false)
|| (problem.location?.localizedCaseInsensitiveContains(searchText) ?? false)
|| (problem.setter?.localizedCaseInsensitiveContains(searchText) ?? false)
|| problem.tags.contains { $0.localizedCaseInsensitiveContains(searchText) }
}
}
@@ -31,7 +30,11 @@ struct ProblemsView: View {
filtered = filtered.filter { $0.gymId == gym.id }
}
return filtered.sorted { $0.updatedAt > $1.updatedAt }
// Separate active and inactive problems
let active = filtered.filter { $0.isActive }.sorted { $0.updatedAt > $1.updatedAt }
let inactive = filtered.filter { !$0.isActive }.sorted { $0.updatedAt > $1.updatedAt }
return active + inactive
}
var body: some View {
@@ -195,10 +198,23 @@ struct ProblemsList: View {
Label("Delete", systemImage: "trash")
}
Button {
let updatedProblem = problem.updated(isActive: !problem.isActive)
dataManager.updateProblem(updatedProblem)
} label: {
Label(
problem.isActive ? "Mark as Reset" : "Mark as Active",
systemImage: problem.isActive ? "xmark.circle" : "checkmark.circle")
}
.tint(.orange)
Button {
problemToEdit = problem
} label: {
Label("Edit", systemImage: "pencil")
HStack {
Image(systemName: "pencil")
Text("Edit")
}
}
.tint(.blue)
}
@@ -239,6 +255,7 @@ struct ProblemRow: View {
Text(problem.name ?? "Unnamed Problem")
.font(.headline)
.fontWeight(.semibold)
.foregroundColor(problem.isActive ? .primary : .secondary)
Text(gym?.name ?? "Unknown Gym")
.font(.subheadline)
@@ -295,9 +312,9 @@ struct ProblemRow: View {
}
if !problem.isActive {
Text("Inactive")
Text("Reset / No Longer Set")
.font(.caption)
.foregroundColor(.red)
.foregroundColor(.orange)
.fontWeight(.medium)
}
}