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

Build: Block Inserter #323

Closed
jasmussen opened this issue Mar 24, 2017 · 19 comments
Closed

Build: Block Inserter #323

jasmussen opened this issue Mar 24, 2017 · 19 comments
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@jasmussen
Copy link
Contributor

jasmussen commented Mar 24, 2017

Add button to insert blocks.

insert

Behavior

A plus shows up at the end of the post. Click it to invoke the inserter:

text

When you make a linebreak, the plus moves to the left:

insert after or between

This is also how you would insert content between two paragraphs:

newlines

You can also type / on a newline to invoke the inserter, just like how it works in Slack and many chat apps:

slash to invoke

There will likely be a permanently visible "Insert" button in the toolbar:

inserter in toolbar

See also #34 and #72 (comment) for alternate mockups for improving the look of the inserter.

@jasmussen jasmussen added Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Task Issues or PRs that have been broken down into an individual action to take labels Mar 24, 2017
This was referenced Mar 24, 2017
@mtias
Copy link
Member

mtias commented Mar 24, 2017

A first pass at implementing in the plugin was merged in #307.

@jasmussen
Copy link
Contributor Author

@timmyc I took the liberty of attaching you to this one, as you created some tickets about the inserter initially. Mind taking point on this one? ❤️

@inhll
Copy link

inhll commented Mar 29, 2017

I realize it's a bit late as this is in development, but the current size of the picker seems small, especially as the number of available blocks increases.

Would placing the block picker horizontally in a resizable area improve block findability for novice users?

newlines

This placement provides more real-estate for novices to explore / learn the available blocks, while still allowing advanced users access to search if they know what they want.

@jasmussen
Copy link
Contributor Author

That's a cool mockup, I like it! And it's not too late to think of good improvements. The inserter has been something that's always felt like it could use more iterations, so your work is welcome.

I like the idea that it takes up the spot of a block, could lend itself to some of the animation finesse that @shaunandrews has also thought up.

I like it!

@gabelloyd
Copy link

Is there a discussion about allowing the desktop toolbar to stay expanded while editing, or even on page load? I agree the little plus symbol is cleaner in appearance, but I have co-workers who use Google Sheets over Dropbox Paper simply because the toolbar is always exposed.

Maybe a setting in Settings > Writing to check if you want the toolbar exposed permanently?

I'm referring to this image

@inhll
Copy link

inhll commented Mar 30, 2017

Allowing the toolbar to be expanded makes sense, but focusing the user on the act of writing will help them stay on task so it should probably remain uncluttered. Separating the toolbar elements assists users in understanding the meaning of each icon:

admin ui-v1

Another option is showing the most recent (or most common) blocks users add to their pages. This helps surface options but may also keep users from becoming familiar with the interaction that allows in-post block additions.

admin ui-v2

The option above does, however, offer novice / intermediate users a way of adding basic blocks, and familarizes them with the "click-plus-to-insert" interface pattern. Eventually they should realize they have the same plus button in editor and graduate to adding new blocks inside the editor. Then moving from intermediate to advanced, they'll click plus and search for the blocks they want to find..

In this interaction I imagine users drag-and-drop the block from the toolbar to the place in the content area they want to see the new block.

@jasmussen
Copy link
Contributor Author

Is there a discussion about allowing the desktop toolbar to stay expanded while editing, or even on page load? I agree the little plus symbol is cleaner in appearance, but I have co-workers who use Google Sheets over Dropbox Paper simply because the toolbar is always exposed.

For now we're making the bet that an Editor bar with undo/redo/insert/post-settings/publish along with highly contextual block-first formatting tools can give us the best of both worlds those two worlds being feature rich and simple. If we find that this doesn't work in practice, it wouldn't be too hard for us to revisit this midstream.

Love your mockups @inhll, great to have. Showing recents expandable like that is an idea worth revisiting if we find that it becomes necessary. As it stands, you'll be able to insert using the commandline (type /ima on a newline to search for image block and press enter to insert), there will be an insert button below the newline for manual clicking, a keyboard shortcut, as well as the one in the top toolbar. In addition to this you can drag and drop images from the desktop. We might find that this is sufficient. If it's not, good to have alternatives 👍

@inhll
Copy link

inhll commented Mar 31, 2017

Showing recents expandable like that is an idea worth revisiting if we find that it becomes necessary.

Absolutely -- the current approach covers all the bases and can be amended if necessary!

@mizejewski
Copy link

Riffing off the existing ideas, especially those from @inhll and @shaunandrews, here is a suggested flow for adding content to a page either at the bottom or between existing blocks.

The active content area is outlined by a box. There is a centered plus sign to add new content. Both are in an accent color chosen from the official WordPress colors -- not the same color as text.

Adding content puts the focus on a small set of popular content types while the rest of page is greyed out (similar to focus mode in writing apps.) The user chooses a type and is placed in a new content box with editing tools.

simple-flow
If the user needs a content type that's not in the short list, clicking MORE reveals a larger menu of choices. The choices appear below or between rather than floating over existing content. Choosing a content type from there also places the user in a new content box with editing tools.
complex-flow

@jasmussen
Copy link
Contributor Author

Really dig your work here, @mizejewski! Thank you for adding to the discussion, the animatics are extra helpful too.

It feels like at the core of your concept is the idea that the inserter, especially between content, "makes a space for itself" where the block will be inserted. This is especially visible in the last animatic that shows the paragraph below the inserter being pushed down. I really dig this, because it subconsciously tells you where the block you insert will land. The splash of color is also nice!

The plus that sits on the bottom of the block boundary seems a good established pattern to explore. We tried it, though, and it felt too heavy handed when we did. That doesn't mean it can't work, but I think it's worth maybe keeping it as an idea at this point that we can revisit when it becomes clear that it's necessary. Recent mockups puts an inserter at the top toolbar:

Or you can use the inserter that sits at the end of the document, when it is focused:

If you insert a linebreak between content in the text, you can click the inserter button that shows up on the side:

This last one ties right into your (and Shaun's and others) idea that the inserter is horizontal, and chisels out a space for itself. A horizontal inserter seems to be an idea that keeps bubbling up, so there seems to be meat on that bone. CC: @melchoyce.

(Also slick detail that the inserter on the side turns into a close cross — we should totally do that.) 🎉

In any case, there may be sufficient ways to insert blocks that we don't need the extra button that sits on the border. But we should definitely revisit if we find in testing that we do need that.

Really nice work, thank you for doing this! 💖

@aduth
Copy link
Member

aduth commented Apr 25, 2017

From an implementation perspective, there's a question regarding:

If you insert a linebreak between content in the text, you can click the inserter button that shows up on the side:

After inserting the line break, where is the cursor focused, and how do we know to show the inserter option? Is it a new empty text block? A new empty freeform block? A new paragraph within the existing text block? A new "unassigned" block type?

Seems like the default behavior for adding line breaks is to append a new empty text block. In which case, maybe it's the responsibility of the text block to display the inserter when it has an empty content state. Since it's on my mind, there could be a role for the Slot & Fill pattern idea in #507 in letting the text block's implementation fill the block mover slot with an inserter button.

@jasmussen
Copy link
Contributor Author

After inserting the line break, where is the cursor focused, and how do we know to show the inserter option? Is it a new empty text block? A new empty freeform block? A new paragraph within the existing text block? A new "unassigned" block type?

Solid question to bring up. I think we can flex on this, but I've always thought of the new line as being text, like anything else, per the "the newline is your commandline" idea. I.e. if you start the line with - , you're making a list, if you start the line with # , you're making an ordered list, if you start the line with > , you're making a quote, and if you start the line with / you have invoked the inserter and anything you type after filters that inserter.

I'm aware that this is not quite how the inserter worked in the prototype, where the / command is more like a shortcut key. But your question does seem important especially to the block splitting and Continuous Text discussion (#447).

@mtias
Copy link
Member

mtias commented Apr 27, 2017

It makes sense to me that this is the responsibility of an empty text block.

@aduth
Copy link
Member

aduth commented Apr 27, 2017

It should probably have its own issue, but I'm going to task myself with implementing the "empty block" inserter button.

@jasmussen
Copy link
Contributor Author

@aduth your empty block + inserter thoughts gave me some ideas for the inserter. Let me know your thoughts on these:

inserter end

inserter between

inserter invoked with

inserter searched

inserter from toolbar

@mtias
Copy link
Member

mtias commented Apr 28, 2017

Some great stuff here.

@melchoyce
Copy link
Contributor

Weird outlier question: what if someone means to type /?

@jasmussen
Copy link
Contributor Author

jasmussen commented May 2, 2017

Weird outlier question: what if someone means to type /?

Great question to be asking. If written on a new line, as the first character, it should invoke the inserter. But if you type something that isn't in the inserter, or simply add a space after the /, then the inserter disappears again. Slack-esque.

That is — the above would be the preferred behavior, and not how it works in the prototypes.

Incidentally this means that if you legitimately want to write one of the following phrases on a new line, you can't:

  • /
  • /image
  • /gallery

etc.

But you can write, if you really want to, the following:

  • /
  • /image
  • /gallery

(note the trailing spaces)

I say "can" as if it's built, when in fact it's not built, and it might even be possible that we won't get to it because it's not as high priority as the other things. But the above is how it would work when I walk through it.

@mtias mtias added [Feature] Inserter The main way to insert blocks using the + button in the editing interface and removed Framework Issues related to broader framework topics, especially as it relates to javascript labels May 3, 2017
@jasmussen jasmussen added this to the Alpha milestone May 10, 2017
@jasmussen
Copy link
Contributor Author

Closing this in favor of #833. The work done on the inserter so far has been impressive. Let's create atomic tasks for the rest.

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 [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

No branches or pull requests

8 participants