BUGFIX: fix hover on toggle icon not changing color to blue, add hove… #3619
+49
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did
Problem 1: Hover States
Looking at the CSS it looks as if the toggle button of a node in the Content and Page NodeTrees is supposed to change their color to blue when hovering over them.
While at it I also replicated the behavior from the top left burger menu. The Label and the icon now appear blue when they are either hovered over or selected (While selected the grey Background is still present).
Problem 2: Collapsing all children
Since I am new to Reselect I wasn't able to create a new selector to get all descendants of a node. Also I didn't want to break anything accidentally. Instead I added the function to optionally collapse the children of a node by shift-clicking the toggle icon of a node.
Problem 3: Make it easier to drop a node into a dropTarget
How I did it
Problem 1: Hover States
Problem 2: Collapsing all children
The toggle action now has more arguments
collapseChildren: boolean
true if the shift key is pressed on the click eventchildrenContextPaths: NodeContextPath[]
the context paths of all children of the clicked nodechildrenCollapsedByDefault: boolean
To integrate a simple collapse all button the toggle buttons could be selected and the click events could be fired including the shiftKey event via simple JS. I wonder if a solution like this would be up to the standards? Since the redux actions would be fired, I don't think it would create any unwanted side effects.
Problem 3: Make it easier to drop a node into a dropTarget
I added extra height to the dropTarget but only after a node is already being dragged.
How to verify it
Before: No hover effects
After:
New Hover Effects and collapsing children nodes in action: