-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command Palette: Global command shortcut conflicts with existing shortcut #51737
Comments
@t-hamano do you think we can list this as a bug? Feels buggy to me |
Yes, I too think it is a bug. It seems to me that the only way to keep the existing add link shortcut working is to change the command center key combination. @youknowriad |
I think this issue might be a duplicate because I remember that this was mentioned before. Basically, the ultimate goal is to make the link modal part of the command center somehow. |
However, in WordPress 6.3, I think we need some approach to solve this problem. Do you have any suggestions on how to do this? |
I'm not sure that's something we can fix properly in time for 6.3. The potential solution I have is to actually make a command to create links that is only available when a RichText is selected, combined with a suggestion I heard from @richtabor where commands could render something instead of triggering something. It is a bit involved though. |
The command center has not be released in core correct? Would the proper fix not be to change the shortcut to one that doesn't conflict? If anyone can point me to one, I'd love read up on some of discussion that was had on choosing the shortcut. I thought I'd seen it somewhere (and even thought I'd seen someone mention this conflict ahead of time). I'm not finding it now. EDIT: from the original PR:
That seems preferable to how it is now but less so than a separate shortcut because of confusion like #51182. |
Let's discuss the pros/cons of using a separate shortcut in the context of this upcoming release. Pros:
Cons:
Okay, a bit cheeky on the cons but I'm hoping to prompt someone to assist here. I suspect that ye Automatticians believe the current shortcut is the obvious choice due to your slack (and likely docusaurus) habituation. For a broad audience I would have to guess they won't have such preconceptions so why pick one with a conflict? Some alternatives:
That last example also points to the way we could alias the shortcut once a command-based add-link like what Riad speculated about #51737 (comment) manifests and is equally effective as the current UX. |
I've been unable to trigger the GitHub command palette when the comment text box is focused (either with the original or aliased shortcut). For what it's worth, I don't have a strong opinion on the shortcut. The main "con" of an alternative shortcut is the fact that cmd+k is kind of widely used in the web today. That said, I can be onboard with two shortcuts to trigger the command center. Cmd+k being there for folks that are used to it elsewhere with the caveat that it doesn't work right now in RichText. |
It'd be neat if you could assign alternate shortcuts (in the future). |
This is what I'm seeing on trunk; I think it's acceptable. CleanShot.2023-06-27.at.18.01.14.mp4 |
I may have been validating in the wrong environment or on a different branch. To be precise, the command palette appears for a moment and then the link add popover appears. I have updated the description and screencast. I am sorry for the confusion 🙇 |
@richtabor We do have an open issue for assigning custom shortcuts: #3218 It would be great to see that move forward. It's had a lot of work put into it already, just needs some dev commitment. Allowing users to customize shortcuts would make problems like this much more manageable. |
Thanks Riad 🙇
Works for me on Chrome/macOS, maybe it's buggy elsewhere. It's in their docs.
Rich, thank you, though I am left wondering if you considered the whole enchilada here. Let's say your intention is to launch the command palette. Won't it be frustrating when it doesn't work from the rich text area? I hope this is a better distillation:
*We may suppose that either tradeoff can be eliminated in a later release with #51737 (comment). This may prove true but otherwise which tradeoff would we rather be stuck with? |
I love the Command Palette, yet the implementation of the global keyboard shortcut seems to be somewhat disorienting. With a seemingly global shortcut that isn't entirely 'global,' I found myself on a bit of a wild goose chase when first attempting to test it out. The shortcut constantly opened link UI, which led me to the Gutenberg experiments page and subsequently to Github, believing I am doing something wrong, all the while keeping me oblivious to the need to deselect the text based block. In my view, a feature as robust as the Command Palette should be launched smoothly and intuitively. This shortcut confusion feels as if there is more broken. Riad has already pointed out that CMD+k doesn't operate as expected when the comment box is in focus. At least on Safari OSX, we're seeing the link format for markdown instead. However, the commenting experience on a GH issue or PR is modal, a separate experience mindset, while our default block is a paragraph, and most blocks include text. Furthermore, the current state of block deselection leaves something to be desired. So I think the example does not apply. What do you think of a temporary change of plan? Let's hunt down an available keyboard shortcut, assign it to the Command Palette, and revisit Rich's idea of linking text via the command palette later. Once we're ready, we can update it to use CMD+k. Surely, communicating a shortcut update wouldn't be the most challenging task we've faced. We're not dealing with an age-old command like undo or redo, but rather a fairly recent innovation. Command palettes themselves are a relatively novel concept in the tech world, so I doubt we'd lose users over a temporary change in shortcut. |
Perhaps this is not what was intended, but I have found that executing this shortcut twice on rich text can launch the command palette. When the shortcut is executed the first time, the Command Palette flashes for a moment and the link UI opens. Since the focus has shifted to the link UI, the second shortcut would be able to activate the command palette. However, I personally think it makes more sense to change the shortcut key, since this behavior seems unnatural. 077b45ed7695e7dc0741ae802392e9f2.mp4 |
I'm favoring forward slash and made the PR as such. I'm totally willing to change that but here’s what I think weighs in favor of it.
|
I don't think the common use case would be to highlight text, then attempt to trigger the command palette (to do something else). They're not commonly related actions. As an alternative, can we have CMD+K only attempt to make a link, if there is text indeed highlighted? Then there wouldn't be a conflict with CMD+K opening the command palette. I didn't realize CMD+K worked without selecting text first—seems more a bug than a feature. |
With the introduction of the Command Palette in WordPress 6.3 and the impending release of WordPress 6.4, I think we need to reconsider how to deal with this issue. Personally, I think it would be better to change the key combinations as suggested in #52386 that do not completely conflict with other shortcuts or add aliases, rather than trying to somehow deal with the current key combinations as they are. For example, in #54515, it is suggested that the command palette be made available anywhere in WordPress. This might conflict with the shortcut for users using the Classic Editor. |
Late to the party, but to add another 👎 to switching what Learning a global shortcut is a one time learning curve. Using that changes based on what you have actively selected adds cognitive load to every single interaction with that shortcut. |
This is a common pattern in similar software across the industry, and, in my humble opinion, working differently than the rest of the software adds more cognitive load. A good example of this is how Gutenberg lists are not indented with All in all, opening the command palette only when there is no text selected seems like the best approach to me. |
Based on the discussion so far, there are probably three possible approaches at this point:
|
After a review by core editor triage and core editor tech leads on the WordPress 6.5 release team, this issue is being removed from the release due to lack of consensus and progress. I do want to know this in progress PR as related to this effort and something that might be possible to get in for 6.5 otherwise: #58179 cc @getdave who perhaps can speak to this (and why it's closed?). |
I'm not sure comparing these two cases is a good argument. I'd encourage everyone to not think as an advanced user and rather try to think as an average, not tech-savvy user. To me, these two cases are very different.
|
Suppose we change the shortcut key from the current |
The approach in #58179 was closed because there is an established convention in the editor that pressing Cmd + K within richtext will create a link even if no text is selected. My PR was attempting to disable the ability to create links from unselected text as this felt to me like an anti-pattern. However, as you can see in the PR's comments, various folks contributed reasons why my assumption is incorrect. This is unfortunate as my PR did partially solve the matching shortcut issue. Note currently on trunk the command palette will only be invoked when you are outside a rich text context. So it is contextual. Will our users expect to be creating links when they are not within a rich text area. |
Just want to clarify: inseting inline links while in the writing flow is a feature, present in other editors, inline with other formats, not a convention. |
I'm pretty sure the "established convention" here is in reference to WordPress itself which has used Cmd+K to insert links for years. |
While reviewing feedback for other 6.6 features, the conflict with Cmmd+K when a Paragraph Block is selected was mentioned twice, which surprised me. It's the first time I've received proactive feedback about the Command Palette, so it might be an interesting topic to discuss in future release cycles. |
@liviopv, did the feedback say how they would expect it to work? |
I am not Livio but I got some feedback about this today.
Not really, no. I am not sure how to fix this, we are taking over an existing (and very well-known) keyboard shortcut. |
I don't know how to fix it either without changing one of the commands. Perhaps using Cmmd+K in a Paragraph Block would toggle the link inserter AND also toggle a snackbar notification explaining how to toggle the palette in this state? |
I've finally been playing with the Command Palette recently, and this issue is my primary complaint about implementation thus far. Having ctrl+k open the link dialog - instead of the command palette - while the cursor is inside a Paragraph Block makes the keyboard shortcut (and by extension, the entire Command Palette) MUCH less useful for content providers. I also think the current situation is even more confusing for users than most people realize. Hitting ctrl+K opens the dialog box to create a link, but that box isn't labeled at all. I'd think most users - at least most of OUR users - won't even know what that box that just popped up is for! It may not have mattered as much when the Command Palette was only shown in the Site Editor, and not the Post Editor. But now that it's present when writing content, and has its keyboard shortcut prominently displayed inside it, it's time to get this resolved. I think @t-hamano did a great job of illustrating the 3 viable approaches here: #51737 (comment) How can we get consensus on which approach to go with and move towards tackling this? |
I'd agree this issue would need some more focus to be finally solved. To me:
I agree that all dialogs, popovers and such should be clearly labeled with a visible title. That's an accessibility and usability issue across many UIs in the editor but seems there's no consensus on a way forward. It should go in a separate issue though. |
For selected text, yes this is the standard. Less confident otherwise. |
All the following largely used applications open their 'insert link' UI when pressing Cmd+K even with no text selection and even on a new empty line:
|
It's confusing that ⌘K brings up the link dialog when paragraph text is selected but not when an image block is selected. |
Description
On Rich Text, there is a shortcut that converts the selected text into a link, but it conflicts with the global menu shortcut (command center) because they have the exact same key combination.
Executing this shortcut will bring up the link control and command menu. The link control is covered by a more front-facing command menu overlay. The cursor is focused on the link control and cannot be erased without clicking the command menu overlay with the mouse.Update:
I may have been validating in the wrong environment or on a different branch. To be precise, the command palette appears for a moment and then the link add popover appears. I have updated the screencast as well.I think the key combinations for the command menu shortcuts should be changed.
Step-by-step reproduction instructions
Execute the following shortcut on a paragraph block, for example.
Ctrl
+k
⌘
+K
Screenshots, screen recording, code snippet
c2af9271e04c13c5fc2b0960e15cfcb2.mp4
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: