kit icon indicating copy to clipboard operation
kit copied to clipboard

Action shortcuts only available after side panel has been opened once

Open JosXa opened this issue 1 year ago • 1 comments

Kit 2.9.4

Consider this minimal repro:

import '@johnlindquist/kit'

await arg('Test', [
  {
    name: 'Test',
    actions: [
      {
        name: 'Do something',
        onAction: () => console.log('Action executed'),
        shortcut: 'ctrl+j',
      },
    ],
  },
])

https://github.com/johnlindquist/kit/assets/7313176/9cc6a1e7-2e88-48cd-b20b-c3db103e3e6e


Steps:

  1. Execute script
  2. Press Ctrl+J

Observe: Nothing happens. The action should have gotten invoked.


Steps:

  1. Execute script
  2. Press Arrow Right
  3. Press Ctrl+J

Observe: Nothing happens. The action should have gotten invoked.


Steps:

  1. Execute script
  2. Press Arrow Right
  3. Press Arrow Left
  4. Press Ctrl+J

Observe: The action gets invoked

JosXa avatar May 04 '24 20:05 JosXa

The issue is even more severe in the editor, where custom actions are only available when the sidebar is open:

https://github.com/johnlindquist/kit/assets/7313176/751c7de8-546e-4712-ac45-7d8bac2a566a

Not visible in the screenshot, but navigating "Back" from the sidebar also doesn't help.

JosXa avatar May 06 '24 17:05 JosXa