Skip to content

Conversation

@hannah-hyj
Copy link
Member

@hannah-hyj hannah-hyj commented Jul 5, 2023

Add a threshold when comparing screen order for selectables. So when the vertical position diff is within the threshold, will compare the horizontal position.

This fixes #111021 and #127942

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, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Jul 5, 2023
@flutter flutter deleted a comment from flutter-dashboard bot Jul 6, 2023
Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

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

This solution seems a bit fragile. We may soon run into situation where people would require conflicting thresholds for different use cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

This would likely break if there is more padding in widget span?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also this should probably call vertical threshold?

Copy link
Member Author

Choose a reason for hiding this comment

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

renamed to _kSelectableVerticalComparingThreshold

@hannah-hyj
Copy link
Member Author

Yes, this fix is not a one-and-done solution, but I don't think this fix will make things worse.

in #111021 and #127942, both cases the widgetspan just shifted like 0.5 pixel. This fix can resolve some existing issues.

A final solution will probably be exposing compareOrder function to developers and we can follow up if there are more requests.

Copy link
Contributor

@Renzo-Olivares Renzo-Olivares left a comment

Choose a reason for hiding this comment

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

I think this change is reasonable if it doesn't break any current screen order calculations. I've experienced this problem where the rects are off by a few pixels so they do not defer to horizontal comparison.

@hannah-hyj hannah-hyj requested a review from chunhtai July 7, 2023 01:16
Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment explaining the situation why this is needed

@hannah-hyj hannah-hyj added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 7, 2023
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 7, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented Jul 7, 2023

auto label is removed for flutter/flutter, pr: 130043, due to - The status or check suite Linux web_tests_5 has failed. Please fix the issues identified (or deflake) before re-applying this label.

@hannah-hyj hannah-hyj added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 7, 2023
@auto-submit auto-submit bot merged commit b80bbd5 into flutter:master Jul 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 8, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 8, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jul 8, 2023
flutter/flutter@d55a7d8...65ff3cb

2023-07-08 [email protected] Roll Flutter Engine from 69eb8275ce47 to 189f823e7b41 (1 revision) (flutter/flutter#130201)
2023-07-08 [email protected] Roll Flutter Engine from d5a35b4650b1 to 69eb8275ce47 (1 revision) (flutter/flutter#130199)
2023-07-08 [email protected] Roll Flutter Engine from 9006633571bb to d5a35b4650b1 (1 revision) (flutter/flutter#130197)
2023-07-08 [email protected] Roll Flutter Engine from 4ca619166c4a to 9006633571bb (2 revisions) (flutter/flutter#130195)
2023-07-08 [email protected] Roll Flutter Engine from 13d9d84e8aba to 4ca619166c4a (2 revisions) (flutter/flutter#130191)
2023-07-08 [email protected] Roll Flutter Engine from 40a8732a5de0 to 13d9d84e8aba (2 revisions) (flutter/flutter#130189)
2023-07-08 [email protected] fix: duplicated Intellij IDE message when running flutter doctor (flutter/flutter#129030)
2023-07-08 [email protected] Remove unneeded configuration file  (flutter/flutter#130183)
2023-07-08 [email protected] Roll Flutter Engine from 893ab3bf7bb9 to 40a8732a5de0 (1 revision) (flutter/flutter#130186)
2023-07-07 [email protected] Roll Flutter Engine from b39e6fe4b3bf to 893ab3bf7bb9 (1 revision) (flutter/flutter#130180)
2023-07-07 [email protected] Roll Flutter Engine from 7c83ea3e8542 to b39e6fe4b3bf (1 revision) (flutter/flutter#130176)
2023-07-07 [email protected] Add a threshold when comparing screen order for selectables. (flutter/flutter#130043)
2023-07-07 [email protected] Upgrade framework pub dependencies, roll engine with rolled dart sdk (flutter/flutter#130163)
2023-07-07 [email protected] Revert "[a11y] CupertinoSwitch On/Off labels" (flutter/flutter#130166)
2023-07-07 [email protected] Test that inspector does not hold objects. (flutter/flutter#130102)
2023-07-07 [email protected] Fix XCode download link (flutter/flutter#129795)
2023-07-07 [email protected] Roll Packages from 9bcf4bf to b61eea1 (1 revision) (flutter/flutter#130154)
2023-07-07 [email protected] (Raw)Autocomplete: Add optional [optionsViewOpenDirection] param (flutter/flutter#129802)
2023-07-07 [email protected] Tiny one space formatting fix (flutter/flutter#130053)
2023-07-07 [email protected] Roll Flutter Engine from 8aa2e6516af1 to 5ae09b8b4fa3 (7 revisions) (flutter/flutter#130150)
2023-07-07 [email protected] Add debugging for iOS startup test flakes (flutter/flutter#130099)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SelectionArea Didn’t Match The Expected Behavior with WidgetSpan

3 participants