Skip to content

Shortcut conflict warnings depend on the active keyboard layout #772

Description

@ahmetcetin

Reporting a bug I hit while running the test suite on a second Mac.

What happened

AppShortcuts.conflictWarnings decides whether two shortcuts clash by grouping them on their rendered display string:

displayToIDs[display, default: []].append(shortcut.id)

That string is produced by UCKeyTranslate against the active keyboard layout (AppShortcutOverride.currentLayoutCharacter). On some layouts two distinct bindings render to the same characters, so unrelated shortcuts get reported as conflicting — and which ones a user sees depends on their layout.

On the machine below, ⌥⌘F (Toggle Files Inspector) and ⌥⌘N (Toggle Notifications Inspector) render identically and Files is reported as "Conflicts with Toggle Notifications Inspector." ⌥⌘G (Toggle Pull Request Inspector) is unaffected, so it is not every key collapsing — consistent with kUCKeyTranslateNoDeadKeysBit yielding an empty string for both of those.

Steps to reproduce

Easiest signal is the existing test — no UI needed:

make test

inspectorShortcutsHaveNoDefaultConflict() fails on the affected machine and passes on another, from identical source. In the app itself, Settings → Shortcuts shows the phantom warning on the inspector shortcuts.

What I expected

Conflicts to reflect the actual bindings, not how they happen to render on the current layout.

Environment

  • Supacode main @ 8829d6a (the code is unchanged since v0.10.8)
  • macOS 26.4.1, Mac mini (Apple silicon)
  • System locale en_PL
  • No input source is configured on that machine: neither AppleSelectedInputSources nor AppleCurrentKeyboardLayoutInputSourceID exists in com.apple.HIToolbox. That looks like the trigger — with no resolvable layout, currentLayoutCharacter returns nothing for these keys and their displays collapse together.
  • Reproduces both interactively and under a self-hosted CI agent

Suggested fix

Group on the key equivalent plus modifiers rather than the rendered display, and keep display for the system-reserved check and the settings UI, where the localised string is exactly what should be shown.

I have this written and make check passes against main. Happy to open the PR once this is marked ready, per CONTRIBUTING.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestreadyApproved for a pull request. Added by a maintainer once an issue is triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions