Skip to content

Add a scrollbar for horizontal scrolling of source files in the debugger - #3262

Merged
elliette merged 28 commits into
flutter:masterfrom
elliette:starter-bug
Aug 23, 2021
Merged

elliette merged 28 commits into
flutter:masterfrom
elliette:starter-bug

Conversation

@elliette

@elliette elliette commented Aug 11, 2021 •

Copy link
Copy Markdown
Member

Demo:

working_scrollbar

@elliette
elliette marked this pull request as ready for review August 11, 2021 17:38
@elliette

Copy link
Copy Markdown
Member Author

Not sure which test I should modify for this change. I was thinking maybe /integration_tests/debugger.dart, and checking if the scrollbar is visible on a wide file?

@elliette
elliette requested a review from kenzieschmoll August 11, 2021 17:46
Comment thread packages/devtools_app/lib/src/debugger/codeview.dart Outdated
Comment thread packages/devtools_app/lib/src/debugger/codeview.dart Outdated
Comment thread packages/devtools_app/lib/src/debugger/codeview.dart
Comment thread packages/devtools_app/lib/src/debugger/codeview.dart Outdated
Comment thread packages/devtools_app/lib/src/debugger/codeview.dart Outdated
Comment thread packages/devtools_app/lib/src/debugger/codeview.dart Outdated
controller: textController,
// Only listen for vertical scroll notifications (ignore those
// from the nested horizontal SingleChildScrollView):
notificationPredicate: (ScrollNotification notification) =>

@xu-baolin xu-baolin Aug 12, 2021 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should use notification.depth to predicate, otherwise, all the descendants of Scrollables with vertical axis will interfere.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, changed to use notificationDepth.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

are we sure this notificationPredicate is needed? If it is needed, there are likely multiple other places in the UI where we need notificationPredicates. I thought it wasn't needed as we explicitly specify the scrollController.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The notificationPredicate is needed, otherwise the vertical scrollbar responds to horizontal scroll events (and shows up at the bottom along with the horizontal scrollbar, see image). I'm guessing scrollbars in other parts of the UI would be similarly broken if this was needed for them?

image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hi @xu-baolin! I see you added the notificationPredicate 😄 Could you clarify what the purpose of the notificationPredicate is vs. the scrollController? Is the scrollController no longer used? Thanks!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok I will check that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Piinks Hey, what are your thoughts on this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh this may already be fixed, we noticed this recently in flutter/flutter#87697.
The scrollbar uses the scroll controller but also listens and responds to scroll events. This is useful like in this 2D case where the scrollbars might want to know about both axes and respond when either one scrolls. They just aren't behaving correctly here, should be fixed by flutter/flutter#87698.

Comment thread packages/devtools_app/lib/src/debugger/codeview.dart
Comment thread packages/devtools_app/lib/src/debugger/codeview.dart
Comment thread packages/devtools_app/lib/src/debugger/codeview.dart Outdated
Comment thread packages/devtools_app/lib/src/debugger/codeview.dart Outdated
Comment thread packages/devtools_app/lib/src/debugger/codeview.dart Outdated
Comment thread packages/devtools_app/lib/src/ui/utils.dart Outdated
@jacob314

Copy link
Copy Markdown
Contributor

lgtm

@jacob314 jacob314 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm_dog2

@xu-baolin

Copy link
Copy Markdown
Member

Nice job!
I have posted a similar issue #2254 a year ago.

@elliette
elliette merged commit 15fae46 into flutter:master Aug 23, 2021
@elliette
elliette deleted the starter-bug branch December 24, 2021 00:24
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.

5 participants