There were several problems with the approach used in my first patch, so I abandoned it. The new patch changes the way
TreeView reacts on receiving the F6 or Tab key when no rows have focus/are selected yet. Instead of selecting the first row, the top visible row is focused, but not selected. This solves the problem described in the first comment and matches the behavior of Thunderbird 102 as far as the thread pane is concerned. Switching to the cards pane in the address book also only gives focus to the first card, not a selection. This seems to be handled differently in earlier Thunderbird ESRs.
What are these changes from an ARIA perspective? The guidelines seem to support this behavior, but I don't know if this is the way Thunderbird is supposed to work.