Conversation
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
|
…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." |
There was a problem hiding this comment.
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.
Summary
Action::CustomShortcut/Action::OpenApplicationboth 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_editorandcustom_application_editor— single text field + Add button, ported directly from the Action Ring editor'sshortcut_editor/path_editor(features/action_ring/editor.rs), reusing the sameKeyCombo/ApplicationTargetparsing.crates/openlogi-desktop/src/features/mouse/view.rs:MouseModelViewgains two moreEntity<InputState>fields (custom_shortcut_input,custom_application_input), created the same way as the existingaction_searchfield, with the samelocalize_placeholderre-stamping on render (extracted into a small helper to stay under clippy's line budget).action_ring.*keys the Action Ring editor already uses for the same two fields.Testing
cargo fmt --all -- --checkcargo clippy -p openlogi-desktop --all-targets -- -D warningscargo test -p openlogi-desktop(219 passed; no new test added — the parsing this reuses,KeyCombo::from_strandApplicationTarget::new, already has its own coverage inopenlogi-core, and this PR doesn't add any new logic beyond wiring those into a second UI location)Cargo.toml/schema changes, so this is scoped toopenlogi-desktop, which has no reverse-dependents in the workspace.Fixes #1032