Skip to content

Add table block to Insertion Block #147

Closed

Description

@aahani

Adding Tabbed Interface to Insertion Block (#81 ) is a great idea. I thinks its better to consider adding a table block (https://wordpress.org/plugins/mce-table-buttons/) to it:

1. Insert table block:
gutenberg - insertion block table

2. Edit table block:
gutenberg - edit block table

Activity

  1. jasmussen commented on Feb 28, 2017

    @jasmussen
    Contributor

    A table block is a good idea. See also #16

  2. androb commented on Mar 1, 2017

    @androb
    Contributor

    I would guess tables is a big reason why TinyMCE Advanced is popular.

    Whether it is supported in core, or can be added back via a plugin the way TinyMCE Advanced does right now we definitely need to make it possible. There will be screams otherwise :)

  3. TheSpyder commented on Mar 7, 2017

    @TheSpyder

    For editing tables, extra buttons on the contextual toolbar are much better than a menu. Play with tables on the tinymce.com front page demo; common operations are available immediately (the menu is still available for less frequently used operations).
    screen shot 2017-03-07 at 4 52 35 pm

  4. added
    FrameworkIssues related to broader framework topics, especially as it relates to javascript
    [Type] TaskIssues or PRs that have been broken down into an individual action to take
    and removed on Mar 29, 2017
  5. mapk commented on Apr 10, 2017

    @mapk
    Contributor

    Wow, the Table block is no joke! This is complex. I've created some UI thoughts around these to be inline with our current direction. The UI design might be off, but I'm hoping the interaction aspects are close.

    Table block - Selected
    This follows similarly to @iseulde's current prototype. Basically when selected, only high level table layout is shown.
    selected ui

    Table block - Dropdown to change block
    Would the table be able to be converted into some other block? If so, I'm keeping this inline with our current block switcher.
    hover ui - switcher

    Table block - Edit Table
    I'm surfacing the ability to add/delete rows/columns. It seems the common practice is to hide these abilities to a 'right-click' event, so I'm not entirely sure which direction we want to go. One problem with this version below is that, while it is surfaced visually, it also adds another dropdown to the menu.
    hover ui - table edit

    Table block - Edit Text
    We have a way to edit the table, but we need to edit the text within the table cells. So when the user has highlighted text, this should remove the table editing menu items in place for text editing menu items. Does this sound right?
    text edit ui

    There's even more UI work that needs to be done like "border styling" for tables, etc. I'm sharing some early thoughts to get conversation going on how we want to approach this.

    I love the ability to prompt the user to select the rows and columns right away like the current textbox.io and Google docs does. I'm trying to understand how that would fit in with the current "Block Creator" we've got going.
    screen shot 2017-04-10 at 11 17 52 am

    @annaephox Any thoughts around this?

  6. TheSpyder commented on Apr 11, 2017

    @TheSpyder

    If you're going down the menu route I recommend the structure we use in textbox.io. It groups functions by target cell(s) instead of by insert/delete. We have found this to be a much more natural structure, and as an added bonus you don't need to repeat the word "row" or "column" in the submenu text.

    These are screenshots of the context menu.
    row menu
    column menu
    table menu

  7. jasmussen commented on Apr 11, 2017

    @jasmussen
    Contributor

    Solid work @mapk! Thanks for tackling this. Overall it seems like you've been stellar in following the UI patterns we've laid out so far, that's heartening to see.

    Some quick thoughts:

    Table block - Dropdown to change block

    They key for the switcher is that conversions have to be non-destructive, and allow plugins to register themselves as nondestructive conversions. In this case I can't think of any conversion that might make sense.

    Incidentally that highlights a good question: should we simply not show the switcher, when it's not useful? Or should we show it as disabled? I'm leaning towards the former, even though in the audio block, I mocked up the latter:

    screen shot 2017-04-11 at 09 57 48

    Table block - Edit Table

    Table block - Edit Text

    For now — and this will require more exploration — the "Edit" button is intended to open either a modal, or an "inspector" in the sidebar. See mockups here: https://wpcoredesign.mystagingwebsite.com/gutenberg/#admin

    This would prevent it from being a dropdown.

    I think you are on to something, though, and combined with advice from @TheSpyder and inspiration from Textbox.io, I think we can find something that would work well in our universe where toolbars are highly contextual, which you so perfectly captured in the "Edit Text" portion.

    Think of toolbars like this:

    [Switcher] [Block level] [Inline Level] [More]
    

    The above would be contextual to what you have selected, as you've captured already.

    I'm wondering what the simplest possible implementation might be. Could it be enough that you simply type in, numbers-wise, how many columns and rows you have? I.e. there could be a "Configure Table" button that opens a modal to let you type in numbers.

    Alternately it sort of feels like we have to go ultra contextual here. When a single cell is selected, you have insert row, insert column, delete row, delete column.

    When you want to merge two cells, you have to drag across them to select, to surface a "merge cells" button.


    The above may be overthinking it, though. I believe TinyMCE has a table block with some of these features already. @annaephox can you provide some screenshots or context? Perhaps we can simply use the TinyMCE block as-is, with just a little bit of UI refresh?

  8. jasmussen commented on Apr 11, 2017

    @jasmussen
    Contributor

    Let's omit the caption option, btw, and keep this primarily for media items. If you want a caption you should be able to center text below it.

  9. mapk commented on Apr 18, 2017

    @mapk
    Contributor

    I made a few visual changes based on some of the above feedback.

    Selected Table Block
    I dropped the block-switcher and changed the 'edit table dropdown' icon.
    selected table block

    Edit Table
    I'm still keeping all functions in one dropdown. While it does add more text options here, I feel more comfortable showing it all together with dividers rather than extending further sub-menus. I'm open to discussion here though! :)
    edit table

    Merge Cells
    Surfacing the 'merge cells' option in the dropdown when it's relevant.
    merge cells

    Edit Text
    Swapping out inline menu with relevant edit options.
    edit text

  10. jasmussen commented on Apr 18, 2017

    @jasmussen
    Contributor

    💖 Really love this.

    The dropdown is growing on me. Though perhaps we can use a table icon instead of the cog. We are using Dashicons for the actual plugin, so you can use perhaps this icon from that set. The mockups/sketch file still use Gridicons, no reason to swap those out, we'll need them for Calypso down the road regardless.

    The final question remains: if we are to leverage TinyMCE here, can we do the above, @annaephox?

  11. mapk commented on Apr 18, 2017

    @mapk
    Contributor

    Yeah, the dropdown worked better for me than these:

    screen shot 2017-04-18 at 3 11 00 pm

    I didn't quite understand what those ^ arrows did until I clicked them, then it added a column or row, but I didn't know how to remove it. So I don't think having individual buttons/icons for these actions works well.

    The dropdown provides space for clear text instead of vague icons. My thoughts around the dropdown were thus:

    1. The dropdown should be accessed from a contextual menu item as I have it in the mockups instead of a right-click action. Maybe it could also appear on right-click, but that shouldn't be the only way.

    2. I like having all relevant options visible in one list. It's nice to get an overview of what my options are instead of hovering over items to get a third-level sub-nav to show me my options.

    I'd love to hear other's thoughts!

  12. 30 remaining items

  13. jasmussen commented on Jun 6, 2017

    @jasmussen
    Contributor

    The pull request (#850) looks like it is on a great path. To limit discussion, and simplify the beta milestone (https://github.com/WordPress/gutenberg/milestone/7), I'm closing this one as fixed! 🎉

  14. StaggerLeee commented on Jun 21, 2017

    @StaggerLeee

    Best to make all cells draggable. If it is not much coding and would slow down whole project.

  15. BoardJames commented on Jun 25, 2017

    @BoardJames

    How would you envisage that working? Would you select some cells then dragging them somewhere would be like copying and pasting the content? Would you only allow dragging one cell/row/column at a time and then swap it with the one at the drop location?

  16. StaggerLeee commented on Jun 26, 2017

    @StaggerLeee

    Drag & Drop rows and columns. Cell separate cannot be dragged, it would not work. My mistake, wrong explained.
    See how Tablepress plugin works, or Table addon for ACF field.

  17. jasmussen commented on Jun 26, 2017

    @jasmussen
    Contributor

    One of the key values for Gutenberg is to ensure that every important action that can be taken in the editor needs to be available as a clickable (or tab then space) action. Drag and drop is totally cool to explore once those basic actions are in place. For example we have moving blocks up and down using the arrows, so it's fine if someone wants to explore adding drag and drop to blocks on top of that.

    In this case, I think the dropdown interface used for tables is pretty good.

  18. StaggerLeee commented on Jun 26, 2017

    @StaggerLeee

    Do anything but not like old TinyMce table plugin. Anything is welcome. This old one was simply not usable. Not even for experienced editors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Feature] BlocksOverall functionality of blocks[Type] TaskIssues or PRs that have been broken down into an individual action to take

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions