frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Move editor out of MobileSideContent into MobileWorkspace

Open ianyong opened this issue 3 years ago • 0 comments

Description

The following pairs of components are equivalent:

Desktop View Mobile View
Workspace MobileWorkspace
SideContent MobileSideContent

However in the desktop view, the editor is a child of the Workspace component while in the mobile view, the editor is a child of the MobileSideContent component which is in itself a child of the MobileWorkspace component. This results in MobileSideContent not being truly agnostic of the kinds of tabs that are passed in, resulting in tight coupling.

For consistency, as well as to address the tight coupling as mentioned above, the Editor component should be moved out of MobileSideContent into MobileWorkspace. This was done by allowing the body field of SideContentTabs to be null, indicating that no panel should be rendered for the tab. When that happens, the editor that is underneath will be visible.

This also allows us to remove the forced rendering of the editor in the changeTabsCallback of the MobileSideContent component.

Part of the refactoring for #2176.

Type of change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update
  • [x] Code quality improvements

How to test

Use developer tools to set the screen resolution to one that triggers the mobile view.

ianyong avatar Aug 28 '22 09:08 ianyong