-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TreeView refresh
Is Broken When Nodes Are Reparented
#12111
Comments
The trouble arises from the fact that the tree infrastructure assumes that a node with a certain ID can only exist once inside the tree. That is true most of the time, but for example when we create a |
That leads to a bunch of followup questions: are selections made up of domain objects or tree nodes? For "focus" it's pretty clear it has to be tree nodes, because if we should the same domain object twice, we still want keyboard actions to only work on one node. |
I also think separating the domain layer from the tree layer would reduce our use of inheritance in favor of composition. For example, we have |
Something tells me working with VS Code's TreeView API has given you ideas :) I'd be curious to understand what is required from trees in Theia compared to what an API like VS Code proposes. I am all for a composable tree widget implementation: Behavior should be contributed via objects we pass when creating the tree, such as some |
Well, those ideas are actually 20 years old 🤷, straight from good old Eclipse. Where do you think the VS Code folks got it from? What I did notice is that there seems to be a lot of complexity around trees which might not be necessary. |
Also related to refresh behaviour (not getting rid of stale nodes): #10404 |
Agreed, I've seen a fair amount of people grind their teeth against Theia's trees. I struggle with the API too to be honest. |
- Since our front end tree is not safe for reparenting nodes, use the path of tree item ids as the tree node id. - Rename TreeViewExt.getTreeItem to getElement, since that is what it does. Contributed on behalf of ST Microelectronics Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
- Since our front end tree is not safe for reparenting nodes, use the path of tree item ids as the tree node id. - Rename TreeViewExt.getTreeItem to getElement, since that is what it does. Contributed on behalf of ST Microelectronics Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
Use tree item path for tree node id. Fixes #12111 - Since our front end tree is not safe for reparenting nodes, use the path of tree item ids as the tree node id. - Rename TreeViewExt.getTreeItem to getElement, since that is what it does. Contributed on behalf of ST Microelectronics Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
Use tree item path for tree node id. Fixes #12111 - Since our front end tree is not safe for reparenting nodes, use the path of tree item ids as the tree node id. - Rename TreeViewExt.getTreeItem to getElement, since that is what it does. Contributed on behalf of ST Microelectronics Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
Bug Description:
The refresh in TreeView contributed by extensions is broken in the case of node being reparented. In order to reproduce this, you can use the test extension attached to #12088
Steps to Reproduce:
Additional Information
The text was updated successfully, but these errors were encountered: