Files
react-native-devtools-frontend/front_end/component_docs/elements_breadcrumbs
Jack Franklin 10071897de Fix conflicting scroll instructions in Breadcrumbs
The flakey tests on Windows exposed a bug where:

* We render and click the right button to scroll
* The code that ensures the active node is in view runs, and tries to
  scroll the active element into view.

These two actions would conflict with each other. On Linux/Mac and our Windows
bots, it seems the right scroll "wins" and the tests pass. However, on Windows
10 the right scroll is overriden by scrolling the active node into view, and
therefore the test fails.

The fix we landed on is to flag if the user has manually scrolled the
crumbs, and gate the scrolling active node into view logic on that. If
the user manually scrolls, we effectively cede control and let them
control the scrolling. When we get an update (e.g. a new active selected
node), we take back control.

Additionally, the resize observer was being far too aggressive in its behaviour
(just trigger a re-render), so that's been updated to check explicitly just if
the scroll buttons need to be hidden/shown after a render. This caused a bug
when running tests in Windows where it would also cause scroll conflicts. It's
not a bug I think users would ever have hit, but one that the tests hit because
they do things so much quicker than a user actually would (e.g. render + click
button in same frame). There are tests added for the resize observer behaviour.

Change-Id: Iedf4cbe5bef652d16fc80a0e7c0b3b45a95ebbfa
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2449984
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-10-06 15:17:10 +00:00
..