Skip to content

feat(gui): add custom shortcut/application editors to the mouse picker - #1452

Open
4ni1ak wants to merge 2 commits into
AprilNEA:masterfrom
4ni1ak:feat/mouse-picker-custom-actions
Open

4ni1ak wants to merge 2 commits into
AprilNEA:masterfrom
4ni1ak:feat/mouse-picker-custom-actions

Conversation

@4ni1ak

@4ni1ak 4ni1ak commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The regular per-button picker (used for Back/Forward and every other mouse button) could only select from the fixed action catalog. Action::CustomShortcut/Action::OpenApplication both have full agent-side support, but the only editor for entering either one lived in the Action Ring's slot editor — the plain Buttons picker had no way to bind, say, "open a specific folder" to a mouse button. See [Feature]: 鼠标按键设置自定义 #1032.

Changes

  • crates/openlogi-desktop/src/features/mouse/inspector.rs: action_library (the picker's action list) gains two new sections, custom_shortcut_editor and custom_application_editor — single text field + Add button, ported directly from the Action Ring editor's shortcut_editor/path_editor (features/action_ring/editor.rs), reusing the same KeyCombo/ApplicationTarget parsing.
  • crates/openlogi-desktop/src/features/mouse/view.rs: MouseModelView gains two more Entity<InputState> fields (custom_shortcut_input, custom_application_input), created the same way as the existing action_search field, with the same localize_placeholder re-stamping on render (extracted into a small helper to stay under clippy's line budget).
  • No new locale strings — reused the four existing action_ring.* keys the Action Ring editor already uses for the same two fields.

Testing

  • cargo fmt --all -- --check
  • cargo clippy -p openlogi-desktop --all-targets -- -D warnings
  • cargo test -p openlogi-desktop (219 passed; no new test added — the parsing this reuses, KeyCombo::from_str and ApplicationTarget::new, already has its own coverage in openlogi-core, and this PR doesn't add any new logic beyond wiring those into a second UI location)
  • No Cargo.toml/schema changes, so this is scoped to openlogi-desktop, which has no reverse-dependents in the workspace.
  • Not visually verified — no safe display available in this environment to screenshot the new editor sections in the picker. A maintainer/reviewer should confirm the layout and that both editors commit correctly before merging.

Fixes #1032

The regular per-button picker (Back/Forward and every other mouse
button) could only select from the fixed action catalog -- OpenApplication
and CustomShortcut are both real Action variants with agent-side support,
but the only place with an editor for them was the Action Ring's slot
picker, not the plain Buttons workspace.

Port the Action Ring editor's shortcut_editor/path_editor sections
(features/action_ring/editor.rs) into the mouse picker's action_library,
reusing the same KeyCombo/ApplicationTarget parsing and Add-button
pattern -- no new locale strings, the four keys these editors need
already exist for the Action Ring. MouseModelView gains two more
lazily-nothing, eagerly-created InputState entities (matching how
action_search is already owned there) so the same draft state survives
across re-renders.

Fixes AprilNEA#1032
@4ni1ak
4ni1ak requested a review from AprilNEA as a code owner September 17, 2026 03:34
@greptile-apps

greptile-apps Bot commented Sep 17, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge from a functional perspective, with a non-blocking localization issue remaining in the new validation message.

Fix All in CodexFindings

  1. P2 Validation message remains English

Summary

The PR exposes custom shortcut and application-target editors in the regular mouse action picker and now clears stale drafts and displays parser failures inline.

  • Adds custom-action input state and localized placeholders to the mouse view.
  • Adds shortcut and application editor sections to each action picker.
  • Resets editor drafts when opening a picker and clears validation errors after edits.
  • Adds the validation-message key to every locale, although its non-English values still need translation.

Reviews (2) · Last reviewed commit: "fix(gui): reset drafts and surface inval..."

Comment thread crates/openlogi-desktop/src/features/mouse/view.rs
Comment thread crates/openlogi-desktop/src/features/mouse/inspector.rs
…s custom editors

The custom shortcut/application InputStates lived for the whole
MouseModelView lifetime and were never cleared, so a value typed for
one button/gesture/device reappeared as a stale draft when the picker
was reopened for a different target. Both Add buttons also silently
ignored a parse/validation failure, leaving no indication that
submission failed.

- Clear both custom inputs (text and invalid state) whenever the
  picker opens, mirroring the existing action-search reset-on-open —
  every target change already force-closes the picker first, so this
  covers every case Greptile named.
- Track a per-editor invalid flag, set on a failed parse and cleared
  the moment the user edits that input again; render an inline error
  caption while it's set.

Addresses the Greptile P2 finding on AprilNEA#1452.
shortcut_e_g_cmd_plus_shift_plus_p = "Tastenkürzel, z. B. Cmd+Shift+P"
application_folder_path_or_url = "Anwendung, Ordnerpfad oder URL"
open_application_or_folder = "Anwendung oder Ordner öffnen"
custom_action_invalid_input = "Couldn't recognize that input."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Validation message remains English

The new validation message is copied verbatim from English into every non-English catalog. When localized users submit an invalid shortcut or application target, the feedback appears in English. This conflicts with the repository's documented localization convention that new catalog entries must never use English fill-in and makes the new error less useful to those users.

Fix in Codex Fix in Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: 鼠标按键设置自定义

1 participant