feat: hardening, error states, interruption handling, a11y (Phase 8)

This commit is contained in:
snowspeeder committed 2026-08-30 09:37:05 -04:00
1 parent 9f1f26ba54
commit 12ded179eb
6 files changed
+233 -38

No files matched your search

@@ -18,6 +18,14 @@ struct MediaPanelView: View {
var body: some View {
ScrollView {
VStack(spacing: 20) {
if let stateError = playerController.stateError {
Label(stateError, systemImage: "wifi.exclamationmark")
.font(.subheadline)
.foregroundStyle(.red)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(12)
.background(Color.red.opacity(0.1), in: RoundedRectangle(cornerRadius: 14))
}
nowPlayingCard
transportControls
seekSection
@@ -103,6 +111,7 @@ struct MediaPanelView: View {
Image(systemName: "gobackward.10")
.font(.title3)
}
.accessibilityLabel("Seek back 10 seconds")
.disabled(playerController.track == nil)
Button(action: togglePlayPause) {
@@ -110,18 +119,21 @@ struct MediaPanelView: View {
.font(.system(size: 44))
.foregroundStyle(playerController.track == nil ? Color.secondary : Color.accentColor)
}
.accessibilityLabel(playerController.desired == "playing" && playerController.track != nil ? "Pause" : "Play")
.disabled(playerController.track == nil)
Button(action: seekForward) {
Image(systemName: "goforward.10")
.font(.title3)
}
.accessibilityLabel("Seek forward 10 seconds")
.disabled(playerController.track == nil)
Button(role: .destructive, action: stopPlayback) {
Image(systemName: "stop.circle")
.font(.title2)
}
.accessibilityLabel("Stop playback")
.disabled(playerController.track == nil)
}
}
@@ -276,6 +288,7 @@ struct MediaPanelView: View {
Button(action: refreshLibrary) {
Image(systemName: "arrow.clockwise")
}
.accessibilityLabel("Refresh library")
}
if let libraryError {
Text(libraryError)