Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions client/app/services/KeyboardShortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,17 @@ const KeyboardShortcuts = {

bind: keymap => {
each(keymap, (fn, key) => {
const keys = key
// Resolve platform‑specific modifiers and remove duplicates.
const rawKeys = key
.toLowerCase()
.split(",")
.map(trim);
each(keys, k => {
// Translate platform‑specific modifiers and dedupe.
const transformed = rawKeys.map(k =>
Copy link

@cubic-dev-ai cubic-dev-ai bot Dec 8, 2025

Choose a reason for hiding this comment

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

P1: The unbind function was not updated with the same key transformation logic. When binding mod+enter, it gets stored as ctrl+enter in handlers, but unbind will still look for mod+enter, causing silent failures when trying to remove handlers.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At client/app/services/KeyboardShortcuts.js, line 44:

<comment>The `unbind` function was not updated with the same key transformation logic. When binding `mod+enter`, it gets stored as `ctrl+enter` in handlers, but unbind will still look for `mod+enter`, causing silent failures when trying to remove handlers.</comment>

<file context>
@@ -35,11 +35,17 @@ const KeyboardShortcuts = {
         .map(trim);
-      each(keys, k =&gt; {
+      // Translate platform‑specific modifiers and dedupe.
+      const transformed = rawKeys.map(k =&gt;
+        k.replace(/mod/g, modKey.toLowerCase()).replace(/alt/g, altKey.toLowerCase())
+      );
</file context>

✅ Addressed in 82880ce

k.replace(/mod/g, modKey.toLowerCase()).replace(/alt/g, altKey.toLowerCase())
);
const uniqueKeys = [...new Set(transformed)];
each(uniqueKeys, k => {
handlers[k] = [...without(handlers[k], fn), fn];
Mousetrap.bindGlobal(k, onShortcut);
});
Expand Down
Loading