Skip to content

fix(hub-ui): warn about shortcut conflicts across modes - #443

Merged
antfu merged 2 commits into
devframes:mainfrom
SaKaNa-Y:fix/shortcut-conflicts-across-modes
Oct 13, 2026
Merged

antfu merged 2 commits into
devframes:mainfrom
SaKaNa-Y:fix/shortcut-conflicts-across-modes

Conversation

@SaKaNa-Y

@SaKaNa-Y SaKaNa-Y commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Important

Please take a moment to read this. Thank you!

I should include a brief explanation of the problem in my own words in every PR. If that explanation is missing, please @mention me and do not merge this PR until I have added it. You may also leave this PR unaddressed (because this means I have not fulfilled my responsibilities as the author).

If my explanation is unclear or difficult to follow, please ask me to clarify or provide reproduction steps or supporting evidence.

I welcome suggestions and counterarguments, especially questions about anything I may have overlooked. (Your feedback helps me learn and improve. 🙏)

I hold myself to this standard for every PR, regardless of its size.

Assign a shortcut to Float Mode, open the popup window, and assign the same shortcut to Open Settings. The editor gives no conflict warning because Float Mode is hidden in the popup. Both commands become available again when the popup closes, so the duplicate binding can prevent one command from receiving the shortcut.

Check effective bindings across all commands that allow shortcuts, including commands hidden by the current mode. Keep the settings list filtered by mode and continue to allow saving after a warning. Tests cover hidden and nested commands, disabled shortcuts, the edited command, and cleared or overridden bindings.

Validation:

  • The author manually tested the rebuilt UI and confirmed the fix.
  • All 15 keybinding tests pass. An isolated run of the component warning logic returns no popup conflict before the change and a conflict after it.
  • Full lint, knip, typecheck, and build checks complete successfully.
  • Full tests: 1,662 passed, 13 skipped, and 2 failed. The failures are the runtime and declaration API snapshots for @devframes/hub-ui-onboard, which omit the existing defaultMessages export. Both failures also reproduce with the three changed source files restored to unmodified HEAD.

@vercel

vercel Bot commented Oct 7, 2026

Copy link
Copy Markdown

@SaKaNa-Y is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

👁️‍🗨️ Review this pull request with grouped, summarized diffs at:
👉 https://pulls.review/gh/devframes/devframe/443?from=github-actions[bot]

raw result

💭 analyzed by vercel-ai-gateway/anthropic/claude-sonnet-5
🕰️ 2026-10-13 04:23 UTC
🔗 head 1c03be9
🤖 automated by pulls.review

{
  "headSha": "1c03be9e5a31bc3315e96ed3d1a120c4ca683b9e",
  "result": {
    "overallSummary": "Fixes a bug where assigning a shortcut to a command hidden by the current mode (e.g. Float Mode inside the popup) wasn't flagged as a conflict when the same key was reused for a visible command, because conflict checking only scanned currently visible shortcut rows. The fix checks effective bindings across all bindable commands regardless of mode visibility, and adds tests covering hidden/nested commands, disabled shortcuts, and overridden bindings.",
    "groups": [
      {
        "key": "shortcut-conflict-fix",
        "label": "Cross-mode shortcut conflict fix",
        "summary": "Adds `findKeybindingConflict`, which checks effective keybindings across all bindable commands (including those hidden by the current mode, e.g. inside a popup) rather than only the currently visible rows, and wires it into the settings shortcut editor's conflict warning.",
        "category": "core",
        "filePaths": [
          "packages/hub-ui/src/client/state/keybindings.ts",
          "packages/hub-ui/src/client/components/views-builtin/SettingsShortcuts.vue"
        ],
        "fileNotes": [
          {
            "path": "packages/hub-ui/src/client/state/keybindings.ts",
            "text": "New helper reuses `getShortcutRows` (which already applies `allowShortcuts` filtering) to find any other bindable command sharing the same effective key, regardless of mode visibility."
          },
          {
            "path": "packages/hub-ui/src/client/components/views-builtin/SettingsShortcuts.vue",
            "text": "Replaces the manual loop over currently-visible `shortcutRows` with a call to `findKeybindingConflict` over all commands, fixing the missed-conflict bug when the conflicting command is hidden by the active mode."
          }
        ]
      },
      {
        "key": "tests",
        "label": "Keybinding conflict tests",
        "summary": "Adds test coverage for `findKeybindingConflict`, including hidden/nested commands, commands with `allowShortcuts: false`, the edited command itself, and cleared or overridden default bindings.",
        "category": "tests",
        "filePaths": [
          "packages/hub-ui/src/client/state/keybindings.test.ts"
        ]
      }
    ],
    "schemaVersion": 1,
    "source": "llm",
    "generatedAt": "2026-10-13T04:23:03.421Z",
    "model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
    "locale": "en"
  }
}

@SaKaNa-Y
SaKaNa-Y marked this pull request as ready for review October 7, 2026 07:33
@SaKaNa-Y

SaKaNa-Y commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

This fixes an issue introduced by vitejs/devtools#502 and reported in vitejs/devtools#524. The issue is that users receive no conflict warning when they assign the same shortcut to different commands across dock modes.

@antfu
antfu merged commit b911dea into devframes:main Oct 13, 2026
12 of 13 checks passed
@SaKaNa-Y
SaKaNa-Y deleted the fix/shortcut-conflicts-across-modes branch October 13, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants