Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is intended to provide more and more complicated tag sorting options than #329, as well as bringing tag sorting functionality into its own file to be used in multiple places. Currently the code works and sorts all results in the add tag panels, but the code itself is a work in progress. See commit b9316fa for a little of the work I have planned.
The most notable tag sorting option is sorting tags based on an automatically generated lineage, a chain of parent tags present in the search. This feature is set up so that parent tags and their children and grandchildren will all appear next to each-other in the list of tags, in a tree-like fashion. It is set up to automatically respect any sort properties that come before or after it. Here is an example with ascending lineage depth:
To mess around with the sort order, modify
_default_sort
.TagStudio/tagstudio/src/core/tag_sort.py
Lines 25 to 32 in 8444b8d
Try changing the order of the properties and swapping between
TagSortDirection.ASC
andTagSortDirection.DESC
Currently these are the only tag properties that are supported. In the future, I plan to add other options, such as sorting tags based on how many times they appear in the library's entries. I am taking suggestions for other tag properties to calculate and sort by.