-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
#1223 feature: sorting key maps #1337
base: develop
Are you sure you want to change the base?
Conversation
That's great news! I can't currently test PRs, but I'm not really into coding, anyway. Hope @sds100 finds time time to take a closer look. I can, however, comment on the UI/UX side of things. Some remarks: 1. persistency
Makes sense, sort/filter prefs should indeed persist until changed or reset by the user. To keep forgetful users from missing something, it's important to clearly indicate (e. g. by the filter icon) whether the current listing is filtered. 2. sort delay, main vs. separate list
Is this really an issue? Could you give some figures of the expected sort delays with 30, 100 and 300 mappings, or estimates thereof? Sorting and filtering would be much more beneficial in the main listing than only in a separate search screen with limited functionality. To justify the inferior, latter option, the performance difference between the two would have to exceed 1.5 s with 30 mappings, or 3 s with 100 mappings (which already is a lot, but would mainly affect the relatively small fraction of users who know they are stretching the limits). I think it's reasonable to assume only very few will end up using more than a few hundreds mappings. And if done right, sorting a list of a few hundreds items shouldn't take more than one to two seconds, even on ageing hardware (for a relevant example, see the apps list in AppManager). 3. sorting triggers or options
Ideally, sorting by triggers would be consistent with their exact name strings as they are presented to the user (including Left/Right, parentheses etc.), e. g. Sorting by options is trivial for mappings that have either no or exactly one option enabled. (As with every key, "no option enabled" should come before all possibly enabled options, as the empty string is the smallest possible value.) The case of multiple options being enabled is a bit awkward, because their presentation order currently doesn't follow an obvious scheme. However, sorting according to the presented string would be the best we could do here, too, e. g. p. s. Nice PR ID. p. p. s. I've visually improved the sorted list example in #1223, to make it easier to comprehend. |
First I'm going to complete version 2.7 and then I will work on this. |
app/src/main/java/io/github/sds100/keymapper/constraints/ConstraintState.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/io/github/sds100/keymapper/mappings/keymaps/KeyMapField.kt
Outdated
Show resolved
Hide resolved
I worked on it a bit.
I might have underestimated the performance of modern devices. I don't think it will be an issue with such a "small" list. I applied your suggestions. @sds100 Current sort order for each field:
I think users should be able to choose sorting options and arrange them according to their needs. For now, I’ve implemented a very basic UI with all field. 24-11-17-17-47-26.mp4What's next?
|
Everything except the UI is done. Additionally, this commit 11e736f somehow broke part of the multi-select menu functionality. If reverted, it works fine. |
I've made some progress on the sorting feature.
I've created a simple UI where users can choose the field priority and sort order of the fields, which are applied to the home key maps list. I don't think a bottom sheet is a good idea for this especially with the drag interactions, but I couldn't think of a better alternative. (I replaced help button 😅)
Sorting preferences are stored in
PreferenceRepository
. I think it would be annoying to have to apply sorting every time the app is launched.I'm unsure about using sorting in
ListKeyMapsUseCaseImpl
. Currently, key maps are sorted every time, which might result in a poor user experience if someone has a large number of key maps. I think it might be a good idea to create a separate screen for searching, where key maps could be sorted.It might also be a good idea to implement sorting with SQL for better performance.
Additionally, there doesn't seem to be an obvious way to sort triggers and options, so I need some help with that.