Skip to content

Conversation

@BurningTreeC
Copy link
Contributor

This draft PR adds an enhanced make-draggable-droppable and draggable-droppable-list procedure:

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

@netlify
Copy link

netlify bot commented Dec 18, 2025

Deploy Preview for tiddlywiki-previews ready!

Name Link
🔨 Latest commit 613679f
🔍 Latest deploy log https://app.netlify.com/projects/tiddlywiki-previews/deploys/6946c0d2f09639000863f919
😎 Deploy Preview https://deploy-preview-9507--tiddlywiki-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

Confirmed: BurningTreeC has already signed the Contributor License Agreement (see contributing.md)

@github-actions
Copy link

github-actions bot commented Dec 18, 2025

📊 Build Size Comparison: empty.html

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.

@BurningTreeC
Copy link
Contributor Author

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");
Copy link
Member

@pmario pmario Dec 19, 2025

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]]
Copy link
Member

@pmario pmario Dec 19, 2025

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()
Copy link
Member

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"

</$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")
Copy link
Member

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[ ]]
Copy link
Member

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 ?

@pmario
Copy link
Member

pmario commented Dec 19, 2025

This draft PR adds an enhanced make-draggable-droppable and draggable-droppable-list procedure:

Sorry for my ignorance, but I am not exactly sure, what the enhancement is.

@BurningTreeC
Copy link
Contributor Author

BurningTreeC commented Dec 19, 2025

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
EDIT: also the height of the dragged element gets respected, when dragging, the space that gets made for the dragged element is exactly its height
The transitions still need to be fine-tuned a bit
The enhancement itself becomes more obvious with "bigger" elements
For example the tiddlers in the story river can be easily made draggable-droppable with this

@BurningTreeC
Copy link
Contributor Author

Now the story river uses the make-draggable-droppable procedure to make all tiddlers in the story river drag-and-drop enabled. It's deactivated by default and can be activated using the Keyboard Shortcut alt-D

@BurningTreeC BurningTreeC mentioned this pull request Dec 19, 2025
14 tasks
@pmario
Copy link
Member

pmario commented Dec 19, 2025

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

@pmario
Copy link
Member

pmario commented Dec 19, 2025

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?

@BurningTreeC
Copy link
Contributor Author

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

Thanks @pmario, yes I've seen that too. There are still some bugs...

@Jermolene
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants