-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Dragndrop - add enhanced dragndrop lists #9507
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
base: master
Are you sure you want to change the base?
Conversation
This commit adds the basic dragndrop procedures for enhanced draggable lists
✅ Deploy Preview for tiddlywiki-previews ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Confirmed: BurningTreeC has already signed the Contributor License Agreement (see contributing.md) |
📊 Build Size Comparison:
|
| Branch | Size |
|---|---|
| Base (master) | 2450.2 KB |
| PR | 2470.2 KB |
Diff: ⬆️ Increase: +20.0 KB
✅ Change Note Status
All change notes are properly formatted and validated!
📝 $:/changenotes/5.4.0/#9507
Type: enhancement | Category: usability
Release: 5.4.0
Dragndrop procedures for enhanced dragndrop lists
🔗 #9507
👥 Contributors: BurningTreeC
📖 Change Note Guidelines
Change notes help track and communicate changes effectively. See the full documentation for details.
|
missing: handling for incomplete drop |
| this.droppableListActions = this.getAttribute("listActions"); | ||
| this.droppableEnterActions = this.getAttribute("dragenteractions"); | ||
| this.droppableLeaveActions = this.getAttribute("dragleaveactions"); | ||
| this.droppableEndActions = this.getAttribute("dragendactions"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency reasons. Sice we have already listActions IMO we also could use dragEnterActions ans so on. IMO it would highly improve readability. eg: this.getAttribute("dragEndActions");
| </$let> | ||
| \end | ||
|
|
||
| \function get.drag.state.tiddler.height() [<dragStateTiddler>get[height]addsuffix[px]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a convention for core global filter naming. They should be prefixed with tf. eg: tf.named-with-hyphens or tf.camelCase, where it makes sense.
Later in the code the tf. prefix makes it clear, that a function is used in stead of a variable.
In this PR, all functions use a get. prefix, which "could" make it redundant. Can we remove it?
IMO we should remove tiddler- from state-tiddlers. IMO state- should be enough
So I think it should be named tf.drag-state-height. (I am also not realy sure, what it is used for. So it may be tf.drag-tiddler-height or tf.drag-height instead.)
| \function get.tiddler.before.target() [<dragStateTiddler>get[target]] :reduce[list<list>before<currentTiddler>] | ||
| \function get.tiddler.after.target() [<dragStateTiddler>get[target]] :reduce[list<list>after<currentTiddler>] | ||
|
|
||
| \function get.styleTransition() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here tf.styleTransition should be enough since functions always "get"
core/wiki/macros/dragndrop.tid
Outdated
| </$tiddler> | ||
| \end | ||
|
|
||
| \procedure draggable-droppable-list(content:"",list:"",dropActions:"",class:"",dragStateTiddler:"$:/state/tiddlywiki/dragging",direction:"vertical",history:"",styleMarginTop:"0px",styleMarginBottom:"0px",stylePaddingLeft:"0px",stylePaddingRight:"0px",styleZIndex:"501",animationDuration:"175",animationCurve:"linear") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it should be dragState and the docs should make it clear it expects a tiddler title. This will shorten the code line length quite a bit.
| \function get.drag.state.tiddler.height() [<dragStateTiddler>get[height]addsuffix[px]] | ||
| \function get.drag.state.tiddler.margin.bottom() [<dragStateTiddler>get[margin-bottom]] | ||
|
|
||
| \function get.draggable.droppable.bottom.class() tc-draggable-droppable-drop-bottom [<dragStateTiddler>get[margin]match[bottom]then<qualifiedDragEnterClass>] :and[join[ ]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we shorten this to tf.drag-drop-bottom-class ?
Sorry for my ignorance, but I am not exactly sure, what the enhancement is. |
|
Hi @pmario good morning The enhancement is that the drag-and-drop elements move now using transitions which makes the drag-and-drop experience more natural |
|
Now the story river uses the |
|
I found a bug. If you dnd a tiddler in the story river and the "Open" sidebar is visible, it allocates the height of the story river tiddler in the sidebar too. And vice versa if you dnd in Open tab |
|
Also I think allocating the height of the tiddler in the story river does not make any sense for the default views available at tw-com. Is there an other usecase? |
Thanks @pmario, yes I've seen that too. There are still some bugs... |
|
Hi @BurningTreeC I like this. I’m interested in trying to evolve the UX closer to the standards of modern web applications, and this is a tour de force that nicely demonstrates how much of this sort of functionality can now be done in wiki text. The core size increase is very significant, and it would be good to do all that we can to reduce it. Even if (probably optimistically) we got the size increase down to 15KB, I think it may still make sense to go ahead with it. The code is nicely encapsulated, so particularly if there’s a case that we can reuse a significant amount of it, I’d be interested to explore further. |
This draft PR adds an enhanced
make-draggable-droppableanddraggable-droppable-listprocedure:Bildschirmaufzeichnung.vom.2025-12-18.21-28-54.mp4
currently it works for vertically aligned lists only but it will be enhanced for horizontal lists, too
the transitions you see in the video can still be refined, I'm a bit tired now 😁 and will have to have a look with fresh eyes
I can imagine that this could for example easily be used for TiddlyDesktop's landing page ...
Please let me know if this is possible core material. Thank you <3