Open tractorcow opened 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...
I've had users complaining about this as well. The "Dragging and dropping sometimes doesn't respond" is a big issue.
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:
Drop here:
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...)
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.
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! :)
I'll see if we can look at it. Time allowing. :)
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:
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
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
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.
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.
Noice! Will look forward to that @flashbackzoo
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 ;)
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/
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.
Some good alternatives there.
Todo : Replace drag drop tree with new library. :)
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
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.
I'd rather make a react-sitetree manager to be honest, than invest more in react.
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
Has this been done in 4.3.0
, or 4
in general? @chillu
I think it's been released with 4.2.0?
Perhaps, unsure. Either way this is effectively done and could be closed though right? :)
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.
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
Just a suggestion I came across the other day, at least as an inspiration: https://github.com/frontend-collective/react-sortable-tree
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.