Compare commits

..

2 Commits

Author SHA1 Message Date
924090190f Merge pull request 'Add Done button to grammar exercise score screen' (#17) from fix/grammar-exercise-back-button into main 2026-04-13 18:49:37 -05:00
Trey t
945b2ff1f3 Add Done button to grammar exercise score screen
Fixes stuck state after completing grammar exercises — adds a
dismiss button on the results screen.

Closes #14

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 18:49:18 -05:00

View File

@@ -3,6 +3,7 @@ import SwiftUI
struct GrammarExerciseView: View {
let noteId: String
let noteTitle: String
@Environment(\.dismiss) private var dismiss
@State private var exercises: [GrammarExercise] = []
@State private var currentIndex = 0
@@ -122,6 +123,19 @@ struct GrammarExerciseView: View {
Text(correctCount == exercises.count ? "Perfect!" : "Keep reviewing this topic.")
.font(.title3)
.foregroundStyle(.secondary)
Button {
dismiss()
} label: {
Text("Done")
.font(.headline)
.frame(maxWidth: .infinity)
.padding(.vertical, 12)
}
.buttonStyle(.borderedProminent)
.tint(.purple)
.padding(.horizontal)
Spacer()
}
}