Skip to content

Add CupertinoPicker ticking sound #170641

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
merged 6 commits into from
Jun 30, 2025
Merged

Conversation

alex-medinsh
Copy link
Contributor

@alex-medinsh alex-medinsh commented Jun 15, 2025

This PR adds a ticking sound to the CupertinoPicker on iOS.

Fixes #37329

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.

@github-actions github-actions bot added platform-ios iOS applications specifically framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine repository. See also e: labels. f: cupertino flutter/packages/flutter/cupertino repository platform-linux Building on or for Linux specifically a: desktop Running on desktop team-ios Owned by iOS platform team labels Jun 15, 2025
@alex-medinsh
Copy link
Contributor Author

I am not sure about tests on the platform side, I haven't found any existing sound or haptic tests for iOS for instance. Maybe I haven't looked hard enough :)

@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems platform-android Android applications specifically e: impeller Impeller rendering backend issues and features requests labels Jun 16, 2025
@github-actions github-actions bot removed a: text input Entering text in a text field or keyboard related problems platform-android Android applications specifically e: impeller Impeller rendering backend issues and features requests labels Jun 16, 2025
@alex-medinsh alex-medinsh marked this pull request as ready for review June 16, 2025 09:25
@alex-medinsh alex-medinsh requested a review from a team as a code owner June 16, 2025 09:25
@alex-medinsh
Copy link
Contributor Author

Compiling the engine was an adventure :)

@github-actions github-actions bot added the platform-android Android applications specifically label Jun 16, 2025
Copy link
Contributor

@camsim99 camsim99 left a comment

Choose a reason for hiding this comment

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

LGTM on Android since this is a no-op

Copy link

@dcq01 dcq01 left a comment

Choose a reason for hiding this comment

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

Hi! I'm a grad student working on a research project about using large language models to automate code review. Based on your commit 47cbed8 and the changes in engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformChannel.java, my tool generated this comment:

  1. Add a check at the beginning of the fromValue method to throw an IllegalArgumentException if encodedName is null.
  2. Ensure that the encodedName for TICK is defined somewhere in the codebase. If TICK does not have a corresponding encodedName, it could lead to issues when trying to retrieve it using the fromValue method.
  3. It is crucial to have unit tests that cover the new TICK value. Ensure that there are tests that validate the retrieval of TICK using the fromValue method, as well as tests that confirm the behavior when an invalid encodedName is provided.
  4. Ensure that the fromValue method correctly returns SoundType.TICK for the input "SystemSoundType.tick". Also, include tests to verify that it throws a NoSuchFieldException for invalid inputs.
  5. Add a test to verify that SoundType.TICK is present in the enum and has the correct associated string value.
  6. Add tests for edge cases, such as passing null or an empty string to the fromValue method, to ensure proper handling.
  7. The fromValue method iterates over all enum values to find a match. If SoundType is expected to grow significantly, consider using a Map<String, SoundType> to store the mappings of encoded names to enum values for O(1) lookup time. This would improve the efficiency of the fromValue method.

As part of my research, I'm trying to understand how useful these comments are in real-world development. If you have a moment, I'd be super grateful if you could quickly reply to these two yes/no questions:

  1. Does this comment provide suggestions from a dimension you hadn’t considered?
    1. Do you find this comment helpful?

Thanks a lot for your time and feedback! And sorry again if this message is a bother.

@dkwingsmt dkwingsmt self-requested a review June 25, 2025 18:22
@alex-medinsh
Copy link
Contributor Author

Hi @dcq01! Maybe the reviewers of this PR will have different opinions, but I usually don't feel that reviewing individual commits is particularly useful, since a commit (at least in my workflow) is not a self-contained piece of work. I usually expect reviews to work over the whole PR to see all changes in context of other changes.

As for the actual comments, I feel like for such a small change all the suggested tests are a bit overkill. Some of them (like 2 and 5) are strange, since I have never seen a test that tests if a member of an enum is in the enum. Overall, in my opinion, not that useful.

Copy link
Contributor

@dkwingsmt dkwingsmt left a comment

Choose a reason for hiding this comment

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

In general LGTM with some minor comments. Thank you for working on this!

@alex-medinsh alex-medinsh requested a review from a team as a code owner June 26, 2025 21:22
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 1, 2025
@alex-medinsh alex-medinsh deleted the picker_sound branch July 2, 2025 08:01
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: desktop Running on desktop engine flutter/engine repository. See also e: labels. f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels. platform-android Android applications specifically platform-ios iOS applications specifically platform-linux Building on or for Linux specifically platform-windows Building on or for Windows specifically team-android Owned by Android platform team team-ios Owned by iOS platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CupertinoPicker and CupertinoDatePicker don't play the ticker sound
6 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy