-
Notifications
You must be signed in to change notification settings - Fork 292
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
[EXTERNAL] Hide decorative Paywall images from accessibility (#3886) via @shiftingsand #3892
[EXTERNAL] Hide decorative Paywall images from accessibility (#3886) via @shiftingsand #3892
Conversation
Hide decorative Paywall images from accessibility.
Generated by 🚫 Danger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given how this class is currently used, and the tools we provide in our dashboard, this change can work for now. However it's not really a complete solution because this class could be used to fetch an image that is not purely decorative in nature, in which case it should be possible to provide it with an accessibility label string. Our dashboard ought to allow users to enter "alt text" for images that do communicate pertinent information, that we could use as an accessibility label.
Maybe for now we should add an optional accessibilityLabel to the initializer with a default value of nil
, and when nil
, we apply .accessibilityHidden(true)
? This would lay some groundwork while achieving the immediate goal of disabling this image for VoiceOver.
So something like:
init(url: URL, accessibilityLabel: String? = nil, aspectRatio: CGFloat? = nil, maxWidth: CGFloat? = nil) {
image
// existing modifiers
.accessibilityLabel(accessibilityLabel ?? "")
.accessibilityHidden(accessibilityLabel == nil)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving anyway so you can merge if you disagree!
Yeah, I agree the ideal is to allow adding this information in the dashboard so it can be set dynamically in the same origin as the image itself. However, we might take a bit longer to support this. I think this is a better compromise than what we have right now in the meantime. I don't fully like the approach of adding the label as a parameter in the code, since it would mean:
cc @aboedo for a third opinion! |
As talked, we are going with this for now, and we can add support for backend driven labels later. |
**This is an automatic release.** ### New Features * RemoteImage Low Res Image support (#3906) via James Borthwick (@jamesrb1) ### Bugfixes * [EXTERNAL] Hide decorative Paywall images from accessibility (#3886) via @shiftingsand (#3892) via Toni Rico (@tonidero) ### Dependency Updates * Bump rexml from 3.2.6 to 3.2.8 in /Tests/InstallationTests/CocoapodsInstallation (#3908) via dependabot[bot] (@dependabot[bot]) * Bump fastlane-plugin-revenuecat_internal from `dd5e21f` to `8ec0072` (#3873) via dependabot[bot] (@dependabot[bot]) ### Other Changes * Revert to use xcode 14 to fix deploys (#3929) via Cesar de la Vega (@vegaro) * SPMInstallation tests deployment version increase (#3922) via Cesar de la Vega (@vegaro) * Only install `swiftlint` on Xcode 15 jobs (#3913) via Josh Holtz (@joshdholtz) * Add `http_request_performed` diagnostics event (#3897) via Toni Rico (@tonidero) * Paywalls Tester: App Store Prep (#3889) via James Borthwick (@jamesrb1) * Paywalls Tester: Enable Example Paywalls in Release Mode (#3885) via James Borthwick (@jamesrb1) * Use Ruby 3.2 on CircleCI (#3896) via Josh Holtz (@joshdholtz) * PaywallsTester: Remove unused code (#3884) via James Borthwick (@jamesrb1) * Improved Error Handling (#3883) via James Borthwick (@jamesrb1) * Clear diagnostics file if we detect it's too big during event tracking (#3824) via Toni Rico (@tonidero) * Preprocessor to make select constructs public (#3880) via James Borthwick (@jamesrb1) * Paywalls Tester: Use key defined in CI (#3869) via James Borthwick (@jamesrb1) * Cleanup: Remove test storekit configuration files when importing through SPM (#3878) via Andy Boedo (@aboedo) * Update fastlane plugin and fix docs index path (#3872) via Toni Rico (@tonidero) * Update to use xcode 15.3 in CI (#3870) via Cesar de la Vega (@vegaro) * Paywalls Tester 0.1 (#3868) via James Borthwick (@jamesrb1) * Update config.yml for SPM repo copy (#3861) via James Borthwick (@jamesrb1) * Change deploy-purchase-tester to use xcode 15 (#3858) via Cesar de la Vega (@vegaro)
Description
Added .accessibilityHidden(true) to the two images in RemoteImage. I initially was hesitant to change RemoteImage itself, but went ahead and did so since it seems to be only used by the Paywall templates.
Contributed by @shiftingsand in #3886