Skip to content
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

Ignore ios-unrelated test onDensityChange_shouldUpdateFlingBehavior #1826

Open
wants to merge 1 commit into
base: jb-main
Choose a base branch
from

Conversation

ASalavei
Copy link
Collaborator

@ASalavei ASalavei commented Feb 6, 2025

The test is not relevant for iOS because:

  • density not taken into account in CupertinoFlingBehaviour
  • on iOS, fling behavior does not change noticeably with changing views scale

Fixes https://youtrack.jetbrains.com/issue/CMP-7220/Fix-onDensityChangeshouldUpdateFlingBehavior-test

@ASalavei ASalavei requested a review from MatkovIvan February 6, 2025 10:06
Copy link
Member

@MatkovIvan MatkovIvan left a comment

Choose a reason for hiding this comment

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

on iOS, fling behavior does not change noticeably with changing views scale

It doesn't sounds like "be design" thing.

Not blocking. I'll look at datails of it after the vacation if it's won't be merged before that

@@ -2477,7 +2478,7 @@ class ScrollableTest {
}

@Test
@Ignore // TODO(https://youtrack.jetbrains.com/issue/CMP-7220) Fails on iOS
@IgnoreUIKitTarget // Density not taken into account in CupertinoFlingBehaviour
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't seem right to be dependent on compilation target here. As far as I remember CupertinoFlingBehaviour doesn't use platform API and might be reused in web for iOS for example.

Copy link
Collaborator Author

@ASalavei ASalavei Feb 6, 2025

Choose a reason for hiding this comment

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

The test was built around the DefaultFlingBehavior, but treated as a skiko scroll test. Considering that it was copy-pasted from Android tests, it looks like modifying it is not the goal of the ticket. In this case, ignoring it is the way to go.

Copy link
Member

Choose a reason for hiding this comment

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

Could you please clarify WHY CupertinoFlingBehaviour shouldn't take density into account?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

CupertinoFlingBehaviour uses own decay spec (see CupertinoScrollDecayAnimationSpec), which isn't relay on density - I didn't implement this algorithm, do I cannot be 100% sure.
As an assumptions - decelerations and bounces are derived from user interaction gestures, which are based on screen pixels by their nature. The number of pixels per second of the User's gesture will be the same, no matter which DP used, hence, decelerations also should be the the same. And this assumption was confirmed by my experiments with native iOS scrolls.
The only value that can be taken into account in current scenario is screen pixels density, but it's an another topic.

Copy link
Member

Choose a reason for hiding this comment

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

There are a few things that are kind of confusing/concerning:

  1. Ignoring test based on compilation target instead of testing different implementations by different tests. For example for the long term I expect reusing this implementation for Web on iOS devices.
  2. The fact that it's "by design" only for iOS. You reasoning is applicable on other platforms
  3. The fact that it's broken after AOSP merge and NOT by introducing this implementation in our fork in the first place. At least it means that current tests are checking what they are not supposed to

Currently I'm very sceptical that it should be done in this way. Let's hear some feedback from other teammates

Copy link
Collaborator Author

@ASalavei ASalavei Feb 11, 2025

Choose a reason for hiding this comment

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

I don't find any confuses. Currently, Cupertino is designed and implemented for iOS only. Moving to another platforms will require some adoption anyway.
You're right that the test is not testing what is should test. My point here is that the test should test the DefaultFlingBehavior, not the general fling.

@ASalavei ASalavei requested a review from MatkovIvan February 7, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants