-
Notifications
You must be signed in to change notification settings - Fork 28.5k
fix(a11y): check for remaining relevant text direction properties #165028
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
fix(a11y): check for remaining relevant text direction properties #165028
Conversation
Signed-off-by: Goddchen <[email protected]>
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
Here's a standalone test to reproduce the bug and verify that it's fixed:
|
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.
@Goddchen Sorry for the late review here. Thanks for fixing this.
Can you add a test? @lColinDl has a good suggestion in #165028 (comment). I would just add this to the bottom I think: expect(tester.takeException(), isNull);
.
Signed-off-by: Goddchen <[email protected]>
Signed-off-by: Goddchen <[email protected]>
Signed-off-by: Goddchen <[email protected]>
Signed-off-by: Goddchen <[email protected]>
Signed-off-by: Goddchen <[email protected]>
@justinmc done ✅ |
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.
LGTM 👍
I've rerun that failing test, looks like an infrastructure failure. I'll try to find a secondary reviewer.
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.
LGTM, but one small suggestion.
properties.attributedLabel != null || | ||
properties.label != null || | ||
properties.attributedDecreasedValue != null || | ||
properties.attributedIncreasedValue != null || | ||
properties.attributedValue != null || | ||
properties.decreasedValue != null || | ||
properties.increasedValue != null || | ||
properties.value != null || | ||
properties.attributedHint != null || | ||
properties.hint != null || | ||
properties.tooltip != null; |
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.
I'm thinking about how to help make this more easily kept in sync in the future. I think a useful tactic would be to list these fields in the same order as they're declared on SemanticsProperties:
That'd help make it easy to compare this code to that list by eye and check if anything's missing. Conveniently it's also an order that has a nice internal consistency to it: all in pairs foo
then attributedFoo
(except the one outlier tooltip
).
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.
Signed-off-by: Goddchen <[email protected]>
One failure is:
So that means there's a problem unrelated to this PR. There's a few more words on "tree status" here: That one will automatically go green when the tree gets fixed, so there's nothing you need to do. The other is Google testing. More about that here: You'll need a Google employee to investigate that one — so that means @justinmc :-) |
thanks for the clarification. The tree status job is green again. @justinmc can you check on the "Google testing" job? Or can I do anything there? |
Looks like the Google test failure was a timeout? Hopefully just that. I've rerun it. |
We faced an issue that the assert at https://github.com/flutter/flutter/blob/3.29.1/packages/flutter/lib/src/semantics/semantics.dart#L497-L500 was triggering although our widget was placed under a
MaterialApp
and therefore had a text direction set.Turns out that
_getTextDirection()
just was not checking forattributedValue
, etc.Related issue: #165051
fixes #165051
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.