Is this a bug? Add tag to a tiddler

99 views
Skip to first unread message

Mohammad

unread,
Apr 24, 2020, 12:10:18 PM4/24/20
to tiddl...@googlegroups.com
Why $checkbox adds tag to the end of tags field but $action-listops to beginning?

Why not they behave the same?


<$button> tag by button
<$action-listops $tiddler=<
<currentTiddler>> $tags="+[append[done]]" />
</$button>


<$checkbox tag=done>Is it done?</$checkbox>


''Tags'': <$text text={{{[
<currentTiddler>get[tags]]}}}/>


To reproduce drag and drop the attached tiddler into https://tiddlywiki.com/
and use $button and $checkbox and see the result!

--Mohammad

Test add Tags.tid

Mohammad

unread,
Apr 24, 2020, 12:12:44 PM4/24/20
to TiddlyWiki
For email reader, the first sentences is corrected as

Mat

unread,
Apr 24, 2020, 12:57:35 PM4/24/20
to TiddlyWiki
Append = add to end

Checkbox adds a tag, not sure where, but the system sorts them.

<:-)

Mohammad

unread,
Apr 24, 2020, 2:24:19 PM4/24/20
to TiddlyWiki
Mat,
 If you try the example, strangely append add tags to the beginning!
even with $tags="done" still $listops adds tag to the beginning!

--Mohammad

Mark S.

unread,
Apr 24, 2020, 2:27:08 PM4/24/20
to TiddlyWiki
Whenever I try it, no matter which way, the tag list is sorted alphabetically.
You can see this by adding a "abc" tag to the top. I think
the tag field is special, and TW takes extra steps to make sure it is sorted.

Mohammad

unread,
Apr 24, 2020, 3:28:09 PM4/24/20
to TiddlyWiki
Mark have you noted to the last line of code and what it shows?

''Tags'': <$text text={{{[<currentTiddler>get[tags]]}}}/>

This shows the real order I think!

But as you said in the tags-wrapper (under subtitle) always sows them sorted!

Mark S.

unread,
Apr 24, 2020, 3:45:08 PM4/24/20
to TiddlyWiki
You're right. Or almost. Using the $tags attribute with list-ops ends up sorting the list. Add tag "abc" to see the sorting.

But if you set it up this way:

<$action-listops $tiddler=<<currentTiddler>> $field="tags" $subfilter="+[prepend[done]]" />

the it will prepend "done", and if you do it this way:

<$action-listops $tiddler=<<currentTiddler>> $field="tags" $subfilter="+[append[done]]" />

it will append "done".

So I guess using "$tags" has a "feature" that the result always gets sorted.

Mohammad

unread,
Apr 24, 2020, 4:34:20 PM4/24/20
to TiddlyWiki
Thanks Mark!

Jed Carty

unread,
Apr 25, 2020, 6:19:22 AM4/25/20
to TiddlyWiki
The tags field is always sorted by the core, sometimes this only happens when the wiki is reloaded, but the core will always sort the tags field into alphabetical order when the wiki starts, the order of the tags field at other times isn't reliable and won't be saved.

Mohammad

unread,
Apr 25, 2020, 8:16:21 AM4/25/20
to TiddlyWiki
Jed, Thank you for clarification!
Reply all
Reply to author
Forward
0 new messages