gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Flow for creating lists from text

Open mtias opened this issue 9 years ago • 21 comments

Idea discussed with @jasmussen.

image

If you select text across multiple lines, a contextual "make a list out of these" button could appear next to the block switcher.

Clicking it would create a new list block with those items.

See comments for a mockup of how this could work.

mtias avatar Apr 28 '17 12:04 mtias

To elaborate a bit, this might be particularly interesting in combination with the multi paragraph text block, #447. In this case, selecting items inside such a block and clicking the list block would "split the block".

jasmussen avatar May 01 '17 08:05 jasmussen

Here are two flow mockups for this.

Version 1: the list buttons are always visible:

version 1

Version 2: the list buttons are visible only when you've selected across lines:

version 2

In version 2, would we miss the inline formatting buttons?

jasmussen avatar May 02 '17 08:05 jasmussen

I think these transformations should appear on the block switcher because I expect creating a list to split it into a separate block.

mtias avatar May 02 '17 11:05 mtias

Chatted with Matías and we came up with this:

make a list

In this flow, the left most list and quote buttons show up only when you select multiple lines, and they show up in the spot where the block switcher sits.

Here's how a list block would look:

list

jasmussen avatar May 02 '17 11:05 jasmussen

If the list has indents what should the conversion from list to paragraph do?

BoardJames avatar May 17 '17 06:05 BoardJames

Probably okay to remove the indentation in the conversion then. We can always revisit if we find that too destructive.

jasmussen avatar May 17 '17 06:05 jasmussen

@jasmussen @mtias Is this still relevant?

ellatrix avatar Jul 08 '17 13:07 ellatrix

Is this still relevant?

It is on a meta level.

I think we have many many aspects right with the editor in its current state. But one of the aspects I still think needs a little polish is cross-text-block actions like list or quote making. It might have to be punted, but I think it's worth keeping this open.

jasmussen avatar Jul 09 '17 08:07 jasmussen

@iseulde we need to review transformations in general, both UI and technically. This falls under that. I feel it should be more contextual (if you select multiple lines you get option to create list, otherwise you don't).

mtias avatar Jul 09 '17 11:07 mtias

@matias So if you select multiple paragraphs, there should be a list option? Sounds like #1811 is a good start for that.

ellatrix avatar Jul 28 '17 15:07 ellatrix

Here's a new mockup:

multi-select list making

In this situation, you get a new quick toolbar, one which works across blocks. @iseulde what do you think?

jasmussen avatar Aug 04 '17 10:08 jasmussen

@jasmussen I thought we were going for the blue toolbar on top?

ellatrix avatar Aug 04 '17 12:08 ellatrix

I still like that blue toolbar, it's an option. If it's easier to implement like that, it's okay.

The mockup tries a quick toolbar instead, as it adds actions related to formatting.

jasmussen avatar Aug 04 '17 12:08 jasmussen

Yes, I initially made it like this. I think we removed it because of the sticky toolbar problem (would be limited to the first block). Not sure how to solve that problem.

ellatrix avatar Aug 04 '17 15:08 ellatrix

Yes, I initially made it like this. I think we removed it because of the sticky toolbar problem (would be limited to the first block). Not sure how to solve that problem.

If it's easier to do in the blue toolbar for now, totally fine, especially since we're pondering a fixed toolbar in https://github.com/WordPress/gutenberg/pull/2148.

Doing a little inspector surgery, if we can move the block controls to be a child of this div, then it can scroll across the blocks:

screen shot 2017-08-04 at 17 18 26

But if that's super complicated, totally fine to use the blue one.

jasmussen avatar Aug 04 '17 15:08 jasmussen

@jasmussen Don't think that's true. It would scroll over all the blocks and not get fixed anywhere but the top and bottom of the editor.

ellatrix avatar Aug 04 '17 20:08 ellatrix

We can wrap selected blocks in a div (easy with React I guess), but then all iframes will reload every time you multi select them.

ellatrix avatar Aug 04 '17 20:08 ellatrix

Sounds like we should try putting the buttons in the blue bar for starters, seeing if it's actually a good flow. Then we can iterate from there.

jasmussen avatar Aug 04 '17 20:08 jasmussen

So how do I highlight a group of paragraph blocks? I 've tried using a mouse and keyboard and I can only ever select one block. Gutenburg just won't left me select more than one. I've been putting the cursor to the left of a character, holding shift and using the arrow keys to find the last point for so long (since before WordPerfect 5.1) it was odd to suddenly not be able to do so.

If I can't select multiple blocks then I can't convert them into a list.

fisicx avatar Sep 20 '17 13:09 fisicx

@fisicx Does this work for you in the last version, 1.8.1?

ellatrix avatar Nov 30 '17 20:11 ellatrix