Make tree selection interactions more like label interactions

Issue #338 new
Robert Leach created an issue

USE CASE: WHAT DO YOU WANT TO DO?

Select more than one subtree in ways similar to selecting whole columns/rows using the labels. Also make the tree selections mirror the label selections (allow highlights of individual branches and select nodes of completely selected subtrees no matter where the selections were made.

STEPS TO REPRODUCE AN ISSUE (OR TRIGGER A NEW FEATURE)

  1. Open any cdt file
  2. Select/deselect multiple subtrees with (left-*) clicks, shift-clicks, command-clicks, option-clicks, click-drags, shift-click-drags, command-click-drags, and option-click-drags.
  3. Observe that every selected label is a part of a tree selection (including individual leaves) and that all completely selected subtree nodes are selected.

CURRENT BEHAVIOR

Only 1 entire subtree can be selected at one time with a single left click. No other selections in the labels or data are reflected. Individual leaves cannot be selected.

EXPECTED BEHAVIOR

Every selection in the matrix or labels should at least have a selected branch/leaf. Any subtrees that are completely selected in the data should be automatically selected. Users should be able to make selections in the tree the same way they make selections in the labels (e.g. (left-*) clicks, shift-clicks, command-clicks, option-clicks, click-drags, shift-click-drags, command-click-drags, and option-click-drags).

Here's how a left-*-click-drag should make selections. A click currently uses an x and y coordinate that reflect a matrix distance on a single axis and a correlation distance. The implementation of issue 323 has already changed single-click selections to always include the hovered column/row's leaf. As you hover up over that column, more and more parent subtrees are selected from the path from the hovered leaf up to the root. Click-drag selections should save the position of the first mousePressed event and perform the same logic starting from every leaf hovered across up to the last cursor position. It might also be good to draw a selection box frame which might help the user understand how it works.

Leaf or other single-branch selections should be selected up to the immediate parent. Note, some of the foundational work to make these things possible are already implemented in the branch for issue 323.

Modifier behaviors should follow the holistic modifier plan/cheat-sheet in issue #70.

DEVELOPERS ONLY SECTION

SUGGESTED CHANGE (Pseudocode optional)

The TRView and TreePainter code has already been changed to decide what hovered subtrees to include for the hovered cursor. All we have to do is save the cursor position on mousePressed and update the hover for all included subtrees in mouseMoved. Issue 323's implementation will already have enabled multiple tree selections.

FILES AFFECTED (where the changes will be implemented) - developers only

TRView TreePainter

LEVEL OF EFFORT - developers only

minor

COMMENTS

It's hard to describe the drag-selection behavior I'm proposing, but if you play with my current implementation of issue 323, I think you'll gain a better idea of what I mean. I had considered not selecting whole subtrees, but then I realized that users will be able to already do that by making selections in the labels. The tree selections should only be for selecting whole subtrees. Leaves and contained subtrees can be selected via labels.

Comments (8)

  1. Log in to comment