Repository navigation
feat(gui): add custom-shortcut Tap/Hold recorder to the button picker - #1396
Merged
davidbudnick merged 4 commits intoOct 10, 2026
Merged
davidbudnick merged 4 commits into
davidbudnick merged 4 commits into
Conversation
|
Contributor
Author
|
Fixed both Greptile findings in 3936e3e:
|
Action::CustomShortcut and Action::HoldShortcut already existed end-to-end in openlogi-core (parsing, IPC, agent runtime) but had no way to reach them for a physical button binding — the picker's catalog deliberately excludes both, and the only recorder in the app lived inside the Actions Ring slot editor. Button bindings (mouse buttons, the 5-direction gesture map used by HapticPanel/GestureButton) could only pick from the fixed catalog. Add a "Custom shortcut" section to the shared action_library() picker (used by button, inherited-gesture, and gesture-direction inspectors alike), with a Tap/Hold choice and a free-text KeyCombo input mirroring the Ring editor's existing recorder. Commits through the same PickFn every other row already uses, so no new state-commit plumbing. Comes up in practice pairing a haptic-pad button with a third-party hold-a-shortcut launcher (e.g. Droppy's Ring) — currently only reachable by hand-editing config.toml.
Two Greptile findings on the initial commit: - shortcut_input/shortcut_hold on MouseModelView were stored once and never cleared, so opening the picker for a different button or gesture direction showed the previous target's half-typed shortcut, and Add could silently commit it to the wrong binding. Cleared in the same opening-branch of selection_card's on_click that already resets action_search. - The Add button parsed KeyCombo and no-op'd silently on failure, giving no feedback for empty input, modifier-only combos, unknown keys, or malformed separators. Add is now disabled while the current input doesn't parse, requiring a live-updating subscription on shortcut_input (mirroring the one action_search already had) so the disabled state tracks each keystroke.
fahadjibransheikh
force-pushed
the
feat/mouse-custom-shortcut-recorder
branch
from
September 25, 2026 08:35
3936e3e to
9c1dddb
Compare
# Conflicts: # crates/openlogi-desktop/src/features/mouse/inspector.rs # crates/openlogi-desktop/src/features/mouse/view.rs # crates/openlogi-desktop/src/features/mouse/view/tests.rs
Co-authored-by: David Budnick <david@budnick.ca>
davidbudnick
approved these changes
Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Action::CustomShortcut/Action::HoldShortcutand theKeyComboparser already exist end-to-end inopenlogi-core(config schema, IPC, agent runtime dispatch), but there was no way to reach either from a physical button binding — the catalog picker deliberately excludes both, and the only shortcut recorder in the app lives inside the Actions Ring slot editor.KeyComboinput) to the shared button-binding picker, so mouse buttons and the 5-direction gesture map (HapticPanel/GestureButton) can record a custom or held shortcut without hand-editingconfig.toml.Changes
crates/openlogi-desktop/src/features/mouse/view.rs:MouseModelViewgainsshortcut_input/shortcut_holdfields (built the same way as the existingaction_search), aset_shortcut_holdsetter, and alocalize_inputshelper (keptrender()under the workspace'stoo_many_lineslimit) that re-derives both inputs' placeholders on a live language switch.crates/openlogi-desktop/src/features/mouse/inspector.rs:ActionPickerContextcarries the two new fields; the sharedaction_library()(used by the plain-button, inherited-gesture, and gesture-direction inspectors) gets a newcustom_shortcut_editorsection appended after the catalog list, committing through the existingon_pick: &PickFn— no new commit plumbing.crates/openlogi-ui/locales/*.toml(all 23): four new keys under[actions]—custom_shortcut,shortcut_placeholder,shortcut_hold,shortcut_tap— at the same position in every file. Non-English values are the English source text for now, per the i18n rule (Crowdin improves them later).Testing
cargo fmt --all -- --check— cleancargo clippy -p openlogi-desktop -p openlogi-ui --all-targets -- -D warnings— clean (one real finding along the way:MouseModelView::rendercrossed the 100-linetoo_many_lineslimit after adding a placeholder call; fixed by extractinglocalize_inputsrather than suppressing the lint)cargo test -p openlogi-desktop -p openlogi-ui— 221 tests pass, includinglocale_files_have_the_same_keys(catalog parity) andservices::i18n::tests::typed_translation_keys_resolveopenlogi-agent-mock(real hardware wasn't reachable for this dev build — TCC permissions for an ad-hoc-signed bundle, a local dev-environment limitation, not something this diff touches): bound a plain button (Middle Click) to Hold+chord and a gesture-direction row (the same code pathHapticPanel/GestureButtonuse) to Tap+chord, both committed and rendered correctly and distinctly.AGENTS.md. Happy to attach screenshots from the mock-agent verification in a comment if useful.