Align outline tree expand/collapse behaviors with VS Code

I’m looking at tackling issue #5876 and would appreciate some guidance on defining the solution.

I would like the same behavior in a custom tree widget and I could see future views potentially requiring this too. For that reason, I think a general solution would be a good choice. The outline tree could then use this general solution.

I see two potential solutions.

  1. Do as VS code does and add a new prop to TreeProps to enable/disable this new behavior in a TreeWidget. See VS code IAbstractTreeOptionsUpdate.
  2. Create a new class that extends TreeWidget by overriding just a few of the functions. Namely, doToggle, renderExpansionToggle, and handleClickEvent.

I have successfully implemented solution 2 locally, but feel solution 1 may be the better choice in terms of generality.

Which solution do you think makes the most sense? Is there an alternative solution that is better?

@scottaxcell thank you for the discussion and taking a shot at it :+1: you can directly comment on the issue so we can more easily track developments and discussions. If you are doing the 2nd option you can likely make the changes directly in the outline-view or outline-tree-model. Else, a more general solution like you referred to in 1 might be ideal.

@vince-fugnitto thanks for the feedback. I’ll be sure to move future discussion to the issue as you suggested.