♻️(frontend) change Panel keepAlive default to false for all side panels

Reverse default behavior for Panel component to unmount content from DOM when
closed instead of keeping it alive. Makes DOM updates more lightweight by
removing unused panel content. Improves performance particularly in complex
room with hundred of participants.

Exception made for chat panel which retains keepAlive=true to preserve
unsent messages that users may want to submit later.
This commit is contained in:
lebaudantoine
2025-04-28 18:00:08 +02:00
committed by aleb_the_flash
parent 94171dcb82
commit 0c811222d4

View File

@@ -113,7 +113,7 @@ type PanelProps = {
keepAlive?: boolean
}
const Panel = ({ isOpen, keepAlive = true, children }: PanelProps) => (
const Panel = ({ isOpen, keepAlive = false, children }: PanelProps) => (
<div
style={{
display: isOpen ? 'inherit' : 'none',
@@ -161,7 +161,7 @@ export const SidePanel = () => {
<Panel isOpen={isEffectsOpen}>
<Effects />
</Panel>
<Panel isOpen={isChatOpen}>
<Panel isOpen={isChatOpen} keepAlive={true}>
<Chat />
</Panel>
<Panel isOpen={isToolsOpen}>