Skip to content
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

accessibility_label_for_image doesn't require a11y label with Image(systemName:) #5165

Closed
2 tasks done
stjernegard opened this issue Aug 10, 2023 · 3 comments · Fixed by #5175
Closed
2 tasks done
Labels
enhancement Ideas for improvements of existing features and rules. good first issue Issue to be taken up by new contributors yet unfamiliar with the project.

Comments

@stjernegard
Copy link

stjernegard commented Aug 10, 2023

New Issue Checklist

Describe the bug

When opting in to use accessibility_label_for_image, I would expect to get a warning every time a default accessibility label is used, but there's no warning for missing labels when the image is an SF Symbol.

While this is documented behaviour in the rules, I consider it a bug because the rule is opt-in for people who want to have better accessibility labels and just describing the icon is not generally a good label.

It is true that some SF Symbols have default accessibility labels, like how plus has the default label "Add", many others simply fall back to the name of the icon, like clock.arrow.circlepath.

If others disagree, this might just be a feature request to allow us to also require a11y labels when Image(systemName:) is used.

@SimplyDanny
Copy link
Collaborator

@rcole34: You contributed the rule initially. That's why I'd like to hear your opinion on the request.

@SimplyDanny SimplyDanny added enhancement Ideas for improvements of existing features and rules. discussion Topics that cannot be categorized as bugs or enhancements yet. They require further discussions. labels Aug 12, 2023
@rcole34
Copy link
Contributor

rcole34 commented Aug 13, 2023

I think when I was doing this initially I was trying to minimize false positives and since some SF Symbols do get default labels I erred on the side of not triggering errors for that constructor. In hindsight though I agree that it makes more sense for this rule to always require labels for system images — not only are there lots of symbols that don’t get default labels, but the default ones could often be improved upon and given more context (“Add ____” is often better than “Add” to be clear about what the plus adds).

Since contributing this rule I’ve actually joined the accessibility team at Apple, which means I’d have to go through some approvals to contribute to open source projects, but if someone wants to take this on I’d support this enhancement and think it should be pretty straightforward to remove the special case for allowing Image(systemName:)

@SimplyDanny SimplyDanny added good first issue Issue to be taken up by new contributors yet unfamiliar with the project. and removed discussion Topics that cannot be categorized as bugs or enhancements yet. They require further discussions. labels Aug 13, 2023
@mildm8nnered
Copy link
Collaborator

I can handle this, I hope ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas for improvements of existing features and rules. good first issue Issue to be taken up by new contributors yet unfamiliar with the project.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants