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

I can add a table #135

Open
Tracked by #99
djay opened this issue Aug 19, 2024 · 1 comment
Open
Tracked by #99

I can add a table #135

djay opened this issue Aug 19, 2024 · 1 comment

Comments

@djay
Copy link
Member

djay commented Aug 19, 2024

Table in volto and quanta is not a container. It's a special block that only contains slate fields and has it's own UI.

  • it's a little unclear if the bar follows the selected cell or stays at the top of table
    • I'd guess stays at the top of the table... but that could be problem if the table is long as the formatting buttons is now off screen
      • but this would be an issue for other large blocks like a large teaser... so perhaps it should stick to the top of the screen instead of scrolling out of view.

Either we choose to continue doing it like this and invent more ways to make the UI work.
or we make it more like a container that contains rows and rows contain cells.

or there could be ways to support both ways of doing it so integrators could choose when it comes to a custom block.

Solutions considered

table as a container

  • the default block type would mean you could already have slate in every cell which is nice
  • could have "required" mode (ie non editable) for rows and cells so that they are skipped when navigating
    • so Table > Row(required) > Cell (required) > Slate etc
    • then use table settings to change the number of rows and columns.
    • means you can't select or DND cells but thats normal. You can move around blocks between cells.
  • Need a way to have "add row after" etc
    • OR - some special mode where we allow combining parent and child settings?
      • parent can inject actions and schema into children
        • is there any limit on this?
        • should it just be that all containers have all their settings available in all children?
      • but it won't look like quanta because its a slate block having some settings of a table.. not a table having a section for selected block.. so might be
        • Sections: Slate settings, Cell Settings, Row Settings, Table settings?
        • Form Block: Field settings, Form settings?
        • OR keep top level at the top?
          • Table settings, Current Row, Current Cell, Current Slate...
        • and if block has sections? now you have sections inside sections...
    • OR table settings and cell/inside cell settings are seperate and you need to select up and down to get to them. Like you would with grids
      • would at least be consistent?
      • won't work because then you lose the selection of the cell so you can't "add row after"

pros

  • would give flexibility to what a table could contain. cells could contain multiple parapraphs and images etc
  • you can DND cells around... or at least if cells could contain multiple blocks

cons

  • more complex have to navigate outwards to get to table settings.

Cells as fields

  • could have each cell as an editable field, like data-editable-field="rows[1]/cells[3]/value"
    • would need a concept of currently selected editing field. showing that selections and also changing the sidebar to show just selection settings
    • means they can only be slate or simple text
  • need menu system so actions on the table could go from the toolbar and result it changing the structure.

cons

  • you are stuck with slate as the only contents of cells
  • you need the special case slate that allows many lines and headers in the same block

Context

Original quanta table mockups

image

image

image

@djay
Copy link
Member Author

djay commented Sep 17, 2024

I've expanded on the ideas of how containers should show settings in the sidebar in #152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant