Skip to content
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

Expand selection on consecutive ⌘A commands #4369

Closed
jasmussen opened this issue Jan 9, 2018 · 19 comments
Closed

Expand selection on consecutive ⌘A commands #4369

jasmussen opened this issue Jan 9, 2018 · 19 comments
Assignees
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Enhancement A suggestion for improvement.

Comments

@jasmussen
Copy link
Contributor

jasmussen commented Jan 9, 2018

This ticket suggests a potential enhancement to the Select All shortcut (⌘A).

(⌘ refers to the Mac command, on Windows and Linux the modifier key would be Ctrl)

Current behavior

The current behavior is the following

  1. When the caret is inside a paragraph, ⌘A selects all text in the paragraph block. Similarly, for more complex blocks with lots of input fields and textareas, ⌘A simply selects all text inside the focused field.
  2. When you have no blocks selected, ⌘A invokes a multi-select of all blocks on the page

Proposal

Proposal: you can press ⌘A consecutively, to expand the selection. From 1 to 2. Escape deselects.

Example 1:

  • You have 5 paragraphs in a post, the caret is in the first paragraph block.
  • ⌘A once selects all text in the first paragraph block
  • ⌘A twice invokes a multi-select of the first paragraph block, i.e. it's now selected at the block level
  • ⌘A thrice selects all blocks on the page.

Example 2:

  • You've 5 various blocks on a post, the caret is in the caption of an image block
  • ⌘A once selects all text in the caption
  • ⌘A twice selects the image block at the block level, including the caption
  • ⌘A thrice selects all blocks on the page

Example 3:

  • You've a single block on the post, a complex contact form. A checkbox or some other obscure widget has focus.
  • ⌘A once selects this entire contact form block at the block level.
  • ⌘A twice, well, it would select all blocks on the page, but since you already did that a bullet ago, you're already there.

Why?

Making it easier to select a single block at the block level is useful for deleting just that block quickly.

Making it easier to select all blocks on the page, without first deselecting all blocks, makes it more easy to copy/paste posts.

See also #4284 (and specifically the comment by @iseulde in #4284 (comment) that inspired this).

See also #2303.

@jasmussen jasmussen added [Type] Question Questions about the design or development of the editor. [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... labels Jan 9, 2018
@ellatrix
Copy link
Member

What should the single block selection look like? The same as now? Leaving it look the same might be a bit confusing in this context though.

@ellatrix
Copy link
Member

It sounds related to #3232 where a variant of single block selection is needed. If we need these to look different, it might be good to list the circumstances in which it is allowed to look different. And if it looks different, should it also act different in any way?

@ellatrix ellatrix self-assigned this Jan 10, 2018
@jasmussen
Copy link
Contributor Author

What should the single block selection look like? The same as now? Leaving it look the same might be a bit confusing in this context though.

Yes, there are incidentally some mockups here: #4382

It sounds related to #3232 where a variant of single block selection is needed. If we need these to look different, it might be good to list the circumstances in which it is allowed to look different. And if it looks different, should it also act different in any way?

In #4382 I suggested an approach that simplifies things a bit, and slightly changes how block selection works. The hope is to reduce complexity, but there may be loose ends.

@mellis32
Copy link

mellis32 commented Feb 17, 2018

I was frustrated today in using Gutenberg 2.2 regarding the current behavior of ⌘A being limited to the block my cursor was in. I think fixing this issue would be a big step forward.

Currently, only a Gutenberg developer would know that one has to first entirely remove the cursor from a block, and then press ⌘A, just so one can Select All content. This current behavior creates a harder to learn writing atmosphere.

@jasmussen jasmussen removed the [Type] Question Questions about the design or development of the editor. label Apr 2, 2018
@ZebulanStanphill
Copy link
Member

Right now the following behavior occurs in master with a Paragraph block:

  1. The first Ctrl+A selects all the text in the block.
  2. The second Ctrl+A appears to do nothing.
  3. The third Ctrl+A selects all blocks.

@markarms
Copy link

markarms commented Aug 9, 2018

Hi there! I'd like to make the case for ⌘A to function more like we historically expect to work in editing environments like Word, Google Docs and the classic editor. Let's make it so the first ⌘A selects everything on the page, not just what's inside an individual block.

Rationale:

  • As a writer, it's what I expect across all editing apps, including Word, Google Docs and the classic editor. This means it's one less thing we need to teach to new users.
  • ⌘A with multi-block formatting would significantly reduce the friction for formatting text quickly across blocks.
  • Selecting all of the text inside of just one paragraph is a feature not previously available inside legacy editing applications -- so it's not clear that a writer or editor needs this level of granularity when they can already drag or use a cursor to highlight text. (I have some additional questions about HOW one highlights text in Gutenberg, but I'll save that for another issue.)
  • As a writer I would not have realized that using ⌘A multiple times would change what it's highlighting. To educate users would require more instruction.

Adding a second and third ⌘A option might still make sense, but at least on the first ⌘A I believe we should aim to replicate the expected behavior already established.

@jasmussen
Copy link
Contributor Author

@markarms Thanks for your thoughts.

If/when we find a way in the future to let you select across paragraphs not at the block level, I agree it makes sense to change the ⌘A behavior to directly select all the blocks. However as it is today, every paragraph is an input field and the basic behavior of an input field is that ⌘A selects all content inside it.

In other words, ⌘A to select all text in the entire editing canvas I feel is tied to selecting across paragraphs at an inline level. I don't feel we should do one without the other.

⌘A twice (⌘A to select all text, ⌘A again when all text is already selected to select all blocks) should already work in the plugin. There see to e some platform specific bugs we have to iron out, but overall this is implemented.

@markarms
Copy link

Good to know, thanks @jasmussen! I do now realize the double ⌘A option exists, but I didn't realize it existed until I read this thread. This poses a learning curve question.

Also completely understand the logic of treating a text block as an independent input field. Still, there's a tension between that and the logic of what a writer and editor expects based on previous experiences in Word / Google Docs.

@jasmussen
Copy link
Contributor Author

Absolutely understand it. I would love to see the cross-paragraph selection happen at some point, but for now we've considered it a tradeoff we were willing to make for the shipping version, considering the other benefits this had. I'm hoping the vastly improved copy/paste will allow you to write in an authoring app of your choice, whether Word, Google Docs or a Markdown editor, can mitigate these tradeoffs in the meantime.

@mtias
Copy link
Member

mtias commented Aug 16, 2018

Good to know, thanks @jasmussen! I do now realize the double ⌘A option exists, but I didn't realize it existed until I read this thread. This poses a learning curve question.

It'd be interesting to have more contextual "tips" here, so the first time you press ⌘A a tip can appear saying that if you continue pressing selection would expand. Similar to what Slack does if you press tab too many times.

@jasmussen
Copy link
Contributor Author

Yes, I believe @karmatosed is a fan of that idea as well. Now that we have the keyboard shortcuts popover done, perhaps this is easyish to do? @talldan any thoughts?

@talldan
Copy link
Contributor

talldan commented Aug 17, 2018

What did you have in mind @jasmussen?

I imagine we'd want it to be quite a small contextual tip, not dissimilar to a tooltip on an icon button? I think it's quite important with those kind of tips that they don't get in the way of the user's process at all.

@jasmussen
Copy link
Contributor Author

What did you have in mind @jasmussen?

I imagine we'd want it to be quite a small contextual tip, not dissimilar to a tooltip on an icon button? I think it's quite important with those kind of tips that they don't get in the way of the user's process at all.

Basically what Slack does. I wanted to record a GIF for you, but it seems this tip shows only once, and it's already shown for me. So basically try this — go to Slack, press tab a bunch of times. After you press Tab two or three times, if I recall correctly, a modal alert like prompt shows up asking you if you like keyboard shortcuts, and suggesting a bunch of others you could try.

In this case, perhaps the first or second time you press ⌘A we'd show a similar alert-like prompt that would explain some of the ⌘A consecutive features, as well as direct you to the keyboard shortcuts modal in the ellipsis menu maybe.

@talldan
Copy link
Contributor

talldan commented Aug 20, 2018

Here's the slack help:
screen shot 2018-08-20 at 11 43 07 am

I see what you mean :) I had in mind a smaller tooltip, but this is a full modal.

I think there are similarities to our existing NUX tips, since it's contextual.

@jasmussen
Copy link
Contributor Author

Yep, for tips, definitely ask @karmatosed for help.

In this case, given the ultra-contextual nature of this tip, and the fact that it only happens once, I personally think it's totally fine to throw up a huge blocking modal. Anecdotal evidence: it's never bothered anyone in Slack, and quite the opposite it's inspired us ;)

@designsimply designsimply added the [Type] Enhancement A suggestion for improvement. label Jan 8, 2019
@aduth
Copy link
Member

aduth commented Dec 9, 2019

Can someone clarify which action items remain here?

@jasmussen
Copy link
Contributor Author

It should only be the one from #4369 (comment):

It'd be interesting to have more contextual "tips" here, so the first time you press ⌘A a tip can appear saying that if you continue pressing selection would expand. Similar to what Slack does if you press tab too many times.

So the first time one presses ⌘A, a tip pops up suggesting multiple ⌘A's can select all. Perhaps that's best as a new ticket: "contextual tips".

@ellatrix
Copy link
Member

ellatrix commented Dec 9, 2019

Action item:

Change the select all shortcut so that it gradually selects more content.

⌘A twice selects the image block at the block level, including the caption

@jasmussen
Copy link
Contributor Author

Given that the initial task was accomplished and seems to be working, perhaps we should indeed close this.

Alternately, because the remaining action item is related to tips, we could rename this ticket or close it and create a new one for "Show tip when pressing ⌘A the first time"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

10 participants