Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,10 @@ class InspectorTreeController extends DisposableController
return true;
}
if (selectionLocal.parent != null) {
return setSelectedNode(selectionLocal.parent);
return setSelectedNode(
selectionLocal.parent,
notifyFlutterInspector: true,
);
}
return false;
},
Expand Down Expand Up @@ -399,8 +402,7 @@ class InspectorTreeController extends DisposableController
_numRows - 1,
),
)?.node;
setSelectedNode(nodeToSelect);
return true;
return setSelectedNode(nodeToSelect, notifyFlutterInspector: true);
},
);
}
Expand Down Expand Up @@ -573,7 +575,12 @@ class InspectorTreeController extends DisposableController
if (diagnostic != null && diagnostic.groupIsHidden) {
diagnostic.hideableGroupLeader?.toggleHiddenGroup();
}
expandPath(node);
// Intentionally do NOT call expandPath(node) here. User clicks happen on
// already-visible rows, so ancestors are already expanded; calling
// expandPath would also re-expand the clicked node itself, undoing any
// collapse the user just performed via the left arrow key. Programmatic
// selection paths (search, on-device pick) call expandPath themselves via
// [InspectorController.syncTreeSelection].
}

Rect getBoundingBox(InspectorTreeRow row) {
Expand Down Expand Up @@ -1142,8 +1149,12 @@ class _InspectorTreeState extends State<InspectorTree>
valueListenable: treeControllerLocal.rowsInTree,
builder: (context, rows, _) {
// Note: The inspector rows contain only the fake root node when the
// inspector tree is shutdown.
if (rows.length <= 1) {
// inspector tree is shutdown. Only show the loading indicator on the
// initial tree load (before [firstInspectorTreeLoadCompleted] is set);
// after that, a one-row tree is the legitimate result of the user
// collapsing all the way to the root via the keyboard, and we should
// render the tree (with its single row) rather than a spinner.
if (rows.length <= 1 && !controller.firstInspectorTreeLoadCompleted) {
// This works around a bug when Scrollbars are present on a short lived
// widget.
return const SizedBox(child: CenteredCircularProgressIndicator());
Expand Down
3 changes: 3 additions & 0 deletions packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ TODO: Remove this section if there are not any updates.

- Deleted the option to use the legacy inspector.
[#9782](https://github.com/flutter/devtools/pull/9782)
- Fixed an issue where navigating the Inspector widget tree with the keyboard arrow keys did not update the selected widget in the connected Flutter app. [#9810](https://github.com/flutter/devtools/pull/9810)
- Fixed an issue where clicking a widget row after collapsing a subtree with the left arrow key unexpectedly re-expanded the subtree. [#9810](https://github.com/flutter/devtools/pull/9810)
- Fixed an issue where collapsing the Inspector widget tree to a single row with the left arrow key caused a loading spinner to appear instead of showing the root node. [#9810](https://github.com/flutter/devtools/pull/9810)

## Performance updates

Expand Down
Loading
Loading