Long standing bug in list-links-draggable Macro

Folks,

If you use the list-links-draggable Macro it defaults to current tiddler and the “list” field, however if you name a different field eg field=fieldlist the current tiddler is not defaulted, and you have to pass it as a parameter, to do this you must use the macrocall form;

<$macrocall $name=list-links-draggable tiddler=<<currentTiddler>>  field=fieldlist/>

See $:/core/macros/list

I am not yet set up to submit a change to this macro definition, only documentation.

The (shortened) macro definition looks like this:

\define list-links-draggable(tiddler,field:"list", ...)

So the tiddler variable is undefined. If tiddler is not specified, the macro does not work at all, which imo is intended. It fails silently.

So the fix can be done with documentation.

  1. We could add some info to the tiddler parameter, that it is required. All other parameters are optional.
  2. The examples could be extended to also show the <$macrocall version with tiddler and field defined, as shown in your example.

Why is this Mario?

If you use <<list-links-draggable>> the default is the currentTiddler will be used. That is it does not fail silently, it works

List dragable.json (369 Bytes)

Perhaps there is a use I don’t know but with its use with other fields one would think there is no need to fail silently, just work with the current tiddler.

I have re-written the macro defined in $:/core/macros/list and add it here so you can see the changes to the shadow with preview “differences from shdow”.

updated-list-macro.json (4.3 KB)

I am yet to exhaustively test it, but I can’t see how it would break anything.

If this passes “muster” perhaps someone can raise a change, or at least tell me which GitHub repository I would need to fork to submit a change to the core. Pending its review?

It does not work. The list-field is not changed. It falls back to the value before.

The TW default repo is called “master”.

  • Checkout “master”
  • create a new “feature-branch” eg: new-links-draggable
  • make your changes
  • push them to branch new-links-draggable in your rep
  • create a pull-request against Jeremy’s master branch

That’s the workflow

I wonder if anyone could test / review this package above. Then I will try my first core change?

Mario this works if you install my modifications above see updated-list-macro.json

  • Once dropped on tiddlywiki.com use the difrerence from shadow to see my changes.

tested briefly today after noticing the bug; seems to resolve it from what I saw

I have seen, there is an issue at GH from 2022. While modifying / updating essential macros, on user request, can back-fire badly, in this case it should be safe and backwards compatible.

Since the existing behaviour does not do anything at all, it should be safe if it starts working after a change.

@TW_Tones I’ll create a PR soon.

So it is expected, that everyone, that sees this thread and is interested to test the changes, that you really test it with one of your wikis. After making a backup – And watch for side effects.

Disclaimer: It is not guaranteed, that the PR will be merged.

Was it a daddy long legs? Those are my favorite long standing bug.

Preview built by Netlify is at: https://deploy-preview-9254--tiddlywiki-previews.netlify.app/

To test create 2 tiddlers:

title: test-list-links-dnd
list: aaa bbb ccc

<<list-links-draggable>>

----

<<list-links-draggable tiddler:"other">>
title: other
list: ddd eee

Be creative and try to break it. Give feedback here or at GH.

PR is at: list-links-draggable defaults to currentTiddler if tiddler parameter is missing by pmario · Pull Request #9254 · TiddlyWiki/TiddlyWiki5 · GitHub

Have fun!
Mario

PS: Be aware, that you need to import your wiki into the preview to test with real world wikis.
PPS: New docs is at: TiddlyWiki v5.4.0-prerelease — a non-linear personal web notebook

tiddlers.json (371 Bytes)

I last replied above in 2023 so don’t recall the issue, I will look when I have a little more time.