Skip to content

Add mouse gesture practice mode and cheatsheet hints#774

Merged
multiplex55 merged 10 commits intomasterfrom
codex/add-practice-mode-to-mouse-gestures
Jan 31, 2026
Merged

Add mouse gesture practice mode and cheatsheet hints#774
multiplex55 merged 10 commits intomasterfrom
codex/add-practice-mode-to-mouse-gestures

Conversation

@multiplex55
Copy link
Copy Markdown
Owner

Motivation

  • Provide a practice/training mode for mouse gestures so users can try gestures without triggering actions.
  • Surface quick in-context guidance when RMB is held briefly (cheat sheet) and give a closest-match suggestion on misses to help learn gestures.

Description

  • Added a practice_mode boolean to MouseGestureSettings and MouseGestureConfig with default false, and wired it through runtime application logic in src/plugins/mouse_gestures.rs.
  • Exposed a launcher command mg practice that toggles practice mode and displays a toast; the toggle is implemented in toggle_practice_mode() and handled in src/gui/mod.rs.
  • Updated the worker loop in src/mouse_gestures/service.rs to suppress emitting WatchEvent::ExecuteAction when practice_mode is active while still logging matches/misses with tracing::info!.
  • Implemented a hold-to-cheatsheet hint: when RMB is held but still below deadzone for ~250ms the HintOverlay shows a multi-line cheat sheet (top gestures by iteration) and hides when the deadzone is exceeded; reused HintOverlay for multi-line display.
  • Added a simple "closest match" suggestion for misses by exposing the first entry from candidate_matches with a fuzzy match-type label in the hint text.
  • Minor supporting helpers: format_cheatsheet_text, match_type_label, constants for cheat-sheet delay/limit, and small hint formatting adjustments.

Testing

  • Added unit tests in tests/mouse_gestures_service.rs: practice_mode_suppresses_execute_action and cheat_sheet_overlay_shows_after_delay_without_tokens, and updated hint_text_includes_best_guess_and_match_type expectation to include the closest-match line.
  • Attempted to run the test suite with cargo test --test mouse_gestures_service, but the run failed during build due to a missing system dependency: the alsa pkg-config entry required by alsa-sys was not available in the environment (pkg-config / alsa.pc not found), so tests did not complete.

Codex Task

@multiplex55 multiplex55 merged commit 6fe19d4 into master Jan 31, 2026
1 check passed
@multiplex55 multiplex55 deleted the codex/add-practice-mode-to-mouse-gestures branch February 1, 2026 00:39
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