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>
This commit is contained in:
Trey t
2026-04-13 18:49:18 -05:00
parent 77932f802a
commit 945b2ff1f3

View File

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