Skip to content

Conversation

@dkwingsmt
Copy link
Contributor

@dkwingsmt dkwingsmt commented Jun 1, 2024

This PR implements the CupertinoActionSheet part of #19786.

This PR creates a new kind of gesture "sliding tap", which can be a simple tap but also allows the user to slide to other buttons during the tap, and select the button that the slide ends in.

The following video shows the behavior on a button list (left to right: Native iOS, after PR, before PR):

Screen.Recording.2024-06-03.at.12.10.20.PM.mp4

Notice:

  1. When the tap starts on a button or on the content section, the gesture can slide into a button to highlight it or activate it.
  2. When the user performs a quick tap on a button, the button is immediately highlighted. (Before the PR, the highlight waits until the time out of a tap gesture, causing a quick tap to not highlight anything at all.)

The following video shows the behavior when the actions section scrolls (left to right: Native iOS, after PR)

Screen.Recording.2024-06-03.at.5.45.49.PM.mp4

Notice:

  1. Moving left or right doesn't cancel sliding tap, but moving vertically prioritizes the scrolling.
  2. Moving before the drag starts is also recognized as a sliding tap.

Also, multiple pointers interact with the button list following an algorithm of "using earliest pointer". I can't record videos about it but I've added unit tests.

Pre-launch Checklist

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

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: cupertino flutter/packages/flutter/cupertino repository f: gestures flutter/packages/flutter/gestures repository. labels Jun 1, 2024
@dkwingsmt dkwingsmt marked this pull request as ready for review June 3, 2024 18:49
@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #149471 at sha 489a9d0

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label Jun 3, 2024
@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #149471 at sha fe65d79

@github-actions github-actions bot removed the f: gestures flutter/packages/flutter/gestures repository. label Jun 4, 2024
@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #149471 at sha 26777e2

@dkwingsmt dkwingsmt requested a review from chunhtai June 4, 2024 02:39
@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #149471 at sha bb3e539

class _CupertinoActionSheetActionState extends State<CupertinoActionSheetAction>
implements _ActionSheetDragAvatar {
// |_ActionSheetDragAvatar|
@override
Copy link
Contributor

Choose a reason for hiding this comment

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

It is unfortunate we need to split the background from this widget...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I wish we didn't have to.

The problem with this separation actually comes from the cancel button. Our current sample code uses the same CupertinoActionSheetAction for the cancel button, but the cancel button uses a different background color. To make CupertinoActionSheetAction paint its own background, it has to at least receive a .isCancel = true property, or somehow receive an inherited data from the parent to know that it's a cancel button (which is even uglier).

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #149471 at sha ede852b

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 7, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 7, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 7, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 7, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 7, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 7, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jun 7, 2024
Manual roll Flutter from 4608a89 to fc19ecf (38 revisions)

Manual roll requested by [email protected]

flutter/flutter@4608a89...fc19ecf

2024-06-07 [email protected] Fix `SegmentedButton` clipping when drawing segments (flutter/flutter#149739)
2024-06-07 [email protected] Shift consistently passing tests on mokey to prod (flutter/flutter#149902)
2024-06-07 [email protected] Prepare images for tests individually to enable clean up of cache. (flutter/flutter#149693)
2024-06-07 [email protected] Roll Packages from 586faa6 to 8a2c4e4 (8 revisions) (flutter/flutter#149900)
2024-06-07 [email protected] Roll Flutter Engine from 98e9393bf2e9 to 1cdbebee1901 (4 revisions) (flutter/flutter#149899)
2024-06-07 [email protected] Roll Flutter Engine from 087feab9922b to 98e9393bf2e9 (1 revision) (flutter/flutter#149875)
2024-06-07 [email protected] Refactor `widget_inspector_test.dart` (flutter/flutter#149850)
2024-06-07 [email protected] Add test for dropdown_menu.1.dart (flutter/flutter#149547)
2024-06-07 [email protected] Add test for standard_fab_location.0.dart (flutter/flutter#149225)
2024-06-07 [email protected] [native_assets] Fix framework name deduplication (flutter/flutter#149761)
2024-06-07 [email protected] Roll Flutter Engine from 47b15dfba1da to 087feab9922b (1 revision) (flutter/flutter#149871)
2024-06-07 [email protected] Roll Flutter Engine from 5d5e0ee9102c to 47b15dfba1da (2 revisions) (flutter/flutter#149870)
2024-06-07 [email protected] Roll Flutter Engine from fea8e51b0280 to 5d5e0ee9102c (2 revisions) (flutter/flutter#149867)
2024-06-07 [email protected] Roll Flutter Engine from 5a0a49939c64 to fea8e51b0280 (2 revisions) (flutter/flutter#149865)
2024-06-07 [email protected] Roll pub packages (flutter/flutter#149864)
2024-06-06 [email protected] Roll Flutter Engine from bf1a4877da0b to 5a0a49939c64 (1 revision) (flutter/flutter#149861)
2024-06-06 [email protected] Remove some vestigial /*!*/ comments (flutter/flutter#149361)
2024-06-06 [email protected] Attempt to fix some web test flakiness. (flutter/flutter#149828)
2024-06-06 [email protected] Remove abi key permanently from golden file testing (flutter/flutter#149858)
2024-06-06 [email protected] [CupertinoActionSheet] Add sliding tap gesture (flutter/flutter#149471)
2024-06-06 [email protected] Roll pub packages (flutter/flutter#149852)
2024-06-06 [email protected] SliverResizingHeader (flutter/flutter#143325)
2024-06-06 [email protected] Run tests on macOS 13 or 14 (flutter/flutter#149827)
2024-06-06 [email protected] Fix leaky test. (flutter/flutter#149823)
2024-06-06 [email protected] Roll Flutter Engine from 31804a222f97 to bf1a4877da0b (3 revisions) (flutter/flutter#149848)
2024-06-06 [email protected] Add support for setting the heading level for web semantics (#97894) (flutter/flutter#125771)
2024-06-06 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Introduce `ChipAnimationStyle` to override default chips animations durations (#149245)" (flutter/flutter#149847)
2024-06-06 [email protected] 3.22.2 release notes (flutter/flutter#149818)
2024-06-06 [email protected] Roll Flutter Engine from 25bcbb888939 to 31804a222f97 (3 revisions) (flutter/flutter#149837)
2024-06-06 [email protected] Introduce `ChipAnimationStyle` to override default chips animations durations (flutter/flutter#149245)
2024-06-06 [email protected] Roll Flutter Engine from f5a9690c6061 to 25bcbb888939 (1 revision) (flutter/flutter#149835)
2024-06-06 [email protected] Fix leaky test. (flutter/flutter#149822)
2024-06-06 [email protected] Unpin archive package from tool, update to version without security advisories (flutter/flutter#149430)
2024-06-06 [email protected] Roll pub packages (flutter/flutter#149630)
2024-06-06 [email protected] Roll Flutter Engine from d9684a37af06 to f5a9690c6061 (7 revisions) (flutter/flutter#149832)
2024-06-06 [email protected] Roll Packages from 11e192a to 586faa6 (13 revisions) (flutter/flutter#149820)
2024-06-06 [email protected] Fix some links in the "Handling breaking change" section (flutter/flutter#149821)
2024-06-06 [email protected] Roll Flutter Engine from 92d0cd9370f7 to d9684a37af06 (1 revision) (flutter/flutter#149793)

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.
...
dkwingsmt added a commit that referenced this pull request Jun 12, 2024
auto-submit bot pushed a commit that referenced this pull request Jun 13, 2024
Reverts #149471. I will reland it without changes in the future.

There have been CI post-submit errors reported, such as #150142, that the two golden files introduced in #149471 were untriaged. The only explanation I can think of is that #149471 being merged during the infra P0 left some inconsistency in the golden database.
victorsanni pushed a commit to victorsanni/flutter that referenced this pull request Jun 14, 2024
Reverts flutter#149471. I will reland it without changes in the future.

There have been CI post-submit errors reported, such as flutter#150142, that the two golden files introduced in flutter#149471 were untriaged. The only explanation I can think of is that flutter#149471 being merged during the infra P0 left some inconsistency in the golden database.
victorsanni pushed a commit to victorsanni/flutter that referenced this pull request Jun 14, 2024
Reverts flutter#149471. I will reland it without changes in the future.

There have been CI post-submit errors reported, such as flutter#150142, that the two golden files introduced in flutter#149471 were untriaged. The only explanation I can think of is that flutter#149471 being merged during the infra P0 left some inconsistency in the golden database.
auto-submit bot pushed a commit that referenced this pull request Jun 17, 2024
Relands #149471. 

As explained in #150147, the original PR was reverted in an attempt to fix the strange golden file failure that occurred in other PRs.

The following code is changed:
* The two tests that contain golden tests are changed so that, they used to slide from button 1 to button 2, now they slide from button 2 to button 1. This is to ensure the golden file record are updated.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 6, 2024
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 f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels. will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants