Improve chat pane handling (#16123)

GitOrigin-RevId: b4185a192b393e339aee8bc27e615d61d66a8b34
This commit is contained in:
Alf Eaton
2023-12-11 09:03:09 +00:00
committed by Copybot
parent 389d16aad1
commit 8c91a2e4cf
2 changed files with 45 additions and 19 deletions
@@ -36,8 +36,11 @@ export const MainLayout: FC = () => {
isOpen: chatIsOpen,
fixedPanelRef: chatPanelRef,
handleLayout: handleChatLayout,
togglePane: toggleChat,
resizing: chatResizing,
setResizing: setChatResizing,
handlePaneCollapse: handleChatCollapse,
handlePaneExpand: handleChatExpand,
} = useChatPane()
const {
@@ -125,23 +128,25 @@ export const MainLayout: FC = () => {
)}
</Panel>
{chatIsOpen && (
<>
<HorizontalResizeHandle onDragging={setChatResizing} />
<HorizontalResizeHandle
onDoubleClick={toggleChat}
resizable={chatIsOpen}
onDragging={setChatResizing}
/>
{/* chat */}
<Panel
ref={chatPanelRef}
id="panel-chat"
order={2}
defaultSizePixels={200}
minSizePixels={150}
collapsible
>
<ChatPane />
</Panel>
</>
)}
{/* chat */}
<Panel
ref={chatPanelRef}
id="panel-chat"
order={2}
defaultSizePixels={200}
minSizePixels={150}
collapsible
onCollapse={handleChatCollapse}
onExpand={handleChatExpand}
>
<ChatPane />
</Panel>
</PanelGroup>
</Panel>
</PanelGroup>