Here's some basic HTML tree:
<ol>
<li>First item. No descendants <button>Menu</button></li>
<li>
Second item with sub-items <button>Menu</button>
<ol>
<li>Second item, first sub-item <button>Menu</button></li>
<li>Second item, second sub-item <button>Menu</button></li>
<li>Second item, third sub-item <button>Menu</button></li>
</ol>
</li>
<li>Third (no descendants) item <button>Menu</button></li>
</ol>
It's currently missing any accessibility-related attributes, but it's not the point.
On this page there's a list of required keyboard interactions for a tree list, however, I don't see there how I should handle (if I should at all) additional interactive items' controls, which are part of every (or at least some) tree items.
To be more specific, it's a pretty common situation to have a "Menu" button to the right of every file/folder name in a file tree to be able to perform some operations on these files/folders (e.g. copying and deleting). However, ARIA basically says the following: if an item is focused, then Left/Right arrows navigate the items horizontally, and Up/Down arrows navigate it vertically. Also, the Tab (or Shift+Tab) combinations are reserved for leaving the tree to either direction.
So, the question is: if that's even permitted to have in items something other than just their label, and especially to have interactive controls like buttons, then how should they (if at all) recieve focus when the user is using the keyboard for interaction?
It isn't explicitly written anywhere, but a tree item, tree node or more simply node can be anything beyond a simple selectable item. It can be a button, a checkbox, or whatever else reasonably imaginable.
Once the item is selected, the keyboard interaction you should make depends on the nature of the element. For example:
<select>
like element, use Alt+Down arrow to open it, and once it is open, handle it as another selection / combo box; close it with Alt+Up arrow or once a choice is confirmed with enter, at which point you come back to the tree keyboard navigation logic. You may also simply use space to select the next choice.And so on, this isn't an exhaustive list.
As a bonus, you can handle navigation by typing the first letters of item labels. It's especially useful is the tree is large.