-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[CupertinoActionSheet] Match colors to native #149568
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
Conversation
|
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. |
|
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 Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
Golden file changes are available for triage from new commit, Click here to view. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
chunhtai
left a comment
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
|
Golden file changes are available for triage from new commit, Click here to view. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
Golden file changes are available for triage from new commit, Click here to view. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
auto label is removed for flutter/flutter/149568, due to - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label. |
This reverts commit 32081aa.
|
PR to manual revert: #149998 |
…9998) This reverts commit 32081aa. Reason for revert: Appears to be failing tests in tree ``` 01:48 +2991 ~18: /Volumes/Work/s/w/ir/x/w/flutter/packages/flutter/test/cupertino/action_sheet_test.dart: Taps on a button can be slided to other buttons â��â��â�¡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â��â�� The following SkiaException was thrown while running async test code: Skia Gold received an unapproved image in post-submit testing. Golden file images in flutter/flutter are triaged in pre-submit during code review for the given PR. Visit https://flutter-gold.skia.org/ to view and approve the image(s), or revert the associated change. For more information, visit the wiki: https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package:flutter Debug information for Gold -------------------------------- stdout: Given image with hash 601f421e3bb643f437cc12395de96152 for test cupertino.cupertinoActionSheet.press-drag Expectation for test: ce8ef79c146857d162663b1161fd6d5c (positive) Expectation for test: 3bb57a8782f67836c6ad3ece7f00729a (positive) Expectation for test: 3f8c592774caf3c760fbbd318a7dc5af (positive) Expectation for test: 61863f38217aa3349c239eeb49b84930 (positive) Expectation for test: 98af16e9b7eb3fb810b44c74bb18ffb9 (positive) Untriaged or negative image: https://flutter-gold.skia.org//detail?grouping=name%3Dcupertino.cupertinoActionSheet.press-drag%26source_type%3Dflutter&digest=601f421e3bb643f437cc12395de96152 stderr: Test: cupertino.cupertinoActionSheet.press-drag FAIL result-state.json: No result file found. ```
flutter/flutter@fc19ecf...32081aa 2024-06-08 [email protected] [CupertinoActionSheet] Match colors to native (flutter/flutter#149568) 2024-06-08 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Flutter Engine from 1cdbebee1901 to 45cf05f7a580 (10 revisions) (#149944)" (flutter/flutter#149960) 2024-06-08 [email protected] Roll Flutter Engine from 1cdbebee1901 to 45cf05f7a580 (10 revisions) (flutter/flutter#149944) 2024-06-07 [email protected] Refactor `getRootWidgetSummaryTree` tests in `widget_inspector_test.dart` (flutter/flutter#149930) 2024-06-07 [email protected] Remove zanderso from TESTOWNERS (flutter/flutter#149935) 2024-06-07 [email protected] PinnedHeaderSliver (flutter/flutter#143196) 2024-06-07 [email protected] Fix test case in "getRootWidgetSummaryTree" test (flutter/flutter#149923) 2024-06-07 [email protected] Revert "Identify and re-throw our dependency checking errors in `flutter.groovy` (#149609)" (flutter/flutter#149918) 2024-06-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fix `SegmentedButton` clipping when drawing segments (#149739)" (flutter/flutter#149927) 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://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
…" (flutter#149998) This reverts commit 8b6be37.
) Relands #149568, which was reverted in #149998 due to unverified golden tests post-commit. (Honestly I don't know what happened but I guess resubmitting should resolve it.) No code is changed. ## 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]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat [Data Driven Fixes]: https://github.com/flutter/flutter/wiki/Data-driven-Fixes
…) (#150015)" (#150021) Reverts: #150015 Initiated by: vashworth Reason for reverting: Still failing tree on goldens Original PR Author: dkwingsmt Reviewed By: {chunhtai} This change reverts the following previous change: Relands #149568, which was reverted in #149998 due to unverified golden tests post-commit. (Honestly I don't know what happened but I guess resubmitting should resolve it.) No code is changed.
|
@dkwingsmt I have problems with the colors in dark mode, I suspect this PR has broken something. I see some colors are not resolved by |
Can you provide me with screenshots and code to reproduce? I might have used the wrong method to test. Edit: Actually this PR has been reverted and is not present in main. (Due to infra issues I can't merge it for a while.) So if you observed wrong colors in current main, it's the exact issue I'm trying to resolve. Can you test if Dark mode looks correct with this PR? |
|
Hi @dkwingsmt, I´m using this code to reproduce: This is where I use your PR using Dark Mode: This is running the latest master (still not correct, so maybe some other PR has broken this behavior): |
|
The first screenshot is exactly what I observed on an Xcode native app when the dark mode toggle on the status bar is on. Did I do it wrong? Can you show me what color it should be? |
|
Thanks you very much! Yeah I couldn't believe it either when I saw that the colors were the same in dark mode. I'll do more research (probably by running the native app on my phone). |
flutter#149568) (flutter#150015)" (flutter#150021)" This reverts commit 5eaeaca.
Relands #149568, which was reverted in #149998 due to unverified golden tests post-commit from recent infra issues. **New changes** (all contained in 5ca5139 ): * Fixes a problem within the tests "Overall looks correctly under x theme" where the button press is not applied to the golden file. * Dark theme now uses colors different from the light theme. It was an issue reported in #149568 (comment). I made the mistake because the XCode preview doesn't correctly apply dark theme, which made me think the dark theme uses the same colors. As shown in the following table, the dark theme colors also achieved deviation of <=1. <img width="1091" alt="image" src="https://github.com/flutter/flutter/assets/1596656/f4acda2b-1857-449c-8c1b-1f48afeb9095"> Screenshot comparison: (left to right: native, Flutter after PR, Flutter before PR) <img width="1286" alt="image" src="https://github.com/flutter/flutter/assets/1596656/580eef1f-a7f9-45d9-a7c8-fab0ca9606e3">
Relands flutter#149568, which was reverted in flutter#149998 due to unverified golden tests post-commit from recent infra issues. **New changes** (all contained in flutter@5ca5139 ): * Fixes a problem within the tests "Overall looks correctly under x theme" where the button press is not applied to the golden file. * Dark theme now uses colors different from the light theme. It was an issue reported in flutter#149568 (comment). I made the mistake because the XCode preview doesn't correctly apply dark theme, which made me think the dark theme uses the same colors. As shown in the following table, the dark theme colors also achieved deviation of <=1. <img width="1091" alt="image" src="https://github.com/flutter/flutter/assets/1596656/f4acda2b-1857-449c-8c1b-1f48afeb9095"> Screenshot comparison: (left to right: native, Flutter after PR, Flutter before PR) <img width="1286" alt="image" src="https://github.com/flutter/flutter/assets/1596656/580eef1f-a7f9-45d9-a7c8-fab0ca9606e3">
Relands flutter#149568, which was reverted in flutter#149998 due to unverified golden tests post-commit from recent infra issues. **New changes** (all contained in flutter@5ca5139 ): * Fixes a problem within the tests "Overall looks correctly under x theme" where the button press is not applied to the golden file. * Dark theme now uses colors different from the light theme. It was an issue reported in flutter#149568 (comment). I made the mistake because the XCode preview doesn't correctly apply dark theme, which made me think the dark theme uses the same colors. As shown in the following table, the dark theme colors also achieved deviation of <=1. <img width="1091" alt="image" src="https://github.com/flutter/flutter/assets/1596656/f4acda2b-1857-449c-8c1b-1f48afeb9095"> Screenshot comparison: (left to right: native, Flutter after PR, Flutter before PR) <img width="1286" alt="image" src="https://github.com/flutter/flutter/assets/1596656/580eef1f-a7f9-45d9-a7c8-fab0ca9606e3">
Relands #149568 (first attempt) or #150129 (latest attempt), which was reverted in #150142 due to unverified golden tests post-commit from recent infra issues. No code is changed from #150129. The relevant golden files have been resubmitted in #150219. I expect these files to appear in the golden file checker in this PR (which will hint that this PR is safe.) Fingers crossed.
…0386)" (#150413) Reverts: #150386 Initiated by: andrewkolos Reason for reverting: the Mac framework_tests_impeller check has been failing (due to golden test failures) since this PR (though it occasionally passes after retry). Taking a brief look at this PR, it looks like there's been some troubles with goldens in the past (though the recent failures appear very different to past ones). Regardless, I'm taking a shot at getting the tree green again by reverting this. Apologies i Original PR Author: dkwingsmt Reviewed By: {chunhtai} This change reverts the following previous change: Relands #149568 (first attempt) or #150129 (latest attempt), which was reverted in #150142 due to unverified golden tests post-commit from recent infra issues. No code is changed from #150129. The relevant golden files have been resubmitted in #150219. I expect these files to appear in the golden file checker in this PR (which will hint that this PR is safe.) Fingers crossed.
Relands #149568 (first attempt) or #150386 (latest attempt), which was reverted in #150413 due to a one-pixel difference on the debug banner (in the tilted border of the rotated text). This attempt removed the debug banner from tests (see 31cbcb1). <img width="949" alt="image" src="https://github.com/flutter/flutter/assets/1596656/78f26f72-b69f-41ee-9134-2e2a9e8e1bdd">
Relands flutter#149568 (first attempt) or flutter#150386 (latest attempt), which was reverted in flutter#150413 due to a one-pixel difference on the debug banner (in the tilted border of the rotated text). This attempt removed the debug banner from tests (see flutter@31cbcb1). <img width="949" alt="image" src="https://github.com/flutter/flutter/assets/1596656/78f26f72-b69f-41ee-9134-2e2a9e8e1bdd">
This PR matches the various colors of
CupertinoActionSheetmore closely with the native one.The following colors are changed.
The resulting colors match with native one with deviation of at most 1 (in terms of 0~255 RGB).
The following are comparison (left to right: Native, Flutter after PR, Flutter current)


Note: The divider thickness is adjusted to
1/dprinstead of 0.3 in both Flutter version to make them look more native, as will be proposed in #149636.Derivation
All the colors are derived through color picker and calculation. The algorithm is as followed:
xfor R, G, and B, with an alphaa.x_B1=0when the background is black, andx_B2=204when the background is white.x_t1when the background is black, andx_t2when the background is whitexandaThese equations use a linear model for color composition, which might not be exact, but is close enough for an accuracy of (1/255).
The full table is as follows:
During the calculation, I assumed these colors vary between light and dark modes, but it turns out that both modes use the same set of colors.
Screenshots
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.