When looking at TreeView.selection , it seems that the tree view only keeps track of the selected items but not the focused one. For example, click on any item in the tree then using the arrow keys move up or down. The focused item has changed but there is no way to programmatically get it.

Here, selection ONLY contains MyFile3 and not MyFile1 even though it is focused.
This is annoying because we have a tree view of the project, where the user can delete, copy, paste etc. So it's expected that they be able to perform these actions on the focused item like in the explorer.
A bit similar to #157406 but this calls for the focused item (border but no highlight) to actually be accessible. If I had to amend the API, it would be focusedItem to separate it from selection.
When looking at
TreeView.selection, it seems that the tree view only keeps track of the selected items but not the focused one. For example, click on any item in the tree then using the arrow keys move up or down. The focused item has changed but there is no way to programmatically get it.Here,
selectionONLY containsMyFile3and notMyFile1even though it is focused.This is annoying because we have a tree view of the project, where the user can delete, copy, paste etc. So it's expected that they be able to perform these actions on the focused item like in the explorer.
A bit similar to #157406 but this calls for the focused item (border but no highlight) to actually be accessible. If I had to amend the API, it would be
focusedItemto separate it fromselection.