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

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

Open
3 tasks
GfEW opened this issue Jun 7, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@GfEW
Copy link

GfEW commented Jun 7, 2024

Developer TODO (don't remove)

  • create new branch. put issue number at start of name
  • update documentation
  • merge and delete branch (don't squash because want commit history to see why I made changes)

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):

  • "trigger", "actions", "constraints", "options"
  • "Meta left + 0", "launch app: zoo", "", ""
  • "Meta left + 1", "launch app: loo", "", "Vibrate"
  • "Meta left + A", "launch app: foo", "app in foreground: Chromium", ""
  • "Meta left + B", "launch app: bar", "app in foreground: Chromium", ""
  • "Meta left + A", "launch app: baz", "app in foreground: VLC", "Vibrate"
  • "Meta left + A", "launch app: baaz", "app not in foreground: VLC", "Vibrate"
  • "Meta left + C", "launch app: foooo", "app playing media: Chromium", ""
  • "Meta left + C", "launch app: baaar", "app playing media: VLC", "Vibrate"
  • "Meta left + D", "launch app: baaaz", "screen is off", "".

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

  • have no constraints and
  • whose triggers do not include any Meta key (i. e. "Meta left" or "Meta right").

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:

  • trigger
  • actions
  • constraints
  • options
  • unsorted.

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.

@GfEW GfEW added the enhancement New feature or request label Jun 7, 2024
@GfEW GfEW changed the title Allow to sort, filter, and search by/for all four aspects: triggers, actions, constraints, options Systematic sorting, filtering, searching by/for all four aspects: triggers, actions, constraints, options Jun 7, 2024
@sds100
Copy link
Collaborator

sds100 commented Jun 7, 2024

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
Copy link
Author

GfEW commented Jun 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants