Skip to content

🎨: fix cupertionActionSheet design #134345

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

Merged

Conversation

Anishishi
Copy link
Contributor

@Anishishi Anishishi commented Sep 9, 2023

Overview

Fixed the implementation of CupertionActionSheet based on Apple Design Resource.
I also deleted devicePixelRatio because Flutter uses logical pixels based on https://api.flutter.dev/flutter/dart-ui/FlutterView/devicePixelRatio.html.

ISSUE: #134539

UPDATED GOLDEN: https://flutter-gold.skia.org/search?issue=134345&crs=github&patchsets=3&corpus=flutter

Before

After

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.

@google-cla
Copy link

google-cla bot commented Sep 9, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: cupertino flutter/packages/flutter/cupertino repository labels Sep 9, 2023
@Anishishi Anishishi changed the title fix cupertionActionSheet design 🎨: fix cupertionActionSheet design Sep 9, 2023
@Anishishi Anishishi marked this pull request as ready for review September 9, 2023 14:25
@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 Hixie or stuartmorgan on 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.

@MitchellGoodwin
Copy link
Contributor

@Anishishi Thank you for putting this together. Would you mind creating an issue for this if one doesn't already exist? It helps track the work being done, especially in a case like this were we are matching a design.

@Anishishi
Copy link
Contributor Author

Anishishi commented Sep 12, 2023

@MitchellGoodwin
Thanks for letting me know. I have created this issue, #134539, and updated the PR description to contain that issue.

Copy link
Contributor

@MitchellGoodwin MitchellGoodwin left a comment

Choose a reason for hiding this comment

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

Thank you for putting this together and filling that issue. It looks like some of the framework tests are failing on the PR. Do they pass locally?

Also, how did you check to see if the values you used match the native view? Did you use the widget comparison tool, or something else?

https://github.com/flutter/platform_tests/tree/master/ios_widget_catalog_compare

@Anishishi Anishishi changed the title 🎨: fix cupertionActionSheet design WIP: 🎨: fix cupertionActionSheet design Sep 13, 2023
@Anishishi Anishishi changed the title WIP: 🎨: fix cupertionActionSheet design [WIP] 🎨: fix cupertionActionSheet design Sep 13, 2023
@Anishishi Anishishi marked this pull request as draft September 16, 2023 02:33
@flutter-dashboard
Copy link

This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again.

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.

@Anishishi Anishishi marked this pull request as ready for review September 16, 2023 03:15
@Anishishi
Copy link
Contributor Author

Anishishi commented Sep 16, 2023

Thanks for the review. I have reflected some modifications.

About test cases.
I think some tests are failing because I have changed the UI and it is failing some golden tests. I think this is because if you triage the golden test, the test will pass, is my understanding correct?
The tests in test/cupertino/dialog_test.dart are successful except for the golden test as follows.

nishiyamaakiranin ~/cloned/flutter/packages/flutter [fix-cupertion-action-sheet-design] $ flutter test test/cupertino/dialog_test.dart
00:02 +28: Material2 - Default cupertino dialog golden                                                                                                                                 
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following assertion was thrown while running async test code:
Golden "cupertino.m2_dialog_test.cupertino.default.png": Pixel test failed, 0.17% diff detected.
Failure feedback can be found at
/Users/nishiyamaakiranin/cloned/flutter/bin/cache/pkg/skia_goldens/packages/flutter/test/cupertino/failures

When the exception was thrown, this was the stack:
#0      FlutterLocalFileComparator.compare (package:flutter_goldens/flutter_goldens.dart:543:5)
<asynchronous suspension>
#1      MatchesGoldenFile.matchAsync.<anonymous closure> (package:flutter_test/src/_matchers_io.dart:118:32)
<asynchronous suspension>
<asynchronous suspension>
(elided one frame from dart:async)

The exception was caught asynchronously.
════════════════════════════════════════════════════════════════════════════════════════════════════
00:02 +28 -1: Material2 - Default cupertino dialog golden [E]                                                                                                                          
  Test failed. See exception logs above.
  The test description was: Material2 - Default cupertino dialog golden
  

To run this test again: /Users/nishiyamaakiranin/cloned/flutter/bin/cache/dart-sdk/bin/dart test /Users/nishiyamaakiranin/cloned/flutter/packages/flutter/test/cupertino/dialog_test.dart -p vm --plain-name 'Material2 - Default cupertino dialog golden'
00:03 +28 -1: Material3 - Default cupertino dialog golden                                                                                                                              
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following assertion was thrown while running async test code:
Golden "cupertino.m3_dialog_test.cupertino.default.png": Pixel test failed, 0.17% diff detected.
Failure feedback can be found at
/Users/nishiyamaakiranin/cloned/flutter/bin/cache/pkg/skia_goldens/packages/flutter/test/cupertino/failures

When the exception was thrown, this was the stack:
#0      FlutterLocalFileComparator.compare (package:flutter_goldens/flutter_goldens.dart:543:5)
<asynchronous suspension>
#1      MatchesGoldenFile.matchAsync.<anonymous closure> (package:flutter_test/src/_matchers_io.dart:118:32)
<asynchronous suspension>
<asynchronous suspension>
(elided one frame from dart:async)

The exception was caught asynchronously.
════════════════════════════════════════════════════════════════════════════════════════════════════
00:03 +28 -2: Material3 - Default cupertino dialog golden [E]                                                                                                                          
  Test failed. See exception logs above.
  The test description was: Material3 - Default cupertino dialog golden
  

To run this test again: /Users/nishiyamaakiranin/cloned/flutter/bin/cache/dart-sdk/bin/dart test /Users/nishiyamaakiranin/cloned/flutter/packages/flutter/test/cupertino/dialog_test.dart -p vm --plain-name 'Material3 - Default cupertino dialog golden'
00:03 +41 -2: Some tests failed.

Regarding checking that the values are the same as the native view display.
I have not overlayed on the native component to compare. I just reflected the Figma values like this.
スクリーンショット 2023-09-16 12 18 00

@MitchellGoodwin
Copy link
Contributor

Figma works great, thank you.

For the tests, you're right about the golden files tests, but the tests I was looking at were in action_sheet_test.dart. It looks like some tests that checked widget sizes without golden files in there were affected by these changes.

For example:

The following TestFailure was thrown running a test:
Expected: 84.33333333333337 (±1e-10)
  Actual: <84.30000000000001>
   Which: 84.30000000000001 is not in the range of 84.33333333333337 (±1e-10).

When the exception was thrown, this was the stack:
#4      main.<anonymous closure> (file:///b/s/w/ir/x/w/flutter/packages/flutter/test/cupertino/action_sheet_test.dart:692:5)

@Anishishi Anishishi changed the title [WIP] 🎨: fix cupertionActionSheet design 🎨: fix cupertionActionSheet design Sep 20, 2023
@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 #134345 at sha 6e2209b

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label Sep 20, 2023
@Anishishi
Copy link
Contributor Author

Thanks for pointing out the missing test fix.
I have corrected the test in action_sheet_test.dart.

Copy link
Contributor

@MitchellGoodwin MitchellGoodwin left a comment

Choose a reason for hiding this comment

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

Tentatively LGTM. This seems to at least partially addresses #43495 as well. I'm investigating whether there's an easy value that could be plugged into this PR to fully fix that issue as well, or if that should be solved elsewhere.

@MitchellGoodwin
Copy link
Contributor

@Anishishi apologies for letting this sit for so long. It doesn't look like there's an easy fix for the other issue with this, so that will still be it's own work. Would you be able to rebase and resolve the conflicts?

@Anishishi
Copy link
Contributor Author

@MitchellGoodwin
Thank you for your reply. I have resolved the conflicts.Thank you for the review!

Copy link
Contributor

@MitchellGoodwin MitchellGoodwin left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for putting this together. I'm going to see about getting a second review.

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@gspencergoog gspencergoog added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 14, 2023
@auto-submit auto-submit bot merged commit f8ddd4b into flutter:master Dec 14, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 15, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 15, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 15, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 15, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 15, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Dec 15, 2023
flutter/flutter@a51e33a...2407f69

2023-12-15 58529443+srujzs@users.noreply.github.com Move package:web dependency to dev dependency (flutter/flutter#139696)
2023-12-15 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9524a185b055 to 986a6fe198dc (1 revision) (flutter/flutter#140221)
2023-12-15 engine-flutter-autoroll@skia.org Roll Packages from 1151191 to 3f2e16b (9 revisions) (flutter/flutter#140218)
2023-12-15 engine-flutter-autoroll@skia.org Roll Flutter Engine from 7a50221733c2 to 9524a185b055 (1 revision) (flutter/flutter#140217)
2023-12-15 engine-flutter-autoroll@skia.org Roll Flutter Engine from 767223f7a4f8 to 7a50221733c2 (1 revision) (flutter/flutter#140216)
2023-12-15 engine-flutter-autoroll@skia.org Roll Flutter Engine from 91f65eea0c11 to 767223f7a4f8 (1 revision) (flutter/flutter#140210)
2023-12-15 engine-flutter-autoroll@skia.org Roll Flutter Engine from a47da28c9a62 to 91f65eea0c11 (1 revision) (flutter/flutter#140207)
2023-12-15 engine-flutter-autoroll@skia.org Roll Flutter Engine from cde1a596432d to a47da28c9a62 (1 revision) (flutter/flutter#140204)
2023-12-15 engine-flutter-autoroll@skia.org Roll Flutter Engine from 46ff5c08a905 to cde1a596432d (1 revision) (flutter/flutter#140200)
2023-12-15 engine-flutter-autoroll@skia.org Roll Flutter Engine from a17bb0a63b7e to 46ff5c08a905 (1 revision) (flutter/flutter#140198)
2023-12-15 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4cb3ba7a85f6 to a17bb0a63b7e (1 revision) (flutter/flutter#140196)
2023-12-15 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0e7248d43251 to 4cb3ba7a85f6 (14 revisions) (flutter/flutter#140195)
2023-12-15 polinach@google.com Increase versions of leak tracker libraries. (flutter/flutter#140018)
2023-12-15 magder@google.com Set compile test iOS app target version to not embed Swift runtime (flutter/flutter#140188)
2023-12-15 58190796+MitchellGoodwin@users.noreply.github.com Cupertino text clear label (flutter/flutter#129727)
2023-12-15 xilaizhang@google.com [github actions] use token from real user flutter mirror bot  (flutter/flutter#140191)
2023-12-15 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Flutter Engine from 0e7248d43251 to 0b0fab821536 (4 revisions)" (flutter/flutter#140194)
2023-12-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0e7248d43251 to 0b0fab821536 (4 revisions) (flutter/flutter#140180)
2023-12-14 lsaudon@gmail.com feat: Add onTapAlwaysCalled in TextFormField (flutter/flutter#140089)
2023-12-14 49699333+dependabot[bot]@users.noreply.github.com Bump actions/upload-artifact from 3.1.3 to 4.0.0 (flutter/flutter#140177)
2023-12-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2140942444ea to 0e7248d43251 (2 revisions) (flutter/flutter#140176)
2023-12-14 ybz975218925@gmail.com fix reorderable_list drop animation (flutter/flutter#139362)
2023-12-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from 997d3dfa1e74 to 2140942444ea (4 revisions) (flutter/flutter#140171)
2023-12-14 38147403+sharmashashi@users.noreply.github.com Fix BottomNavigationBarItem label overflow (flutter/flutter#120206)
2023-12-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from a565cea256c7 to 997d3dfa1e74 (2 revisions) (flutter/flutter#140170)
2023-12-14 chingjun@google.com Revert "Dynamic view sizing" (flutter/flutter#140165)
2023-12-14 aki.nishi.work@gmail.com �: fix cupertionActionSheet design (flutter/flutter#134345)
2023-12-14 104349824+huycozy@users.noreply.github.com Make improvements to existing new issue templates  (flutter/flutter#140142)
2023-12-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from caf33276468b to a565cea256c7 (1 revision) (flutter/flutter#140163)
2023-12-14 parlough@gmail.com Expand and update a few release.yml categories (flutter/flutter#140120)

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 dit@google.com,rmistry@google.com,stuartmorgan@google.com 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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 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.

3 participants