Razeeman / Android-SimpleTimeTracker

Simple app that tracks time.
GNU General Public License v3.0
542 stars 69 forks source link

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

Open ferkulat opened 7 months ago

ferkulat commented 7 months ago

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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

(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.

https://github.com/Razeeman/Android-SimpleTimeTracker/blob/53a821d1430c99790537844de706dca5e6ad17b5/domain/src/main/java/com/example/util/simpletimetracker/domain/model/CardOrder.kt#L3-L7

Then handle it here:

https://github.com/Razeeman/Android-SimpleTimeTracker/blob/53a821d1430c99790537844de706dca5e6ad17b5/domain/src/main/java/com/example/util/simpletimetracker/domain/interactor/RecordTypeInteractor.kt#L70-L77

By duplicating this method:

https://github.com/Razeeman/Android-SimpleTimeTracker/blob/53a821d1430c99790537844de706dca5e6ad17b5/domain/src/main/java/com/example/util/simpletimetracker/domain/interactor/RecordTypeInteractor.kt#L80-L82

And adding it in the preferences:

https://github.com/Razeeman/Android-SimpleTimeTracker/blob/53a821d1430c99790537844de706dca5e6ad17b5/domain/src/main/java/com/example/util/simpletimetracker/domain/interactor/PrefsInteractor.kt#L69-L81

And in the user interface:

Razeeman commented 3 months ago

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.