TagStudio icon indicating copy to clipboard operation
TagStudio copied to clipboard

Tag ordering backend

Open samuellieberman opened this issue 1 year ago • 2 comments

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 b9316fa1f488205dc793117d7dc6df05fd2c9709 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: image

To mess around with the sort order, modify _default_sort. https://github.com/TagStudioDev/TagStudio/blob/8444b8d4700aa2af3a92fef79d83f1354b3a522f/tagstudio/src/core/tag_sort.py#L25-L32 Try changing the order of the properties and swapping between TagSortDirection.ASC and TagSortDirection.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.

samuellieberman avatar Jul 30 '24 01:07 samuellieberman

Any news on this work @samuellieberman ? i would love to do a review once you are ready and all tests are passing.

eivl avatar Sep 06 '24 19:09 eivl

Any news on this work samuellieberman ? i would love to do a review once you are ready and all tests are passing.

This one will likely need to get reworked once #332 is merged

CyanVoxel avatar Sep 06 '24 21:09 CyanVoxel

Just wanted to bump this and check if this is still being worked on. Unfortunately, since the SQL migration, this might require a significant rework. I think this could a useful feature especially with newer, similar requests (I.e; #542). Thanks!

seakrueger avatar Nov 15 '24 21:11 seakrueger

Closing due to inactivity - If this is a mistake and you're still interested in working on this, please let me know

CyanVoxel avatar Dec 05 '24 07:12 CyanVoxel