Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Scroll 75% of x, y on each list scroll increment #824

Merged
merged 1 commit into from
Nov 2, 2022
Merged

Conversation

cbracken
Copy link
Member

@cbracken cbracken commented Nov 2, 2022

The gallery driver test includes logic to scroll through various lists of demos in order to transition to each one. These lists include the horizontally-scrolling studies list at the top of the gallery home page, as well as the vertically-scrolling Material, Cupertino, and Other demo lists on the same page.

TestDriver.scrollUntilVisible scrolls a parent list widget in increments of dx and/or dy until the specified list item widget is visible. The Studies carousel list at the top of the gallery home screen has scroll physics that snap items to the starting edge of the widget. If the dx scroll distance is too small, the Studies list doesn't scroll far enough and snaps back to its original position. Conversely, if it scrolls too far, it may scroll one widget too far and snap the next widget into place. Instead, we now scroll 75% of the carousel width (empirically determined) as an attempt at a value in the Goldilocks Zone.

Related: #792
Related: flutter/flutter#111131

Issue: flutter/flutter#114025

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 the Flutter Style Guide recently, and have followed its advice.
  • 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.

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

The gallery driver test includes logic to scroll through various lists
of demos in order to transition to each one. These lists include the
horizontally-scrolling studies list at the top of the gallery home page,
as well as the vertically-scrolling Material, Cupertino, and Other
demo lists on the same page.

TestDriver.scrollUntilVisible scrolls a parent list widget in increments
of dx and/or dy until the specified list item widget is visible. The
Studies carousel list at the top of the gallery home screen has scroll
physics that snap items to the starting edge of the widget. If the dx
scroll distance is too small, the Studies list doesn't scroll far enough
and snaps back to its original position. Conversely, if it scrolls too
far, it may scroll one widget too far and snap the next widget into
place. Instead, we now scroll 75% of the carousel width (empirically
determined) as an attempt at a value in the Goldilocks Zone.

Related: #792
Related: flutter/flutter#111131

Issue: flutter/flutter#114025
Copy link
Member

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants