Consider alternative algorithm for selecting node after auto-refreshing the inspector tree
- Dominant language
- Dart
- Stars
- 1.7k
- Forks
- 404
- Avg merge
- 6d 17h
- Merged PRs (30d)
- 18
Description
Currently we walk up the tree from the previously selected node until we find the first unchanged ancestor. Then, we walk down the new tree from that ancestor until we find the first node matching the description of the previously selected node, or if we can't find any nodes matching the description, we select the first unchanged ancestor.
Instead, we could keep track of the path (as a linked list) from the previously selected node to the first unchanged ancestor, then use a variation of a path finding algorithm to walk down the path, including searching down paths where a node might have changed or been renamed. Note that this would be slightly less performant than the current approach.
Marking this as P3, can bump the priority if we decide this is a necessary improvement.
Contributor guide
Research direction
Start by tracing the inspector tree's auto-refresh selection logic and documenting how it currently walks to an unchanged ancestor and searches for a matching node. Compare that behavior with the proposed linked-list path search, including renamed or changed nodes; done means the selection behavior and performance trade-off are understood well enough to choose an approach.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- devtools
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100