Fix some accessibility modifiers (#1606)

This commit is contained in:
Nicolas Mauri
2023-08-31 17:00:09 +02:00
committed by GitHub
parent 3ed6de687d
commit 8886f0f9d3
5 changed files with 13 additions and 13 deletions
@@ -40,7 +40,7 @@ struct RoomAttachmentPicker: View {
} label: { } label: {
PickerLabel(title: L10n.screenRoomAttachmentSourceGallery, icon: Image(systemName: "photo.fill")) PickerLabel(title: L10n.screenRoomAttachmentSourceGallery, icon: Image(systemName: "photo.fill"))
} }
.accessibilityLabel(A11yIdentifiers.roomScreen.attachmentPickerPhotoLibrary) .accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerPhotoLibrary)
Button { Button {
context.showAttachmentPopover = false context.showAttachmentPopover = false
@@ -48,7 +48,7 @@ struct RoomAttachmentPicker: View {
} label: { } label: {
PickerLabel(title: L10n.screenRoomAttachmentSourceFiles, icon: Image(systemName: "paperclip")) PickerLabel(title: L10n.screenRoomAttachmentSourceFiles, icon: Image(systemName: "paperclip"))
} }
.accessibilityLabel(A11yIdentifiers.roomScreen.attachmentPickerDocuments) .accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerDocuments)
Button { Button {
context.showAttachmentPopover = false context.showAttachmentPopover = false
@@ -56,7 +56,7 @@ struct RoomAttachmentPicker: View {
} label: { } label: {
PickerLabel(title: L10n.screenRoomAttachmentSourceCamera, icon: Image(systemName: "camera.fill")) PickerLabel(title: L10n.screenRoomAttachmentSourceCamera, icon: Image(systemName: "camera.fill"))
} }
.accessibilityLabel(A11yIdentifiers.roomScreen.attachmentPickerCamera) .accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerCamera)
Button { Button {
context.showAttachmentPopover = false context.showAttachmentPopover = false
@@ -64,7 +64,7 @@ struct RoomAttachmentPicker: View {
} label: { } label: {
PickerLabel(title: L10n.screenRoomAttachmentSourceLocation, icon: Image(asset: Asset.Images.locationPin)) PickerLabel(title: L10n.screenRoomAttachmentSourceLocation, icon: Image(asset: Asset.Images.locationPin))
} }
.accessibilityLabel(A11yIdentifiers.roomScreen.attachmentPickerLocation) .accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerLocation)
if ServiceLocator.shared.settings.pollsCreationEnabled { if ServiceLocator.shared.settings.pollsCreationEnabled {
Button { Button {
@@ -115,7 +115,7 @@ struct HomeScreen: View {
HomeScreenInvitesButton(title: L10n.actionInvitesList, hasBadge: context.viewState.hasUnreadPendingInvitations) { HomeScreenInvitesButton(title: L10n.actionInvitesList, hasBadge: context.viewState.hasUnreadPendingInvitations) {
context.send(viewAction: .selectInvites) context.send(viewAction: .selectInvites)
} }
.accessibilityLabel(A11yIdentifiers.homeScreen.invites) .accessibilityIdentifier(A11yIdentifiers.homeScreen.invites)
.frame(maxWidth: .infinity, alignment: .trailing) .frame(maxWidth: .infinity, alignment: .trailing)
.padding(.vertical, -8.0) .padding(.vertical, -8.0)
} }
@@ -175,7 +175,7 @@ struct HomeScreen: View {
} label: { } label: {
Image(systemName: "square.and.pencil") Image(systemName: "square.and.pencil")
} }
.accessibilityLabel(A11yIdentifiers.homeScreen.startChat) .accessibilityIdentifier(A11yIdentifiers.homeScreen.startChat)
} }
/// Often times the scroll view's content size isn't correct yet when this method is called e.g. when cancelling a search /// Often times the scroll view's content size isn't correct yet when this method is called e.g. when cancelling a search
@@ -29,7 +29,7 @@ struct HomeScreenUserMenuButton: View {
} label: { } label: {
Label(L10n.commonSettings, systemImage: "gearshape") Label(L10n.commonSettings, systemImage: "gearshape")
} }
.accessibilityLabel(A11yIdentifiers.homeScreen.settings) .accessibilityIdentifier(A11yIdentifiers.homeScreen.settings)
} }
Section { Section {
MatrixUserShareLink(userID: context.viewState.userID) { MatrixUserShareLink(userID: context.viewState.userID) {
@@ -97,7 +97,7 @@ struct SettingsScreen: View {
kind: .navigationLink { kind: .navigationLink {
context.send(viewAction: .developerOptions) context.send(viewAction: .developerOptions)
}) })
.accessibilityLabel(A11yIdentifiers.settingsScreen.developerOptions) .accessibilityIdentifier(A11yIdentifiers.settingsScreen.developerOptions)
} }
} }
@@ -110,7 +110,7 @@ struct SettingsScreen: View {
kind: .button { kind: .button {
context.send(viewAction: .account) context.send(viewAction: .account)
}) })
.accessibilityLabel(A11yIdentifiers.settingsScreen.account) .accessibilityIdentifier(A11yIdentifiers.settingsScreen.account)
} }
// Message layout // Message layout
@@ -130,7 +130,7 @@ struct SettingsScreen: View {
kind: .navigationLink { kind: .navigationLink {
context.send(viewAction: .notifications) context.send(viewAction: .notifications)
}) })
.accessibilityLabel(A11yIdentifiers.settingsScreen.notifications) .accessibilityIdentifier(A11yIdentifiers.settingsScreen.notifications)
} }
// Analytics // Analytics
@@ -139,7 +139,7 @@ struct SettingsScreen: View {
kind: .navigationLink { kind: .navigationLink {
context.send(viewAction: .analytics) context.send(viewAction: .analytics)
}) })
.accessibilityLabel(A11yIdentifiers.settingsScreen.analytics) .accessibilityIdentifier(A11yIdentifiers.settingsScreen.analytics)
// Report Bug // Report Bug
ListRow(label: .default(title: L10n.commonReportABug, ListRow(label: .default(title: L10n.commonReportABug,
@@ -191,7 +191,7 @@ struct SettingsScreen: View {
private var doneButton: some View { private var doneButton: some View {
Button(L10n.actionDone, action: close) Button(L10n.actionDone, action: close)
.accessibilityLabel(A11yIdentifiers.settingsScreen.done) .accessibilityIdentifier(A11yIdentifiers.settingsScreen.done)
} }
private func close() { private func close() {
@@ -72,7 +72,7 @@ struct StartChatScreen: View {
.imageScale(.small) .imageScale(.small)
} }
.buttonStyle(FormButtonStyle(accessory: .navigationLink)) .buttonStyle(FormButtonStyle(accessory: .navigationLink))
.accessibilityLabel(A11yIdentifiers.startChatScreen.createRoom) .accessibilityIdentifier(A11yIdentifiers.startChatScreen.createRoom)
} }
.compoundFormSection() .compoundFormSection()
} }