-
-
Notifications
You must be signed in to change notification settings - Fork 172
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 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. |
Hey! I think the chip row option is good, as you mention, it provides more space to add extra options. Can you merge the |
app/src/main/java/io/github/sds100/keymapper/mappings/keymaps/trigger/KeyMapTrigger.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/io/github/sds100/keymapper/mappings/keymaps/trigger/KeyMapTrigger.kt
Outdated
Show resolved
Hide resolved
Sorry about the long delay - very busy days here.
Chips have proven to serve well for simple sort operations, and the established UI paradigm certainly helps users to get along easily. As far as sorting by multiple fields is concerned (which makes a lot of sense in the case of keymapper's bindings), I don't fully understand your implementation, yet. Tinted chips are obviously "active", grey ones "inactive" - that works. But can the chips themselves be sorted? If not, how else do you indicate sort priorities, i. e. which active field matters most, which second, etc.? (In this regard, your "very basic UI" was appreciably clear.)
Sounds promising! Great to see progress in these improvements to keymapper's long awaiting list UI. |
I guess if its critical to have the ability to also sort the filters by priority, then the first implementation with a drag-drop list is the best option? But is it not overkill? Surely for 99% of users it is sufficient to sort by just trigger or the actions? To give that extra level of organization the grouping/folder feature should be implemented #320 |
Chips can now be moved around. I don't have much experience implementing lists with draggable elements, so it looks a bit clumsy. I went a multi-line chips list because IMO it's more convenient for moving them. I'm not sure whether animations improve the user experience or not. This is without animations. Screen_recording_20241219_173226.webmThis is with animations. There are some issues with shadow if the user moves item too quickly anim.webm |
Thanks for the demo. I think if we want to reorder them then the list (not chips) provides a better UX and makes it clearer it is possible to reorder them cos its similar to the trigger list. What does @GfEW think? |
Sorry @maksimowiczm did you already see my review comments before I submitted them? |
First time seeing those. I will check them right now. |
@GfEW I just realized what you meant about these help messages being adjusted according to the available space. I tried to make it work, but it didn’t look right, and I can’t spend infinite time on it, so it is what it is and its cool. |
This looks good now, I'm just doing some minor refactor/style changes to make it more consistent with the other code then I think its done! |
Sure, go ahead. Things can be revisited anyway later on, should the need arise. |
app/src/main/java/io/github/sds100/keymapper/constraints/Constraint.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/io/github/sds100/keymapper/sorting/comparators/KeyMapConstraintsComparator.kt
Outdated
Show resolved
Hide resolved
@maksimowiczm @GfEW I'm now sorting actions and constraints primarily by their type and then by secondary data such as the app name etc. Can you verify it is working as intended? |
Sorting by types is not alphabetical, but I think it is good enough! |
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.
Closes #1223