Skip to content

Commit 63629ca

Browse files
committed
perf(ui): unmount hidden session panes sooner
1 parent faa3d4c commit 63629ca

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

packages/ui/src/components/instance/instance-shell2.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,10 @@ const InstanceShell2: Component<InstanceShellProps> = (props) => {
482482

483483

484484
const renderRightPanel = () => {
485+
if (!props.isActiveInstance) {
486+
return <RightPanelFallback />
487+
}
488+
485489
if (rightPinned()) {
486490
return (
487491
<Box

packages/ui/src/components/session/session-view.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,10 @@ export const SessionView: Component<SessionViewProps> = (props) => {
328328
if (!activeSession) return null
329329
return (
330330
<div ref={rootRef} class="session-view">
331-
<MessageSection
332-
instanceId={props.instanceId}
333-
sessionId={activeSession.id}
331+
<Show when={isActiveSession()} fallback={<div class="flex-1 min-h-0" />}>
332+
<MessageSection
333+
instanceId={props.instanceId}
334+
sessionId={activeSession.id}
334335
loading={messagesLoading()}
335336
onRevert={handleRevert}
336337
onDeleteMessagesUpTo={handleDeleteMessagesUpTo}
@@ -344,15 +345,12 @@ export const SessionView: Component<SessionViewProps> = (props) => {
344345
}
345346
}
346347
}}
347-
348-
349-
350-
351-
showSidebarToggle={props.showSidebarToggle}
352-
onSidebarToggle={props.onSidebarToggle}
353-
forceCompactStatusLayout={props.forceCompactStatusLayout}
354-
onQuoteSelection={handleQuoteSelection}
355-
/>
348+
showSidebarToggle={props.showSidebarToggle}
349+
onSidebarToggle={props.onSidebarToggle}
350+
forceCompactStatusLayout={props.forceCompactStatusLayout}
351+
onQuoteSelection={handleQuoteSelection}
352+
/>
353+
</Show>
356354

357355

358356
<Show when={isActiveSession()}>

0 commit comments

Comments
 (0)