Skip to content
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

Enhance custom tree views #27823

Closed
6 tasks done
sandy081 opened this issue Jun 1, 2017 · 18 comments
Closed
6 tasks done

Enhance custom tree views #27823

sandy081 opened this issue Jun 1, 2017 · 18 comments
Assignees
Labels
feature-request Request for new features or functionality tree-views Extension tree view issues
Milestone

Comments

@sandy081 sandy081 self-assigned this Jun 1, 2017
@sandy081 sandy081 added tree-views Extension tree view issues feature-request Request for new features or functionality labels Jun 1, 2017
@sandy081 sandy081 added this to the June 2017 milestone Jun 1, 2017
@chrmarti
Copy link
Contributor

chrmarti commented Jun 5, 2017

I can register a command for selection changes and menus, but I don't see a way to register a command for the "open" mouse gesture (usually double-click). That would make sense to have.

@Thaina
Copy link

Thaina commented Jun 16, 2017

One of my case is cloudant design database. It is a json that contains javascript string

What is a plan if I want to make a tree of json and show js icon for a child that is javascript string?

@sandy081
Copy link
Member Author

@atian25 Thanks for pointing it out. Will update it.

@kubawolanin
Copy link

Hello,
Is it possible to provide icons from external URL? My extension calls an REST API for the items to be displayed in the TreeView. They come with svg icons and I thought it might be cool to have them.

I've tried to embed them inline with data:image/svg+xml; but with no luck.
Thank you for all the tremendous work!

@Chillee
Copy link

Chillee commented Jul 14, 2017

Is it possible to obtain the default vscode icons for the iconPath? I would prefer to be able to delegate the iconPath to the default icons instead of specifying one myself.

Ah nvm I see it was mentioned here: #26948 (comment)

@alefragnani
Copy link

Hi @sandy081 ,

I don't know if I'm missing something, but I didn't find a way to have direct access to the TreeItems, after they are created/provided using getChildren and getITreeItem.

I mean, let's suppose I need to add/remove a level 0 node. Instead of simply push/splice another TreeItem in the TreeDataSomething, I have to call onDidChangeTreeData(null) event and reload the entire tree. Similarly, if I need to *add/remove/rename a non level 0 node, I have to had backups of the TreeItem previously provided, search for them when I need to update their children, and to call onDidChangeTreeData(foundTreeItemNode) to update only their children.'

As I said, I don't know if I'm missing something. But if I am, could you please point me in the right direction? Otherwise, I thing that you could expand the API to scenarios like this.

Thanks for your help

@sandy081
Copy link
Member Author

@alefragnani Yes, It is PULL instead of PUSH. It is designed to register a data provider where the core can ask for data (similar to other providers in API). Regarding triggering changes, you do not need to have the back up of TreeItem but element of type T. If you do no want to store, you can always provide element of type string which you can resolve uniquely from your data model.

@alefragnani
Copy link

@sandy081, I understand (and agree) the decision to use a PULL design, but I expected to have a bit more APIs to access/look for the data already provided. Still, I also understand that this API is in early stages, just recently published, and the current issue exists for the exact purpose to enhance it 😄 .

I ended up adding a reference to my model inside the TreeItem, so I can look for it when the update events are triggered, by the model. The backup was limited only for the Level 0 nodes, because they are re-created only if I call onDidChangeTreeData with null as parameter.

I would like suggest a few enhancements:

  • Built-in commands to expand and collapse, located in the tree's title (like the one that already exists in explorer/find trees)
  • Built-in property/event to display a notification counter in the tree's title (like the Extension's panel)
  • Add an Secondary Command to TreeItem, which should be executed if you Ctrl + Click the node
  • Add an Secondary Command to TreeItem, which should be executed if you Double Click the node
  • Add a Hint to TreeItem

Thanks

@eamodio
Copy link
Contributor

eamodio commented Aug 30, 2017

I would add a few more to that list:

  • Provide an API to add a dynamic "secondary" name to a view
    • For example -- something like GitLens -- branches where GitLens is the name of the view, the -- is a vscode controlled separator (or unneeded if the styling or weight is different between the name and secondary name), and branches is a dynamic additional name for a view to provide more context
  • Support the navigation group for TreeItems -- so that they can have toolbar buttons (like search and source control viewlets)
  • Provide a way to set a decoration on a TreeItem -- like strike-through, etc
  • Provide a secondary icon (on the right) similar to the source control viewlet
  • Provide a way to support double-height TreeItems (similar to the way you can in the quickpicks)

I'm assuming that adding a Hint to TreeItem is about customizing the tooltip of a TreeItem -- if so 👍 otherwise, I would like to be able to customize the tooltip of a TreeItem 😄

Thanks for the consideration!

@weinand
Copy link
Contributor

weinand commented Nov 29, 2017

I suggest to add #33371, #30535, and #39340 to the list and give them high priority.
Without those fixes all the other other items are only "nice to haves".

@PrashanthCorp
Copy link

Does the ' Ability to update the view label' concern tree items? I'm currently looking at a way to update the Tree-Item label without having to fire refresh (to preserve the state of the Tree-Item's children). For example, this issue in the vscode-cosmosdb would be easily solved if this functionality was provided. :-)

@weinand
Copy link
Contributor

weinand commented Dec 12, 2017

Another high priority item is #40018

@mike-lischke
Copy link

mike-lischke commented Feb 6, 2018

I also have a number of things I'd like to see in a tree. Here's a list of items I mentioned already in #28338.

  • Not just a single icon per tree, but one for each node (just like the file tree has).
  • Colors for text; markdown support would be awesome.
  • Tooltips/hovers per node.
  • Read and set selection status (for multiple nodes) programmatically.
  • Check box support is also a pretty common requirement.
  • Multi column support! This content:

tokens

would then show much nicer. All the individual values nicely aligned.

  • Support docking, so that views can be spread accross all the available space. Currently I have 10 views stacked vertically. Even on a 4K screen this is all but easy to consume.

@d-akara
Copy link

d-akara commented Feb 6, 2018

@mike-lischke
In regards to

Support docking, so that views can be spread accross all the available space. Currently I have 10 views stacked vertically. Even on a 4K screen this is all but easy to consume.

There is another issue I don't see referenced here that I believe is same or related #41686

@sandy081
Copy link
Member Author

Closing this item as mentioned items in the description are done. I would request to create a separate issue for each of your feature requests or bugs as it is becoming very difficult to track in a single item. Thanks for understanding.

@mike-lischke
Copy link

mike-lischke commented Feb 14, 2018

@sandy081 I don't consider it as appropriated action on this issue to simply close it and have everyone do their own issue filing. It's a pretty nice collection of FRs all revolving around the same element and the issue itself started out as a collection of ideas/wishes. Usually I also prefer to separate issues, as it's just better to solve each of them. But this issue is more about development of a core element that needs consolidation of the individual requests. Of course each FR then has to go into its own Github issue, but a central collection/discussion issue is pretty useful too.

@sandy081
Copy link
Member Author

@mike-lischke The pain point here is that these feature requests are spread across multiple comments and its very hard to track them and to prioritise.

You are right that this issue was created initially to capture improvements to be done to custom views. But they are scoped to those listed in the summary. This could get easily side tracked by multiple feature requests in multiple comments. They are so important that I do not want to miss them.

Hence, I asked to create an issue per feature request. Hope it makes sense.

@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality tree-views Extension tree view issues
Projects
None yet
Development

No branches or pull requests