Skip to content

[bug] option shortcut does not work #3142

Closed as not planned
Closed as not planned

Description

Describe the bug

I want to set option + 1 as Switch to Workspace 1 keyboard shortcut on MacOs but does not work

Activity

  1. ghost added
    bugSomething isn't working
    on Apr 3, 2026
  2. ghost changed the title [-][bug] the title of bug report[/-] [+][bug] `option` shortcut does not work[/+] on Apr 3, 2026
  3. Kitenite commented on May 6, 2026

    @Kitenite
    Member

    Related reports (cross-referenced during issue triage — same area, may or may not share a root cause):

  4. aneym commented on May 26, 2026

    @aneym

    Root cause (Superset 1.11.3, macOS)

    The hotkey recorder hardcodes preferredMode: "logical" regardless of the Adaptive layout mapping toggle on the Keyboard shortcuts page. On macOS, ⌥+digit produces alternate characters (⌥1 → ¡, ⌥2 → ™, ⌥3 → £, etc.). The "logical" mode reads event.key, so the Option-modified character is what gets saved — never the digit. The Adaptive toggle has no effect on recording; it is only consulted at dispatch time via bindingToDispatchChord.

    Repro (US keyboard, macOS)

    1. Open Settings → Keyboard shortcuts.
    2. Toggle Adaptive layout mapping either on or off (does not matter).
    3. Click the chord chip next to "Switch to Workspace 1" and press ⌘⌥1.
    4. Saved binding renders as ⌘⌥¡ (often appears as ⌘⌥i because ¡ looks like a tall i in the chip).
    5. ⌘⌥2 saves as ⌘⌥™, ⌘⌥3 as ⌘⌥£, and so on.

    Code references (extracted from app.asar)

    dist/renderer/assets/page-kkTxoSSn.js:

    useRecordHotkeys(recordingId, {
      preferredMode: "logical",   // hardcoded — ignores useKeyboardPreferencesStore.adaptiveLayoutEnabled
      ...
    });

    dist/renderer/assets/useRecordHotkeys-Rf7mE_nl.js:

    • captureHotkeyFromEvent produces both codeChord (meta+alt+1 from event.code === "Digit1") and keyChord (meta+alt+¡ from event.key).
    • resolveCapturedBinding(captured, preferredMode) returns keyChord whenever preferredMode === "logical".
    • useKeyboardPreferencesStore exposes adaptiveLayoutEnabled but it is never threaded into preferredMode at the recorder call site.

    Suggested fix
    Thread the preference through:

    const adaptiveLayoutEnabled = useKeyboardPreferencesStore((s) => s.adaptiveLayoutEnabled);
    useRecordHotkeys(recordingId, {
      preferredMode: adaptiveLayoutEnabled ? "logical" : "code",
      ...
    });

    …and have resolveCapturedBinding map "code" to captured.codeChord for printable keys so a ⌥+digit press persists its physical position instead of the Option-modified character. (Alternatively: always force codeChord whenever Option is held on macOS, since the produced character is rarely what the user means.)

    Workaround for affected users
    Write the override directly to localStorage (Superset DevTools console), bypassing the recorder. Example — swap the workspace/tab number rows so workspaces become ⌘⌥1–9 and tabs become ⌘1–9:

    const overrides = {};
    for (let i = 1; i <= 9; i++) {
      overrides[`JUMP_TO_WORKSPACE_${i}`] = `meta+alt+${i}`;
      overrides[`JUMP_TO_TAB_${i}`] = `meta+${i}`;
    }
    localStorage.setItem('hotkey-overrides', JSON.stringify({ state: { overrides }, version: 0 }));
    location.reload();

    String form parses as mode: "physical" and is dispatched verbatim, immune to the modifier-character substitution.

    Scope
    Confirmed on macOS, Superset 1.11.3. Any default action whose chord includes ⌥ (e.g. JUMP_TO_TAB_*) is unrecordable via the UI on this layout; same pattern presumably affects other Option-modified chords across non-US layouts where the recorder also gets a Latin character.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions