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

Add Block: List #346

Closed
jasmussen opened this issue Mar 29, 2017 · 21 comments
Closed

Add Block: List #346

jasmussen opened this issue Mar 29, 2017 · 21 comments
Assignees
Labels
[Feature] Blocks Overall functionality of blocks [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@jasmussen
Copy link
Contributor

jasmussen commented Mar 29, 2017

Attributes

  • Formatting bar

Markup

<ul>
	<li>The quick brown fox jumps over the lazy dog.</li>
</ul>
<ol>
	<li>The quick brown fox jumps over the lazy dog.</li>
</ol>

States

Existing text:

list neutral

Switching to a list:

list switch to list

Selected:

list unordered selected

Neutral unordered:

list undordered neutral

Hover:

list unordered hover

Neutral ordered:

list ordered neutral

Placeholder, when inserted as a block:

list placeholder selected

@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 29, 2017
@mtias
Copy link
Member

mtias commented Mar 29, 2017

Something to consider: it'd be neat to allow easy re-arrangement of individual list items with up/down arrows. That's something I do often and it takes some dancing around copy/paste and not losing inline formatting of list while doing so.

@jasmussen
Copy link
Contributor Author

jasmussen commented Mar 29, 2017

it'd be neat to allow easy re-arrangement of individual list items with up/down arrows

Google Keep has a neat interface for this:

mar-29-2017 13-20-27

@spocke How hard would this be to make as a TinyMCE improvement? On a scale from "trivial" to "nightmare hellride".

Edit: just to clarify, not asking for checkboxes, just the drag and drop UI for rearranging list items

@ellatrix
Copy link
Member

Something to keep in mind here as well are nested lists:

  • Down
    • down
      • down the rabbit hole.

@androb
Copy link
Contributor

androb commented Mar 29, 2017 via email

@spocke
Copy link

spocke commented Mar 29, 2017

It might become complicated on nested lists since how do you drag between levels. For example beginning of a indented list is the same location as after the unindented item.

The location between these two are the same but the user could want to drag before b inside that list or after a.1. However I guess that could be done by just supporting the "a" case and the user would have to indent it to get it to the same level as "b".

  • a
    • b

@circlecube
Copy link
Contributor

With nested lists, it's also useful to keep in mind the UI for indenting the list/nested list.

-For moving a list item deeper down the rabbit hole (right)
-Also for moving a list item up the nested structure (left)
-What to do with the nested list items when their parent moves up/down the hierarchy? I'd assume just leave them where they are in relation to the moving li. Here's how it is done in the current editor:
nested list items

@mtias
Copy link
Member

mtias commented Mar 29, 2017

I think maybe instead of dragging, just up/down arrows like we do for blocks themselves could be interesting.

@joyously
Copy link

The ol can have a reversed attribute and a start attribute.
The li can have a value attribute.

@androb
Copy link
Contributor

androb commented Mar 29, 2017

Regarding implementation, if this were to be implemented as a "wrapped TinyMCE that is constrained to just do lists" @Afraithe has raised concerns about how this would be achieved.

Perhaps this is better implemented as part of the more generic "TinyMCE Block" that is getting discussed in PR #335

@Afraithe
Copy link

Afraithe commented Mar 29, 2017

Yeah, constraining TinyMCE to "just" handle lists isn't really what it's made for, so not sure how that would work.

@androb
Copy link
Contributor

androb commented Mar 29, 2017

Moved some thoughts about a Smart Text Block to #349

@anna-harrison
Copy link

We have made a start on list block: #358
Feedback welcome!

@mimo84 mimo84 self-assigned this Apr 3, 2017
@mimo84
Copy link
Contributor

mimo84 commented Apr 11, 2017

Just an update on the implementation of the block plugin. As I will be away for the next two weeks, at this moment we merged in basic editing and implementation for the editor and block level operations (align).
I opened a new PR about block switching and save / update content.
We need to find a better way to extract the attributes in the onChange method.
Next things to be implemented are block list toolbar, where to hook switching block type. Needs to be discussed also if block switching belongs to the plugin itself or not. For example, how do we manage swapping a heading block to a list block and which actions should be possible or not possible.
Ideas welcome :)

@jasmussen jasmussen added this to the Prototype Parity milestone Apr 20, 2017
@jasmussen
Copy link
Contributor Author

@mimo84 @intronic I see the list block in master, hooray!

I also noticed the alignments, which were part of the mockups initially. Upon reflection it doesn't seem like text align makes any sense at all in the list block, do you agree?

On the other hand, indent and unindent makes a lot of sense to have, so I've updated the mockups on this page. Let me know if you're still working on these and/or could use some help.

@mtias mtias removed this from the Prototype Parity milestone Apr 28, 2017
@BoardJames BoardJames self-assigned this May 2, 2017
@BoardJames
Copy link

@jasmussen To create the list as shown in the mockups above it seems I will need to have an ordered and unordered variant so I can create transforms between them (looking at the heading block for an example). Alternatively I could create buttons like with the alignment selector or the heading levels. Which is the preferred approach?

@BoardJames
Copy link

I've submitted a pull request to enable the updating of list content based on @mimo84 's pull request.
#598

@jasmussen
Copy link
Contributor Author

jasmussen commented May 2, 2017

To create the list as shown in the mockups above it seems I will need to have an ordered and unordered variant so I can create transforms between them (looking at the heading block for an example).

Correct, we'd need separate blocks for unordered list, and ordered lists, and a way to switch between them using the Switcher. Edit, scratch that. Upon discussing this with Matías, it might or might be multiple blocks. Maybe it's a single block that defaults to unordered, with option to switch to an ordered list, or it's two virtually identical blocks that each default to what's on the block label. In both cases, here's a new mockup for switching between them.

Alternatively I could create buttons like with the alignment selector or the heading levels. Which is the preferred approach?

I think it may be good to focus on those blocks primarily, as opposed to the flow. Because the flow for creating lists might evolve, as tracked here: #539 (comment)

In other words, we know that we'll need the two list blocks. But we haven't fully decided what the best approach for creating them is.

Thanks! Please reach out here or in DM or anywhere, if I can be of more help.

@jasmussen
Copy link
Contributor Author

As an update, your PR looks great, and I think we should get it merged in without any more feature work. That will close this ticket.

Future enhancements, like flows for creating lists, and whether a list is a single or multiple blocks, I will open separate tickets for that.

@BoardJames
Copy link

@jasmussen I've updated the pull request to a mergeable state. Should I merge it myself or should that be done by reviewers? Is the procedure that wordpress follows documented somewhere?

@jasmussen
Copy link
Contributor Author

I've updated the pull request to a mergeable state. Should I merge it myself or should that be done by reviewers? Is the procedure that wordpress follows documented somewhere?

Nice work! You can merge it yourself once it's approved by the reviewers. I'll ask and see if we can get that expedited!

@mtias mtias added [Feature] Blocks Overall functionality of blocks and removed Framework Issues related to broader framework topics, especially as it relates to javascript labels May 3, 2017
@jasmussen
Copy link
Contributor Author

Closing in favor of #704 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [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