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

Insert between paragraphs ("at cursor" vs "after the active block") #1710

Closed
folletto opened this issue Jul 4, 2017 · 6 comments
Closed
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface General Interface Parts of the UI which don't fall neatly under other labels.

Comments

@folletto
Copy link
Contributor

folletto commented Jul 4, 2017

screen shot 2017-07-04 at 17 43 13

I suggest to allow the "Insert" button from the top bar to insert always where the cursor is instead that strictly at the end of the block — at least for text blocks.

Suggested Behaviour

  1. Write a post, multiple paragraphs.
  2. I want to add an image (or other block) between two paragraphs.
  3. I click on "Insert" and the new block gets added in the middle, splitting the text block in two blocks.

I'm aware there are a lot of considerations to make here, so it's just a conversation starter. To name a few:

  • If there's a cursor, is the cursor the insert point? I'd say yes, it's expected, when a block that has a cursor is selected.
  • Do we allow this only if the cursor is on a new line, or always? (probably always, but there are pros and cons).
  • Should we then provide an API for blocks that if they implemented, then it allows splitting at cursor? (i.e. the blocks might return two instances of self with the split done at the right point).

Extended Description

Today I was trying a bit further Gutenberg and as usual I started writing and then I went back and I wanted to add images in between some text. I often write all at once and add images later.

So I clicked on Insert in the top bar and... I noticed that hovering the blue insert bar appeared at the end of the text (btw, wonderfully clear interaction there). But... that's not what I need: I need to insert where my cursor is, not after the current block. I still give it a try and as hinted the new block gets added after the whole text block.

Which means that to add a new item in the middle, I had to add a new text block, copy-paste the content from the first to the second, and then add the new non-text block between the two.

@mtias
Copy link
Member

mtias commented Jul 5, 2017

You can only write multiple paragraphs on the classic text block. If you were using the main "text block" each paragraph would be a block, so inserting an image between two is much easier.

@folletto
Copy link
Contributor Author

folletto commented Jul 5, 2017

How do we explain that then? As a user they just feel the same "text".

@jasmussen
Copy link
Contributor

I think insert images at the cursor is a solid pattern, even if the screenshot shows the classic text block. That is — I'd love for it to work there too!

But for the default text block, the same could work, couldn't it?

screen shot 2017-07-05 at 19 00 13

That is — right now it shows a blue line where the content will be inserted. But if you are in an empty text block, it should just replace it no?

@jasmussen jasmussen added General Interface Parts of the UI which don't fall neatly under other labels. Design [Feature] Inserter The main way to insert blocks using the + button in the editing interface labels Jul 5, 2017
@mtias
Copy link
Member

mtias commented Jul 5, 2017

@folletto were you editing a saved post or you explicitly inserted classic text?

@folletto
Copy link
Contributor Author

folletto commented Jul 6, 2017

It was a post done with an older version of Gutenberg, which is why I didn't expect the issue being the "classic text block" mode. ;)
Or maybe it did revert back when I edited it on the old editor and back? That might have happened, but I can't recall.

Currently running 0.3.0.

Yeah I noticed now in a new post that the paragraph got split automatically (lots of animations going on there tho! it covers the text of the paragraph above... should I open a ticket about that or there's one already?).

I guess it might be still a bit jarring as it's not obvious the difference between the two (apart from the bullet list icons in the quick toolbar), but I agree it's a slightly lesser issue than if it happened all the times.

That is — right now it shows a blue line where the content will be inserted. But if you are in an empty text block, it should just replace it no?

Good point. I'm uncertain on this: once I get how Gutenberg works, I might simply not add a new line and instead insert a different block... that said, if it's empty, it might make sense to replace it. Would it be expected? What if I start a new post, I mean to write but I start by adding an image? Tough call without some user testing live.

@mtias
Copy link
Member

mtias commented Oct 24, 2017

We have a few mechanisms for inserting between blocks, so closing this one.

@mtias mtias closed this as completed Oct 24, 2017
Tug pushed a commit that referenced this issue Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface General Interface Parts of the UI which don't fall neatly under other labels.
Projects
None yet
Development

No branches or pull requests

3 participants