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

Collapsible button group in block editor #1332

Merged
merged 9 commits into from Jun 5, 2019

Conversation

kristofferjs
Copy link
Contributor

  • Auto-collapsing groups in toolbar when needed
  • Insert menu supports not being collapsed
  • Display a "show menu" button when there is no room for all
  • Touch scrolling in mobile with paper-cut-shadow™ to show scrollability

@kristofferjs kristofferjs force-pushed the collapsible-button-group-in-block-editor branch from 07cbf51 to 95dd6ec Compare May 23, 2019 13:43
Copy link
Member

@skogsmaskin skogsmaskin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get a studio crash when trying to put the editor in fullscreen (this was with example-studio):

Stack trace:
Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of `Component`.
    at invariant (/static/js/vendor.bundle.js:6457:15)
    at createFiberFromTypeAndProps (/static/js/vendor.bundle.js:16619:11)
    at createFiberFromElement (/static/js/vendor.bundle.js:16640:15)
    at createChild (/static/js/vendor.bundle.js:18427:28)
    at reconcileChildrenArray (/static/js/vendor.bundle.js:18678:25)
    at reconcileChildFibers (/static/js/vendor.bundle.js:19001:14)
    at reconcileChildren (/static/js/vendor.bundle.js:20804:28)
    at updateHostComponent (/static/js/vendor.bundle.js:21265:3)
    at beginWork (/static/js/vendor.bundle.js:22051:14)
    at performUnitOfWork (/static/js/vendor.bundle.js:25714:12)
Component stack:
    in div (created by Component)
    in div (created by Component)
    in Component (created by Measure)
    in Measure (created by Toolbar)
    in Toolbar (created by BlockEditor)
    in div (created by BlockEditor)
    in div (created by BlockEditor)
    in Escapable (created by Stacked)
    in Stacked (created by StackedEscapable)
    in StackedEscapable (created by BlockEditor)
    in Portal (created by BlockEditor)
    in div (created by BlockEditor)
    in BlockEditor (created by BlockEditorInput)
    in div (created by BlockEditorInput)
    in BlockEditorInput (created by SyncWrapper)
    in div (created by SyncWrapper)
    in SyncWrapper (created by withPatches(SyncWrapper))
    in withPatches(SyncWrapper) (created by FunkyEditor)
    in div (created by FunkyEditor)
    in FunkyEditor (created by FormBuilderInput)
    in div (created by FormBuilderInput)
    in FormBuilderInput (created by Field)
    in div (created by Field)
    in Field (created by ObjectInput)
    in div (created by ObjectInput)
    in ObjectInput (created by FormBuilderInput)
    in div (created by FormBuilderInput)
    in FormBuilderInput (created by SanityFormBuilder)
    in FormBuilderContext (created by SanityFormBuilderContext)
    in SanityFormBuilderContext (created by SanityFormBuilder)
    in SanityFormBuilder (created by Editor)
    in form (created by Editor)
    in div (created by Editor)
    in div (created by Pane)
    in div (created by ScrollContainer)
    in ScrollContainer (created by Pane)
    in div (created by Pane)
    in div (created by Pane)
    in Pane (created by Styleable(Pane))
    in Styleable(Pane) (created by Editor)
    in Editor (created by withRouter(Editor))
    in withRouter(Editor) (created by EditorPane)
    in EditorPane (created by withDocumentType(EditorPane))
    in withDocumentType(EditorPane) (created by Pane)
    in Pane (created by DeskToolPanes)
    in SplitPaneWrapper (created by DeskToolPanes)
    in div
    in Pane
    in div
    in SplitPane (created by PanesSplitController)
    in div (created by PanesSplitController)
    in div
    in Pane
    in div
    in SplitPane (created by PanesSplitController)
    in div (created by PanesSplitController)
    in div
    in Pane
    in div
    in SplitPane (created by PanesSplitController)
    in div (created by PanesSplitController)
    in PanesSplitController (created by DeskToolPanes)
    in DeskToolPanes (created by DeskTool)
    in div (created by DeskTool)
    in DeskTool (created by withRouter(DeskTool))
    in withRouter(DeskTool) (created by DeskToolPaneStateSyncer)
    in DeskToolPaneStateSyncer (created by RenderTool)
    in RenderTool (created by SchemaErrorReporter)
    in RouteScope (created by SchemaErrorReporter)
    in div (created by SchemaErrorReporter)
    in div (created by SchemaErrorReporter)
    in div (created by SchemaErrorReporter)
    in SchemaErrorReporter (created by DefaultLayout)
    in DefaultLayout (created by withRouter(DefaultLayout))
    in withRouter(DefaultLayout) (created by DefaultLayoutContainer)
    in RouterProvider (created by DefaultLayoutContainer)
    in LoginWrapper (created by DefaultLayoutContainer)
    in DefaultLayoutContainer (created by SanityRoot)
    in div (created by SanityRoot)
    in SanityRoot
    in AppContainer

@skogsmaskin
Copy link
Member

Also get some warnings about missing React keys:

react-dom.development.js:506 Warning: Each child in a list should have a unique "key" prop. See https://fb.me/react-warning-keys for more information.
    in InsertMenu (created by PrimaryGroup)
    in div (created by PrimaryGroup)
    in div (created by PrimaryGroup)
    in PrimaryGroup (created by Component)
    in div (created by Component)
    in div (created by Component)
    in div (created by Component)
    in Component (created by Measure)
    in Measure (created by Toolbar)
    in Toolbar (created by BlockEditor)

@skogsmaskin
Copy link
Member

Looks really promising! Please fix the above issues, and I'll look closer!

@kristofferjs
Copy link
Contributor Author

Cool!. Will test and debug in example studio

@kristofferjs
Copy link
Contributor Author

Did some fixes. Should also work in example-studio now.

@skogsmaskin
Copy link
Member

@kristofferj - great work!

I'm approving if you remove the flow-bin update to package.json. Not sure which implications it will have.

@kristofferjs kristofferjs force-pushed the collapsible-button-group-in-block-editor branch from ae69ed7 to d63c4f9 Compare May 29, 2019 12:56
@kristofferjs
Copy link
Contributor Author

@skogsmaskin done

@skogsmaskin
Copy link
Member

Approved!

@kristofferjs
Copy link
Contributor Author

Cool. I wait until after the release to merge it, since I want it to be tested more before we merge.

@kristofferjs kristofferjs force-pushed the collapsible-button-group-in-block-editor branch from d63c4f9 to aee6987 Compare June 5, 2019 08:10
@kristofferjs kristofferjs merged commit c0e217e into next Jun 5, 2019
@kristofferjs kristofferjs deleted the collapsible-button-group-in-block-editor branch June 5, 2019 11:24
bjoerge pushed a commit that referenced this pull request Aug 13, 2019
* [form-builder] Add basic collapsible group

* [form-builder] Auto collapse of groups in toolbar

* [components] Pass down props from toggle

* [form-builder] Fix tippy import

* [form-builder] Fix font size

* [form-builder] Keys for renderButton

* [form-builder] Space on top on mobile fullscreen

* [form-builder] Grouping and icon fallback

* [form-builder] Not show style dropdown when only one style
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

Successfully merging this pull request may close these issues.

None yet

2 participants