Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions App/Features/Home/DayFocusDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ struct DayFocusDetailView: View {
.foregroundStyle(AppColors.textSecondary)
}
.buttonStyle(.plain)
.accessibilityLabel("Previous day")
.accessibilityHint("Shows the previous day's focuses")
.opacity(canMoveBackward ? 1 : 0.3)
.disabled(!canMoveBackward)

Expand All @@ -73,6 +75,8 @@ struct DayFocusDetailView: View {
.foregroundStyle(AppColors.textSecondary)
}
.buttonStyle(.plain)
.accessibilityLabel("Next day")
.accessibilityHint("Shows the next day's focuses")
.opacity(canMoveForward ? 1 : 0.3)
.disabled(!canMoveForward)
}
Expand All @@ -89,6 +93,8 @@ struct DayFocusDetailView: View {
.clipShape(Circle())
}
.buttonStyle(.plain)
.accessibilityLabel("Close")
.accessibilityHint("Dismisses the detail view")

Spacer()
}
Expand Down
2 changes: 2 additions & 0 deletions App/Features/Home/FocusInlineEditRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ struct FocusInlineEditRow: View {
}
}
.buttonStyle(.plain)
.accessibilityLabel(focus.isCompleted ? "\(focus.title), completed" : "\(focus.title), not completed")
.accessibilityHint(focus.isCompleted ? "Marks as not completed" : "Marks as completed")

TextField("Focus", text: $title)
.font(.tenxLargeBody)
Expand Down
2 changes: 2 additions & 0 deletions App/Features/Home/FocusStatusCardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct FocusStatusCardView: View {
Image(systemName: "flame.fill")
.font(.tenxIconLarge)
.foregroundStyle(streak > 0 ? Color.orange : AppColors.textMuted)
.accessibilityHidden(true)
}

HStack(alignment: .firstTextBaseline, spacing: 12) {
Expand All @@ -54,6 +55,7 @@ struct FocusStatusCardView: View {
}
.buttonStyle(.plain)
.accessibilityLabel("Share")
.accessibilityHint("Shares your streak as an image")
}
}
.padding(20)
Expand Down
6 changes: 6 additions & 0 deletions App/Features/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import StoreKit
import UniformTypeIdentifiers

struct HomeView: View {

Check failure on line 6 in App/Features/Home/HomeView.swift

View workflow job for this annotation

GitHub Actions / Lint

Struct body should span 300 lines or less excluding comments and whitespace: currently spans 305 lines (type_body_length)
@Environment(\.modelContext) var modelContext
@EnvironmentObject private var appState: AppState
@EnvironmentObject private var theme: ThemeController
Expand Down Expand Up @@ -41,6 +41,7 @@
)
}
.buttonStyle(.plain)
.accessibilityHint("Opens the full year progress view")

entrySection

Expand Down Expand Up @@ -81,6 +82,8 @@
.foregroundStyle(AppColors.textSecondary)
.frame(width: 32, height: 32)
}
.accessibilityLabel("Settings")
.accessibilityHint("Opens the settings screen")
}
}
.onAppear {
Expand Down Expand Up @@ -187,6 +190,7 @@
.clipShape(Capsule())
}
.buttonStyle(.plain)
.accessibilityHint("Opens today's focus details")
}
}

Expand Down Expand Up @@ -295,6 +299,8 @@
}
}
.buttonStyle(.plain)
.accessibilityLabel(focus.isCompleted ? "\(focus.title), completed" : "\(focus.title), not completed")
.accessibilityHint(focus.isCompleted ? "Marks as not completed" : "Marks as completed")

Text(focus.title)
.font(.tenxLargeBody)
Expand Down
2 changes: 2 additions & 0 deletions App/Features/Home/SwipeToDeleteRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct SwipeToDeleteRow<Content: View>: View {
.offset(x: offset)
.background(rowSizeReader)
.simultaneousGesture(dragGesture)
.accessibilityAction(named: "Delete") { action() }
}
.clipShape(RoundedRectangle(cornerRadius: cornerRadius, style: .continuous))
}
Expand All @@ -37,6 +38,7 @@ struct SwipeToDeleteRow<Content: View>: View {
HStack(spacing: 6) {
Image(systemName: "trash")
.font(.tenxIconSmall)
.accessibilityHidden(true)
if width > 64 {
Text("Delete")
.font(.tenxTinyBold)
Expand Down
16 changes: 16 additions & 0 deletions App/Features/Home/WeeklyProgressGridView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ struct WeeklyProgressGridView: View {
Image(systemName: "checkmark")
.font(.tenxTinyBold)
.foregroundStyle(Color.white)
.accessibilityHidden(true)
} else if day.completed > 0 {
Text("\(day.completed)/\(day.total)")
.font(.tenxCaption)
Expand All @@ -40,10 +41,13 @@ struct WeeklyProgressGridView: View {
Image(systemName: "xmark")
.font(.tenxTinyBold)
.foregroundStyle(Color.white.opacity(0.7))
.accessibilityHidden(true)
}
}
}
}
.accessibilityElement(children: .combine)
.accessibilityLabel(dayAccessibilityLabel(for: day))
}
}

Expand Down Expand Up @@ -79,6 +83,18 @@ struct WeeklyProgressGridView: View {
private func dayLabel(for date: Date) -> String {
DateFormatters.weekdayShort.string(from: date)
}

private func dayAccessibilityLabel(for day: WeeklyProgressDay) -> String {
let name = dayLabel(for: day.date)
guard day.total > 0 else { return "\(name), no focuses set" }
if day.maintainsStreak {
return "\(name), all \(day.total) focuses completed"
}
if day.completed > 0 {
return "\(name), \(day.completed) of \(day.total) focuses completed"
}
return "\(name), no focuses completed"
}
}

private struct LegendItem: View {
Expand Down
9 changes: 9 additions & 0 deletions App/Features/Home/YearProgressPreviewTileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct YearProgressPreviewTileView: View {
.frame(height: 96)
.background(AppColors.surface)
.clipShape(RoundedRectangle(cornerRadius: 12, style: .continuous))
.accessibilityHidden(true)

footer
}
Expand All @@ -45,6 +46,7 @@ struct YearProgressPreviewTileView: View {
Image(systemName: "calendar")
.font(.tenxIconMedium)
.foregroundStyle(AppColors.textSecondary)
.accessibilityHidden(true)
}
}

Expand All @@ -53,6 +55,7 @@ struct YearProgressPreviewTileView: View {
Text(footerText)
.font(.tenxCaption)
.foregroundStyle(AppColors.textSecondary)
.accessibilityLabel(footerAccessibilityLabel)

Spacer()

Expand All @@ -63,6 +66,7 @@ struct YearProgressPreviewTileView: View {
Image(systemName: "chevron.right")
.font(.tenxMicroSemibold)
.foregroundStyle(AppColors.textMuted)
.accessibilityHidden(true)
}
}
}
Expand All @@ -71,4 +75,9 @@ struct YearProgressPreviewTileView: View {
guard summary.totalDays > 0 else { return "Year data will appear here" }
return "\(summary.daysLeft)d left • \(String(format: "%.0f%%", summary.yearCompletionPercent))"
}

private var footerAccessibilityLabel: String {
guard summary.totalDays > 0 else { return "Year data will appear here" }
return "\(summary.daysLeft) days left, \(String(format: "%.0f", summary.yearCompletionPercent)) percent complete"
}
}
Loading