Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@bartekpacia
Copy link
Member

@bartekpacia bartekpacia commented Apr 27, 2024

This PR is a very tiny cleanup that attempts to make all params of SemanticsUpdateBuilder.updateNode() non-nullable.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the [CLA].
  • All existing and new tests are passing.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

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.

@bartekpacia bartekpacia requested a review from chunhtai April 27, 2024 19:30
required List<StringAttribute> hintAttributes,
required String tooltip,
required TextDirection? textDirection,
required TextDirection textDirection,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am surprised this is not breaking the framework https://github.com/flutter/flutter/blob/28b81dc575da37247cb0719b17883b8db65560f6/packages/flutter/lib/src/semantics/semantics.dart#L2799
data.textDirection is nullable.

do you have another pr to migrate framework code?

Copy link
Member Author

@bartekpacia bartekpacia Apr 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't.

I am also surprised. I was suspecting that this PR will have red CI, and then I'd submit a separate framework PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like they are disabled here #50800

hintAttributes,
tooltip,
textDirection != null ? textDirection.index + 1 : 0,
textDirection.index + 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happen to the case where textDirection used to be null? I think we want to send 0 to the native side?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the native side has to handle TextDirection being null, and it's a valid use case, then I think this PR doesn't make sense and can be closed. Wdyt?

Copy link
Contributor

@chunhtai chunhtai Apr 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only took a quick glance of the code. We only enforce TextDirection to be non-null when there is and text data in the SemanticsData. I think this pr may not be the right move

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a new test should be added, so when in the future someone tries to do the same PR as this one, that test would fail.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird I remember we used to have a framework smoke test, but it was gone from the ci

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was disabled here #50800

@bartekpacia
Copy link
Member Author

Closing as per #52421 (comment)

@bartekpacia bartekpacia closed this May 4, 2024
@bartekpacia bartekpacia deleted the semantics/update_node_nonnull_params branch May 4, 2024 04:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants