Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcut editor: Can't save changes if there are existing shortcut conflicts #11670

Open
personalizedrefrigerator opened this issue Jan 17, 2025 · 1 comment
Labels
bug It's a bug

Comments

@personalizedrefrigerator
Copy link
Collaborator

personalizedrefrigerator commented Jan 17, 2025

Operating system

macOS

Joplin version

3.2.11, 3.1.24

Desktop version info

No response

Current behaviour

From the forum:

I'm having a lot of troubles with adding/changing/removing Keyboard Shortcuts in Settings -> Keyboard Shortcuts.

  • Setting a new shortcut on an action without a shortcut often is giving me warnings about an existing shortcut, but the existing shortcut it's warning me about it not remotely the same as the one I'm trying to set.
  • When I remove an existing shortcut, and leave it blank, after saving Joplin often gives me a warning about a conflicting shortcut even though I'm removing and not setting a new shortcut.
  • If I'm able to save after removing a shortcut, the shortcut is still in effect, and if I go back in to Settings -> Keyboard Shortcuts, the old shortcut has returned.
  • Using the search feature in Settings -> Keyboard Shortcuts works the first time, but after any of the scenarios above occur, if I go back to the app then back into Settings -> Keyboard Shortcuts, whatever search term I'm using only returns a fraction of the shortcuts it should. If I quit and restart the app then the shortcuts search function starts working again (until I try updating or removing an existing shortcut again).
    https://discourse.joplinapp.org/t/keyboard-shortcuts-issues-on-macos/43143

See this comment for reproduction steps.

Expected behaviour

No response

Logs

No response

@personalizedrefrigerator personalizedrefrigerator added the bug It's a bug label Jan 17, 2025
@personalizedrefrigerator
Copy link
Collaborator Author

One way to reproduce this issue is to install a plugin that registers a keyboard shortcut that conflicts with an existing built-in shortcut. I can reproduce this in both Joplin 3.1.24 and 3.2.11.

Reproduction steps:

  1. Ensure that ctrl+0 is assigned to a command in the keyboard shortcuts screen.
  2. Apply the following patch to the example menus plugin in packages/app-cli/tests/support/plugins/menu:
diff --git a/packages/app-cli/tests/support/plugins/menu/src/index.ts b/packages/app-cli/tests/support/plugins/menu/src/index.ts
index 4d2e97629..c3f7f0aa4 100644
--- a/packages/app-cli/tests/support/plugins/menu/src/index.ts
+++ b/packages/app-cli/tests/support/plugins/menu/src/index.ts
@@ -2,9 +2,17 @@ import joplin from 'api';
 
 joplin.plugins.register({
 	onStart: async function() {
+		await joplin.commands.register({
+			name: 'myCommand',
+			label: 'My command',
+			execute: async () => {
+				await joplin.commands.execute('newNote');
+			},
+		})
 		await joplin.views.menus.create('myMenu', 'My Menu', [
 			{
-				commandName: "newNote",
+				commandName: "myCommand",
+				accelerator: 'Ctrl+0',
 			},
 			{
 				commandName: "newFolder",
  1. Add the menu plugin as a development plugin to Joplin.
  2. Restart Joplin.
  3. Open the keyboard shortcuts setting screen.
  4. Attempt to assign an existing command to some other, unused shortcut.
  5. Observe the Accelerator "Ctrl+0" is used for "zoomActualSize" and "myCommand" commands. This may lead to unexpected behaivor that prevents saving.

@personalizedrefrigerator personalizedrefrigerator changed the title Keyboard shortcuts screen showing errors on MacOS Shortcut editor: Can't save changes if there are existing shortcut conflicts Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug
Projects
None yet
Development

No branches or pull requests

1 participant