Skip to content

Accessibility: Fix issues on Product details screen #15686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 30, 2025
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
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [internal] Optimized product image handling to reduce memory pressure by leveraging KingFisher's built-in capabilities [https://github.com/woocommerce/woocommerce-ios/pull/15629]
- [*] Payments: Added a two-minute timeout when waiting for card payments, to reduce the risk of battery drain or mistaken payments. [https://github.com/woocommerce/woocommerce-ios/pull/15665]
- [internal] POS: Handle payment intent creation error. [https://github.com/woocommerce/woocommerce-ios/pull/15661]
- [*] Fixed accessibility issues on the Product details screen [https://github.com/woocommerce/woocommerce-ios/pull/15686]
- [*] Removed domain purchase from app settings [https://github.com/woocommerce/woocommerce-ios/pull/15680]

22.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ struct BlazeCampaignItemView: View {
.aspectRatio(contentMode: .fill)
.frame(width: Layout.imageSize * scale, height: Layout.imageSize * scale)
.cornerRadius(Layout.cornerRadius)
.accessibilityHidden(true)
Spacer()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ final class BottomSheetListSelectorSectionHeaderView: UITableViewHeaderFooterVie

func configure(title: String?, subtitle: String?) {
self.title.text = title
self.title.numberOfLines = 0
self.subtitle.text = subtitle
self.subtitle.numberOfLines = 0
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ final class DiscountTypeBottomSheetListSelectorCommand: BottomSheetListSelectorC
text: model.actionSheetDescription,
image: model.actionSheetIcon,
imageTintColor: .gray(.shade20),
numberOfLinesForTitle: 0,
numberOfLinesForText: 0,
isSelected: isSelected(model: model)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ private extension BlazeCampaignDashboardView {
Image(uiImage: .blaze)
.resizable()
.frame(width: Layout.logoSize * scale, height: Layout.logoSize * scale)
.accessibilityHidden(true)
Text(DashboardCard.CardType.blaze.name)
.headlineStyle()
Spacer()
Expand Down Expand Up @@ -307,6 +308,7 @@ private struct ProductInfoView: View {
.aspectRatio(contentMode: .fill)
.frame(width: Layout.imageSize * scale, height: Layout.imageSize * scale)
.cornerRadius(Layout.cornerRadius)
.accessibilityHidden(true)

VStack(alignment: .leading) {
Text(Localization.suggestedProductLabel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ final class ProductFormBottomSheetListSelectorCommand: BottomSheetListSelectorCo
func configureCell(cell: ImageAndTitleAndTextTableViewCell, model: ProductFormBottomSheetAction) {
cell.selectionStyle = .none
cell.accessoryType = .disclosureIndicator
let viewModel = ImageAndTitleAndTextTableViewCell.ViewModel(title: model.title, text: model.subtitle, numberOfLinesForText: 0)
let viewModel = ImageAndTitleAndTextTableViewCell.ViewModel(title: model.title,
text: model.subtitle,
numberOfLinesForTitle: 0,
numberOfLinesForText: 0)
cell.updateUI(viewModel: viewModel)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ final class ProductTypeBottomSheetListSelectorCommand: BottomSheetListSelectorCo
text: model.actionSheetDescription,
image: model.actionSheetImage,
imageTintColor: .gray(.shade20),
numberOfLinesForTitle: 0,
numberOfLinesForText: 0)
cell.updateUI(viewModel: viewModel)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ private extension ImageAndTitleAndTextTableViewCell {
func configureImageView() {
contentImageView.contentMode = .center
contentImageView.setContentHuggingPriority(.required, for: .horizontal)
// set this to false and update the view model to support custom accessibility label if needed
contentImageView.accessibilityElementsHidden = true
}

func configureContentStackView() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ private extension ProductReviewsTableViewCell {

func configureImageView() {
contentImageView.contentMode = .center
contentImageView.accessibilityElementsHidden = true
}

func configureLabels() {
titleLabel.applyBodyStyle()
titleLabel.textColor = .text
titleLabel.numberOfLines = 0

reviewsLabel.applySubheadlineStyle()
reviewsLabel.textColor = .textSubtle
reviewsLabel.numberOfLines = 0
}

func configureStarView() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ final class DownloadableFileBottomSheetListSelectorCommand: BottomSheetListSelec
textTintColor: .text,
image: model.image,
imageTintColor: .gray(.shade20),
numberOfLinesForTitle: 0,
numberOfLinesForText: 0,
showsDisclosureIndicator: true)
cell.updateUI(viewModel: viewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ private extension ProductFormSection.SettingsRow.ViewModel {
textTintColor: tintColor,
image: icon,
imageTintColor: tintColor ?? .textSubtle,
numberOfLinesForTitle: 0,
numberOfLinesForText: numberOfLinesForDetails,
isActionable: isActionable,
showsDisclosureIndicator: isActionable,
Expand Down Expand Up @@ -238,6 +239,7 @@ private extension ProductFormTableViewDataSource {
comment: "Title in the Product description row on Product form screen when the description is non-empty.")
let viewModel = ImageAndTitleAndTextTableViewCell.ViewModel(title: title, text: description, isActionable: isEditable)
cell.updateUI(viewModel: viewModel)
cell.accessibilityHint = Localization.Accessibility.descriptionHint
} else {
guard let cell = cell as? BasicTableViewCell else {
fatalError()
Expand Down Expand Up @@ -482,5 +484,12 @@ private extension ProductFormTableViewDataSource {
value: "Tap to learn more.",
comment: "Text message prompting the user to tap to learn more about changing the privacy setting."
)
enum Accessibility {
static let descriptionHint = NSLocalizedString(
"productFormTableViewDataSource.accessibility.descriptionHint",
value: "Tap to view more or edit product description",
comment: "Accessibility hint for product description on Product form screen"
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ final class GenerateVariationsSelectorCommand: BottomSheetListSelectorCommand {
func configureCell(cell: ImageAndTitleAndTextTableViewCell, model: Options) {
let viewModel = ImageAndTitleAndTextTableViewCell.ViewModel(title: model.title,
text: model.description,
numberOfLinesForTitle: 0,
numberOfLinesForText: 0,
isSelected: isSelected(model: model)
)
Expand Down