silverstripe / silverstripe-cms

Silverstripe CMS - this is a module for Silverstripe Framework rather than a standalone app. Use https://github.com/silverstripe/silverstripe-installer/ to set this up.
http://silverstripe.org/
BSD 3-Clause "New" or "Revised" License
515 stars 333 forks source link

Replace tree control #744

Open tractorcow opened 11 years ago

tractorcow commented 11 years ago

The current tree implementation is dated and could do with being replaced. Most likely, it would make more sense to shift to a react-based tree manager than relying on an upgrade of JSTree.


Originally: SiteTree Drag/Drop sorting usability (and bugs)

There are a few ongoing issues with the current drag-drop SiteTree panel.

This issue seriously aggravates my carpal tunnel.

chillu commented 11 years ago

Do you want to check if any of your suggestions have been raised in the library issue tracker, or maybe even fixed already? https://github.com/vakata/jstree Our version is pretty old (1year+). I think we've minimally customized the JS, but heavily customized the CSS, so upgrading isn't easy there. Its a complex component...

mmichelli commented 11 years ago

I've had users complaining about this as well. The "Dragging and dropping sometimes doesn't respond" is a big issue.

kinglozzer commented 11 years ago

Small tip: when dragging and dropping, rather than dropping in the middle of two pages, drop when the mouse is just touching one of the pages (the background colour changes slightly). Hard to explain, so:

Don't drop here: 1

Drop here: 2

If you get the technique right, it'll work every time (as long as you don't end up moving it to be a child page of where you want it...)

purplespider commented 9 years ago

With the recent talk of improving CMS usability it would be great if this could be looked at. Dragging and dropping pages really shouldn't require a specific "knack" in order for it to work.

purplespider commented 9 years ago

Any chance in getting this fixed for 3.2? It would be great not to have to teach users the "technique" in order to make drag & drop work! :)

tractorcow commented 9 years ago

I'll see if we can look at it. Time allowing. :)

jonom commented 9 years ago

I looked at updating this plugin once myself but it was too much for me - but I would be happy to help with any css/theming required if someone else can get the functionality up and running?

There are a few related issues that could all be addressed as part of a JSTree update:

jonom commented 9 years ago

Holy dang, there are more than I though. Lots are related to the site tree not being refreshed properly after changes. Think it would make sense to update JSTree first, then fix as many of these issues as possible in one big update. Might require a little re-think of Hierarchy and trees in general in the framework though.

https://github.com/silverstripe/silverstripe-cms/issues/1161 https://github.com/silverstripe/silverstripe-cms/issues/1084 https://github.com/silverstripe/silverstripe-cms/issues/1053 https://github.com/silverstripe/silverstripe-cms/issues/867 https://github.com/silverstripe/silverstripe-cms/issues/776 https://github.com/silverstripe/silverstripe-cms/issues/767 https://github.com/silverstripe/silverstripe-cms/issues/766 https://github.com/silverstripe/silverstripe-cms/issues/763 https://github.com/silverstripe/silverstripe-cms/issues/657 https://github.com/silverstripe/silverstripe-cms/issues/572 https://github.com/silverstripe/silverstripe-cms/issues/515 https://github.com/silverstripe/silverstripe-cms/issues/508 https://github.com/silverstripe/silverstripe-cms/issues/400

tractorcow commented 9 years ago

Wow there are a lot of issues... I wonder how much longer we can use this version of treeview before we have to upgrade. :D

jonom commented 9 years ago

Yeah I think because of the number of issues it might need a bit of a 'back to the drawing board' approach. The latest version of JSTree seems to have a pretty different API to the legacy (pre-release) version we're currently using, so if we're talking about updating to that it's probably worth doing some research to see if there is an alternative js-tree type plugin with more of the filtering functions etc. we need included out of the box - since either one will probably require a fair bit of work to drop in. Probably counter-productive to try and fix these issues without updating JSTree or switching to a different plugin as the fixes might become redundant and lead to re-work if/when the tree plugin is updated later.

flashbackzoo commented 9 years ago

Improving drag-and-drop is in our internal backlog and marked for 3.3. So will get some love over the next couple of months. And yeah - we'll have to consider fixing vs upgrading.

I ran into a similar fixing vs upgrading issue the other day with Chosen.js and dropdown fields. This and the Chosen issue are actually part of a wider issue, font-end dependency management, which currently doesn't exist. I'm keen to put together an RFC, using npm or bower, for 4.0. I think that would go some way to improving the upgrade path for the various libraries we use.

jonom commented 9 years ago

Noice! Will look forward to that @flashbackzoo

flashbackzoo commented 9 years ago

@jonom https://github.com/silverstripe/silverstripe-framework/issues/4372

jonom commented 9 years ago

Cheers @flashbackzoo I don't have the relevant knowledge to comment on the specifics but I see lots of discussion going on so that's great ;)

colymba commented 8 years ago

Just a wild idea... do we really need jsTree? I mean, can we not just ditch it and get away with just a drag-n-drop library? Do we need more than simple drag-n-drop js callbacks and all the rest can be done with simple CSS?

There are a bunch or library that we could look into like: http://johnny.github.io/jquery-sortable/ http://lukasoppermann.github.io/html5sortable/examples/index.html http://rubaxa.github.io/Sortable/

tractorcow commented 8 years ago

If someone wants to rewrite all of the js menu code in CMS then sure. :P We also have right click menu integration, bulk selection, partial tree ajax loading, etc... so those would need to be re-implemented.

clarkepaul commented 8 years ago

Some good alternatives there.

tractorcow commented 7 years ago

Todo : Replace drag drop tree with new library. :)

kinglozzer commented 7 years ago

Just a heads up, JSTree 3.x requires jQuery 1.9 or newer and we’re still using 1.7.2 in SS4. It might be a good excuse to update jQuery, even if it’s just a few versions newer rather than a “current” release, and move it into our build process properly

dhensby commented 7 years ago

It might be a good excuse to update jQuery

This has been discussed, the biggest challenge is getting entwine to work with newer versions of jQuery see #3384

I think the overall feeling of the core team is that, as we move away from jQuery towards React, spending development effort on upgrading JSTree, Entwine and jQuery is not productive. The goal is to remove these components rather than support them.

tractorcow commented 7 years ago

I'd rather make a react-sitetree manager to be honest, than invest more in react.

chillu commented 7 years ago

FYI I'm advocating to remove the ability for a tree to show search results in SS4 - we've already simplified TreeDropdownField into a list-based UI (although it still uses Hierarchy and tree marking behind the scenes). Next cab off the rank is removal of tree search results when editing a page, and when showing full screen search results: https://github.com/silverstripe/silverstripe-cms/issues/1926

NightJar commented 5 years ago

Has this been done in 4.3.0, or 4 in general? @chillu

chillu commented 5 years ago

I think it's been released with 4.2.0?

NightJar commented 5 years ago

Perhaps, unsure. Either way this is effectively done and could be closed though right? :)

ScopeyNZ commented 5 years ago

It might still be pertinent to keep an issue open for the eventual conversion of the sitetree into React. I'll leave that to @chillu's judgement though.

chillu commented 5 years ago

Actually, yeah let's keep it open. I only read the last few comments in the thread, and was under the impression that it was limited to the treedropdownfield tree view, which we've fixed. But the scope is all tree implementations

michalkleiner commented 3 years ago

Just a suggestion I came across the other day, at least as an inspiration: https://github.com/frontend-collective/react-sortable-tree

chillu commented 3 years ago

Thanks Michal! I think the main bit missing from that UI library would be lazy loading of partial trees. Which has been discussed in 2017 on that repo. Also, 500 issues in its lifetime. Open source is hard :)