keymapperorg / KeyMapper

An Android app that change what the buttons do on your devices!
http://docs.keymapper.club
GNU General Public License v3.0
1.05k stars 153 forks source link

Systematic sorting, filtering, searching by/for all four aspects: triggers, actions, constraints, options #1223

Open GfEW opened 3 months ago

GfEW commented 3 months ago

Developer TODO (don't remove)

Note: There are various somewhat related feature requests (including #1085 #937 #846 #845 #701 #691 #320), but none of them covers the systematic approach suggested below in its entirety.

The Problem

As soon as your list grows into the dozens, maintaining an overview of the existing mappings, e. g. to remember a particular mapping you haven't used in a while, or to ensure consistency when adding a new one, gets increasingly taxing and tedious. The main cause for this difficulty is the lack of search, filter and sort modes.

Suggested Solution

Function

All four main aspects, or data fields, of a mapping:

  1. trigger
  2. actions
  3. constraints
  4. options,

can be necessary to search for, to sort by, or to filter by.

Search should, to keep things simple, look for matching data in all four fields at once. Example: A search for the search term "search" should find all mappings where the trigger includes the "search" button, or the actions include e. g. "launch app" with the string "search" contained in that app's name, or the constraints include e. g. "app in foreground" with the string "search" contained in that app's name. (If there was an option containing the string "search", the mappings with that option active should be included in the results, as well.) Scope: Search should be available in all sorting and filtering modes.

Sorting obviously needs a specific data field to sort the list by. The sorting menu should allow to select the desired field, and to toggle straight/reversed sort order. Example: If you wanted to see mappings sorted by constraints, you'd select the constraints sort key in the sorting menu. Mappings with the same category of constraints (if any) would then be listed one after another, e. g. "app in forground" (if any), then "app not in forground" (if any), then "app playing media" (if any), and so forth. Within each of those categories, mappings with the same constraint values (e. g. app names) would be listed one after another. In this example, the sorted list of mappings could look like this (headers and emphasis for clarification only, please forgive the clumsy csv format):

Scope: Sorting should be available in all filtering modes, and also apply to search results.

Filtering requires a value (or value pattern) in at least one specific data field, but more fields criteria may be combined. Example: You might be interested in all mappings that

The filter dialog should allow you to set up filter 1 "not constraints: *" and filter 2 "not triggers: Meta ". (That's not necessarily meant to be the exact syntax, but you get the idea.)

Scope: Filtering should be available in all sorting modes, and also apply to search results.

User Interface

Search could be offered most naturally by a search bar (or alternatively, a search button). The search results listing should be visually distinguished from the main listing, so the two cannot be confused. Nice to have: Highlight the matching parts in each result.

Sorting should be accessible by a sort button that opens a menu where you can choose the sort key:

Nice to have: Change the look of the sort button to visually indicate the current sorting mode.

Filtering should be accessible by a filter button that opens a dialog where you can specify one or more filter criteria, each consisting of a value (or pattern) and the data field where it shall match. The dialog should also allow to quickly disable all filters by a single toggle, remembering the set filters so they can be re-enabled later just as quickly by the same toggle. Nice to have: Change the look of the filter button to visually indicate whether any filter is active.

sds100 commented 3 months ago

I'm too busy right now to work on this, but thats one of the most thorough and thoughtful feature requests yet. Good job! 😅

GfEW commented 3 months ago

I'm too busy right now to work on this

Just to be clear, I am very grateful for keymapper as it is. I fully understand the suggested solution is no quickie, even if it substantially improves usability in the long run. I'd be happy to contribute more than issues, but I'm not a programmer. It's a shame you're (apparently) the only one taking care of the code side of this gem.