Skip to content

Sort the 'Available' column for holds as a number instead of a string.#9

Merged
sgmoore merged 2 commits intosgmoore:mainfrom
bluefish2020:sort-available-column-as-number-not-string
Apr 12, 2025
Merged

Sort the 'Available' column for holds as a number instead of a string.#9
sgmoore merged 2 commits intosgmoore:mainfrom
bluefish2020:sort-available-column-as-number-not-string

Conversation

@bluefish2020
Copy link
Copy Markdown

On the Holds tab clicking the 'Available' header sorts as strings. I have not worked much with Qt but I think this approach makes sense.

Before:

available days sorted as strings

After:

available days sorted as numbers

Thanks,

-steve

@sgmoore
Copy link
Copy Markdown
Owner

sgmoore commented Apr 11, 2025

Thanks.

Your code works but the sorting is done in a different the way than the plugin handles sorting elsewhere. I'm not sure of the differences between the two methods, but for consistency sake I'd prefer to use the same method everywhere (and the other way also has the advantage of being slightly less code).

But I do have a question for you.

Where would you expect a suspended hold to appear in the sorted list? Sorting currently ignores the suspended status and uses the estimated wait days which are not actually shown, so you could get sorted list that like this

image

This also happens to be the same way the holds are sorted when you initially open the tab, and sort of makes sense when you think about it, but initially it does look strange.

Do you think this is confusing or it is OK?

@bluefish2020
Copy link
Copy Markdown
Author

I had noticed that 'Yes' and 'Never' were getting 0/999999 and would sort fine that way. I did not consider the suspended holds though.

I agree, it does look a bit strange at first. Moving them all to the bottom (to just above the 'Never's?) might make someone happy but that does not quite seem right either.

@sgmoore sgmoore merged commit 439f872 into sgmoore:main Apr 12, 2025
1 check passed
@sgmoore
Copy link
Copy Markdown
Owner

sgmoore commented Apr 12, 2025

Thanks.

I've merged your PR now.

I will leave the suspended holds as they are at the moment.

@bluefish2020 bluefish2020 deleted the sort-available-column-as-number-not-string branch April 12, 2025 08:03
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

Successfully merging this pull request may close these issues.

2 participants