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

[Console] Replace usage of PanelsContainer with OuiResizableContainer. #4273

Open
curq opened this issue Jun 9, 2023 · 2 comments
Open

[Console] Replace usage of PanelsContainer with OuiResizableContainer. #4273

curq opened this issue Jun 9, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request OSCI Open Source Contributor Initiative OUI compliance Issues and PRs to maximize OUI usage and remove style and component hacks

Comments

@curq
Copy link
Collaborator

curq commented Jun 9, 2023

After conducting the audit of the Console plugin #3966, one of the action item was to remove PanelsContainer usage in favor of OuiResizableContainer for better OUI compliance.

<PanelsContainer onPanelWidthChange={onPanelWidthChange} resizerClassName="conApp__resizer">
<Panel
style={{ height: '100%', position: 'relative', minWidth: PANEL_MIN_WIDTH }}
initialWidth={firstPanelWidth}
>
{loading ? (
<EditorContentSpinner />
) : (
<EditorUI initialTextValue={currentTextObject.text} dataSourceId={dataSourceId} />
)}
</Panel>
<Panel
style={{ height: '100%', position: 'relative', minWidth: PANEL_MIN_WIDTH }}
initialWidth={secondPanelWidth}
>
{loading ? <EditorContentSpinner /> : <EditorOutput />}
</Panel>
</PanelsContainer>

This issue tracks the progress on this recommendation.

@curq curq added the enhancement New feature or request label Jun 9, 2023
@curq
Copy link
Collaborator Author

curq commented Jun 9, 2023

I wish to work on this issue.

@manasvinibs manasvinibs added OSCI Open Source Contributor Initiative OUI compliance Issues and PRs to maximize OUI usage and remove style and component hacks labels Jun 12, 2023
@curq
Copy link
Collaborator Author

curq commented Jun 21, 2023

After looking into it, I came to conclusion that this issue is blocked until we move from ace_editor to monaco, because ace_editor styles are not compatible with OuiResizableContainer, specifically the console output doesn't render at all due to them. I tried working around / disabling the styles and it started rendering, but it was still broken and unusable. So it is better to wait for migration to monaco.


Another important finding is that OuiResizableContainer is not utilised. Only vis_builder plugin currently uses it.

<EuiResizableContainer className="vbLayout__resizeContainer">
{(EuiResizablePanel, EuiResizableButton) => (
<>
<EuiResizablePanel
className="vbLayout__workspaceResize"
paddingSize="none"
initialSize={80}
minSize="300px"
mode="main"
>
<Workspace />
</EuiResizablePanel>
<EuiResizableButton className="vbLayout__resizeButton" />
<EuiResizablePanel
className="vbLayout__rightNavResize"
paddingSize="none"
initialSize={20}
minSize="250px"
mode={[
'collapsible',
{
position: 'top',
},
]}
id="vbRightResize"
>
<RightNav />
</EuiResizablePanel>
</>
)}
</EuiResizableContainer>

In other cases default_editor is used, which uses PanelsContainer under the hood.
<PanelsContainer
className="visEditor--default"
resizerClassName={`visEditor__resizer ${
isCollapsed ? 'visEditor__resizer-isHidden' : ''
}`}
>
<Panel className="visEditor__visualization" initialWidth={100 - editorInitialWidth}>
<div className="visEditor__canvas" ref={visRef} data-shared-items-container />
</Panel>
<Panel
className={`visEditor__collapsibleSidebar ${
isCollapsed ? 'visEditor__collapsibleSidebar-isClosed' : ''
}`}
initialWidth={editorInitialWidth}
>
<DefaultEditorSideBar
embeddableHandler={embeddableHandler}
isCollapsed={isCollapsed}
onClickCollapse={onClickCollapse}
vis={vis}
uiState={uiState}
isLinkedSearch={linked}
savedSearch={savedSearch}
timeRange={timeRange}
eventEmitter={eventEmitter}
/>
</Panel>
</PanelsContainer>

Example of plugins affected: vis_type_markdown, vis_type_markdown. It is likely any plugin except vis_builder uses it instead of OuiResizableContainer

I did not find other OuiResizableContainer instances, and we probably should look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request OSCI Open Source Contributor Initiative OUI compliance Issues and PRs to maximize OUI usage and remove style and component hacks
Projects
None yet
Development

No branches or pull requests

2 participants