Add missing accessibility traits for the Headers in the Home and Item views

This commit is contained in:
David Cordero 2022-01-16 20:06:48 +01:00
parent 68f143460a
commit fa026298a9
5 changed files with 11 additions and 1 deletions

View File

@ -25,6 +25,7 @@ struct EpisodesRowView<RowManager>: View where RowManager: EpisodesRowManager {
if onlyCurrentSeason {
if let currentSeason = Array(viewModel.seasonsEpisodes.keys).first(where: { $0.id == viewModel.item.id }) {
Text(currentSeason.name ?? L10n.noTitle)
.accessibility(addTraits: [.isHeader])
}
} else {
Menu {

View File

@ -21,6 +21,7 @@ struct PillHStackView<ItemType: PillStackable>: View {
.fontWeight(.semibold)
.padding(.top, 3)
.padding(.leading, 16)
.accessibility(addTraits: [.isHeader])
ScrollView(.horizontal, showsIndicators: false) {
HStack {

View File

@ -62,6 +62,7 @@ struct HomeView: View {
.font(.title2)
.fontWeight(.bold)
.padding()
.accessibility(addTraits: [.isHeader])
} selectedAction: { item in
homeRouter.route(to: \.item, item)
}
@ -73,6 +74,7 @@ struct HomeView: View {
.font(.title2)
.fontWeight(.bold)
.padding()
.accessibility(addTraits: [.isHeader])
} selectedAction: { item in
homeRouter.route(to: \.item, item)
}
@ -85,7 +87,8 @@ struct HomeView: View {
Text(L10n.latestWithString(library.name ?? ""))
.font(.title2)
.fontWeight(.bold)
.accessibility(addTraits: [.isHeader])
Spacer()
Button {

View File

@ -55,6 +55,7 @@ struct ItemViewBody: View {
L10n.seasons.text
.fontWeight(.semibold)
.padding()
.accessibility(addTraits: [.isHeader])
}, selectedAction: { season in
itemRouter.route(to: \.item, season)
})
@ -113,6 +114,7 @@ struct ItemViewBody: View {
.fontWeight(.semibold)
.padding(.bottom)
.padding(.horizontal)
.accessibility(addTraits: [.isHeader])
} selectedAction: { collectionItem in
itemRouter.route(to: \.item, collectionItem)
}
@ -128,6 +130,7 @@ struct ItemViewBody: View {
.fontWeight(.semibold)
.padding(.bottom)
.padding(.horizontal)
.accessibility(addTraits: [.isHeader])
},
selectedAction: { person in
itemRouter.route(to: \.library, (viewModel: .init(person: person), title: person.title))
@ -144,6 +147,7 @@ struct ItemViewBody: View {
.fontWeight(.semibold)
.padding(.bottom)
.padding(.horizontal)
.accessibility(addTraits: [.isHeader])
},
selectedAction: { item in
itemRouter.route(to: \.item, item)

View File

@ -25,6 +25,7 @@ struct ItemLandscapeTopBarView: View {
.foregroundColor(.primary)
.padding(.leading, 16)
.padding(.bottom, 10)
.accessibility(addTraits: [.isHeader])
// MARK: Details