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

[Feature] option for sorting activities by name ascending / descending #139

Open
ferkulat opened this issue Nov 30, 2023 · 8 comments
Open

Comments

@ferkulat
Copy link

Hi,
currently I sort my activities by name. Which makes the latest added activity at the end of the list.
But more recent activities are likely the ones that are chosen more frequently.
Which makes me scrolling down the (already long and increasing) activity list every time.

If I could sort activities by name in descending order, that would be a big improvement for me.

@Razeeman
Copy link
Owner

Razeeman commented Feb 7, 2024

Hello! Thank you for the feedback. Can you explain a little bit more, if activities sorted by name latest added activity shouldn't be at the end of the list, it should be sorted by it's name. Also there is a manual sort. Maybe it will help?

@ferkulat
Copy link
Author

ferkulat commented Feb 7, 2024

The activities I have, are named like XYZ-12345 with XYZ always the same. Because those are jira tickets.
And the list of activities to choose from, is long and is growing.
If I want to start tracking time for an activity, I need to scroll down to the end of the list all the time.

Ideally the most recent activities should be on top of the list.
This could be achieved by sorting the activity list by name in descending order.
Or by ordering by time/date the activity was added to the list in descending order.

@cogk
Copy link
Contributor

cogk commented Feb 8, 2024

already long and increasing) activity list

If that works for you, maybe you can archive old activities? You can then un-archive them at any time, when they become relevant again.

@ferkulat
Copy link
Author

already long and increasing) activity list

If that works for you, maybe you can archive old activities? You can then un-archive them at any time, when they become relevant again.

I would really like to keep all tickets in the app. this way its easy to look at statistics.

From the usability point:
it is much more likely that someone will pick the most recent added tickets to work on.
it would make much more sense to put the most recent added tickets on top of the list to choose from.

And in my case ( jira tickets) this could be achived by sorting by name descending.

@cogk
Copy link
Contributor

cogk commented Mar 20, 2024

this way its easy to look at statistics

All activities (and tags too) are shown in the statistics screen, even when they are archived. I believe you can safely archive your activities without worrying about the stats screen, as they will still appear there.

@ferkulat
Copy link
Author

ferkulat commented Mar 20, 2024

I would like to change it my self and make a PR for that.
But skimming and greping did not help me to find the code to change.
I am not familiar enough with java/kotlin in general and with the code of the project.
Could you give me a hint?

Or maybe it is too complicated to add this sorting option?
Or is it that you don't want that option at all?

@cogk
Copy link
Contributor

cogk commented Mar 20, 2024

(I'm not a maintainer)

I believe you are looking for the RecordTypeInteractor. I guess the best course of action would be to add a new card order.

Then handle it here:

.let(::sortByName)
.let {
when (cardOrder ?: prefsInteractor.getCardOrder()) {
CardOrder.COLOR -> sortByColor(it)
CardOrder.MANUAL -> sortByManualOrder(it)
CardOrder.NAME -> it
}
}

By duplicating this method:

private fun sortByName(records: List<RecordType>): List<RecordType> {
return records.sortedBy { it.name.lowercase(Locale.getDefault()) }
}

And adding it in the preferences:

suspend fun getCardOrder(): CardOrder = withContext(Dispatchers.IO) {
when (prefsRepo.cardOrder) {
0 -> CardOrder.NAME
1 -> CardOrder.COLOR
2 -> CardOrder.MANUAL
else -> CardOrder.NAME
}
}
suspend fun setCardOrder(cardOrder: CardOrder) = withContext(Dispatchers.IO) {
prefsRepo.cardOrder = when (cardOrder) {
CardOrder.NAME -> 0
CardOrder.COLOR -> 1

And in the user interface:

  • I don't know where

@Razeeman
Copy link
Owner

Probably wouldn't hurt to have a setting like that. Feel free to make a PR. But I would suggest not adding it to the order drop down but as a separate setting, right under the order setting, as a check box something like a "Reverse order", and it probably should be visible only if order by name is selected. Hope this makes sense.

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

3 participants