Skip to content
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

[IDEA] Store Tags as Displayed #8228

Open
kookma opened this issue Jun 1, 2024 · 6 comments
Open

[IDEA] Store Tags as Displayed #8228

kookma opened this issue Jun 1, 2024 · 6 comments

Comments

@kookma
Copy link
Contributor

kookma commented Jun 1, 2024

Is your feature request related to a problem? Please describe.
TiddlyWiki shows the tags on Tiddler by sorting versus title, but it stores them in the order they added. This cause confusion and incompatibly in some operations.

Describe the solution you'd like
Please store tags sorted by title, when adding tag to tags field, or show tags on the tiddler as they appear in the tags field

Additional context
I think it is simple to sort the tags field when a new tag is added!

@pmario
Copy link
Contributor

pmario commented Jun 1, 2024

In no way should the sort order of tags cause incompatibility. If that is a problem the code which is incompatible needs to be adjusted.


In the tiddler tags-field, I personally would like to have tags stored in order of "importance". Importance depends on the users point of view and it may be different for every user.

Tag-lists created with list-widgets are also sorted in the order the list-field defines it. If there is a list field, the order may be confusing

@twMat
Copy link
Contributor

twMat commented Jun 1, 2024

The current enforced sorting, which takes away control from the user, is unfortunate. IMO, the "natural default" should be that tags appear in the order that the user enters them. But it should be simple to, in edit-mode, rearrange them, ideally via drag'n drop.

@kookma
Copy link
Contributor Author

kookma commented Jun 2, 2024

In no way should the sort order of tags cause incompatibility. If that is a problem the code which is incompatible needs to be adjusted.

Would you please tell me what is the benefit of storing tags in different order than displayed? Right now if I add thisTag first and myTag last (based on my preferences or importance) TW shows tags in this order "myTag", "thisTag"?! Why, because the ui template in TiddlyWiki read tags field and sort them by name! and this quite confusing!

I agree to keep the order of tag in tags field in the same way user added tags (e.g. by preference or importance) BUT TiddlyWiki should display them in the same order not sort them!

See: https://github.com/Jermolene/TiddlyWiki5/blob/master/core/ui/ViewTemplate/tags.tid#L6

<div class="tc-tags-wrapper"><$list filter="[all[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/></div>

Look at the sort in [all[current]tags[]sort[title]]!

@pmario
Copy link
Contributor

pmario commented Jun 2, 2024

Look at the sort in [all[current]tags[]sort[title]]!

Yes that's because Jeremy likes it that way. But the template is simple enough that you can change it.

@Jermolene
Copy link
Owner

Hi @kookma the ordering of tag pills by recency is undoubtedly potentially confusing but equally it is not surprising that some users have come to expect and rely on that behaviour.

I think this would perhaps be a reasonable candidate for a hidden setting.

@kookma
Copy link
Contributor Author

kookma commented Jun 2, 2024

Thank you @Jermolene. That is fair. One proposal is:

Tiddler: $:/core/ui/ViewTemplate/tags

\whitespace trim
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<div class="tc-tags-wrapper"><$list filter="[all[current]tags[]] :sort:alphanumeric:caseinsensitive[subfilter{$:/config/Tags/Sort}]" template="$:/core/ui/TagTemplate" storyview="pop"/></div>
</$reveal>

Here:

  • The filter is changed from [all[current]tags[]sort[title]] to: [all[current]tags[]] :sort:alphanumeric:caseinsensitive[subfilter{$:/config/Tags/Sort}]
  • The hidden setting tiddler is $:/config/Tags/Sort
  • The value of text field of $:/config/Tags/Sort is a filter like:
    • [{!!title}]
    • [length[]]
    • [get[color]else[#ffffff]]
    • ...
    • When there is no $:/config/Tags/Sort the tags appear in order they added as @pmario stated correctly in order of preferences or importance.

I am not sure if the proposed sort flag is suitable or now.

One improvement would be possible rearrangement of tags in edit mode as @twMat proposed. In that way the $:/config/Tags/Sort should be deleted once a tag drag and drop occurs

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

No branches or pull requests

4 participants