lime-qml icon indicating copy to clipboard operation
lime-qml copied to clipboard

WIP: Sidebar

Open ricochet1k opened this issue 8 years ago • 6 comments

This is just a work-in-progress to track the sidebar.

The sidebar here is pretty generic. It should be pretty easy to refactor this code to support multiple sidebars with different kinds of items from different sources.

Here's what's left to be done:

  • [x] Use project folder list
  • [x] Filter files by include/exclude globs
  • [ ] Move filesystem sidebar stuff to backend
  • [ ] Handle clicking on files: open them!
  • [x] Top level should be children of roots, not roots themselves

As far as moving things to backend, I'm thinking the only thing that should be moved to the backend is https://github.com/limetext/lime-qml/blob/sidebar/main/fstreeitem.go, but I'm not yet sure that the interface it uses is complete enough to be used in the backend. Moving the tree flattening list manager thing to the backend could be nice, but it would be tricky because the QML code needs to know when items are inserted into or removed from the list, and they need to know both before and after that happens.

ricochet1k avatar Aug 03 '16 17:08 ricochet1k

Related to discussions here:

have a sidebar api to allow functionality like a namespace/class browser and to display other hierarchical information.

I think we need some sort of tagging in sidebar backend bit so for example we could tag some files with namespace, and group(also maybe label) them with that tag in sidebar.

zoli avatar Aug 03 '16 18:08 zoli

I don't think that's what he's talking about. A namespace/class browser sounds to me like a hierarchy of namespaces/classes/functions in the current file, much like other IDE's have. For example, in IntelliJ, you can click on the expando button next to a file, and it will show classes and functions in that file. I guess, the real question is, do we want the ability to add children to files in the sidebar? Or do we just want to have multiple sidebars with like, tabs above them?

The nice thing about this sidebar so far is that it really doesn't care what kind of items you give it, as long as they all follow the same interface.

Also, do you think it is worth it to allow people to define multiple icons that would appear in order? And icons on the right of the name, maybe aligned to the right of the sidebar?

ricochet1k avatar Aug 03 '16 18:08 ricochet1k

For adding representations of things other than the file hierarchy, I think best would be to do something analogous to what ST does when View > Side Bar > Show Open Files is enabled, which is to add an API to add arbitrary elements to the side bar, and some way to order them. Maybe tabs would be necessary to make the whole thing usable. This is an advanced feature though, and I don't think we should be worrying about it too much right now.

For customization of the file hierarchy display, I think, leaving as many things as possible open would be ideal. If would be cool if plugins could add: unlimited numbers of icons / images to the left and right of elements, arbitrary tags for theming, arbitrary children, custom click actions, etc. But priority one is to get it displaying files :).

erbridge avatar Aug 03 '16 21:08 erbridge

I don't think that's what he's talking about.

Right, I was thinking something like visual studio:

vs

but as you said it's not what he was talking about, Still it would be nice feature to have. As @erbridge mentioned none of these features need to be implemented now just we should keep in mind. For now we need displaying the file folder hierarchy.

zoli avatar Aug 04 '16 07:08 zoli

Just for fun, this is what the sidebar looks like right now lime-sidebar

ricochet1k avatar Aug 04 '16 18:08 ricochet1k