Skip to content

Auto-label gestures from recordings and generalize plugin list expansion in binding picker#824

Merged
multiplex55 merged 2 commits intomasterfrom
codex/implement-auto-labeling-for-mouse-gestures
Feb 12, 2026
Merged

Auto-label gestures from recordings and generalize plugin list expansion in binding picker#824
multiplex55 merged 2 commits intomasterfrom
codex/implement-auto-labeling-for-mouse-gestures

Conversation

@multiplex55
Copy link
Copy Markdown
Owner

Motivation

  • Improve UX when applying a new recording by auto-naming gestures from recorded tokens while keeping manually-set names intact.
  • Simplify and generalize the action-picker list expansion so list-backed plugins (clipboard, folders, bookmarks, emoji, notes, etc.) are queried uniformly instead of special-casing folders/bookmarks.
  • Make the label-generation rule deterministic and testable via a helper so unit tests can validate rename behavior.

Description

  • Added deterministic label helpers: is_default_generated_label, normalize_recorded_tokens_for_label, and label_from_recorded_tokens to sanitize, truncate, and format auto-generated labels as Gesture <TOKENS>.
  • Centralized recording application into MgGesturesDialog::apply_recording_to_entry so both the Use Recording button and drag-completion path set tokens, stroke, token_buffer consistently and auto-update the label only when is_default_generated_label returns true.
  • Replaced ad-hoc folder/bookmark logic with a plugin-to-query-prefix mapping via list_query_prefix_for_plugin and a resolver resolve_action_source that calls plugin.search(<list-prefix + filter>) for mapped plugins and falls back to plugin.commands() when needed.
  • Factored picked-action handling into apply_action_pick and append_query_args to reliably set BindingKind, action, and args for query:-prefixed actions, launcher:toggle, and regular execute actions, including safe concatenation of extra args.
  • Updated binding dialog UI to use resolve_action_source and apply_action_pick so selected list entries write correct BindingKind, action, and args fields.
  • Added unit tests in mod tests covering auto_label_is_applied_only_for_default_generated_labels, customized_label_is_preserved_when_new_recording_is_applied, and resolve_action_source_prefers_mapped_list_search_and_falls_back_to_commands.

Testing

  • Ran cargo fmt successfully to format changes.
  • Attempted cargo test mouse_gestures_dialog -- --nocapture, but tests could not run in this environment due to the workspace resolving dependencies that require rustc 1.88.0 while the available toolchain is rustc 1.87.0; tests were added but not executed here because of that toolchain mismatch.

Codex Task

@multiplex55 multiplex55 merged commit c85cb95 into master Feb 12, 2026
1 check passed
@multiplex55 multiplex55 deleted the codex/implement-auto-labeling-for-mouse-gestures branch February 16, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant