flutter / flutter/devtools

Scrolling for treetable needs position clamping to prevent overshooting

Open
#4,264 2 comments 0 reactions 0 assignees View on GitHub
P3 screen: app size
Dominant language
Dart
Stars
1.7k
Forks
404
Avg merge
6d 17h
Merged PRs (30d)
18

Description

https://github.com/flutter/devtools/pull/4226/files#diff-7f63e0b64be4d80b632e5eefe1cac93308dff718f53fc1fe6e1db774ffd4e7a9R198

Current Problem: When autoscrolling for the treetable, if the index is near the maxScrollingExtent, it will overshoot and therefore create a bouncing animation.

Solution: By clamping the position to be between 0.0 - maxScrollExtent, this will make sure the scroll will stay in the appropriate range. However, maxScrollExtent is not updating after parents are expanded and before scrolling happens. Therefore, if an index is greater than the previous maxScrollExtent even if it is in range after parents are expanded, it still believes that the index is not in range and therefore not scroll to the correct position.

Contributor guide

Open the contributing guide

Research direction

Start with the linked pull request diff, especially around line 198, and trace the treetable autoscrolling logic and its max scroll extent handling. Reproduce the near-end scrolling case and verify that scrolling stays within the valid range after expanding parents, using any nearby tests or existing treetable test entry points you find.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.