perf(app): unmount closed review panel (#27221)

This commit is contained in:
Luke Parker
2026-05-13 12:09:34 +10:00
committed by GitHub
parent 0879f5e22d
commit 0f8517208b
2 changed files with 7 additions and 4 deletions

View File

@@ -32,7 +32,7 @@ export interface SessionReviewTabProps {
focusedComment?: { file: string; id: string } | null focusedComment?: { file: string; id: string } | null
onFocusedCommentChange?: (focus: { file: string; id: string } | null) => void onFocusedCommentChange?: (focus: { file: string; id: string } | null) => void
focusedFile?: string focusedFile?: string
onScrollRef?: (el: HTMLDivElement) => void onScrollRef?: (el: HTMLDivElement | undefined) => void
commentMentions?: { commentMentions?: {
items: (query: string) => string[] | Promise<string[]> items: (query: string) => string[] | Promise<string[]>
} }
@@ -126,6 +126,7 @@ export function SessionReviewTab(props: SessionReviewTabProps) {
onCleanup(() => { onCleanup(() => {
if (restoreFrame !== undefined) cancelAnimationFrame(restoreFrame) if (restoreFrame !== undefined) cancelAnimationFrame(restoreFrame)
props.onScrollRef?.(undefined)
}) })
return ( return (

View File

@@ -221,7 +221,8 @@ export function SessionSidePanel(props: {
}} }}
style={{ width: panelWidth() }} style={{ width: panelWidth() }}
> >
<div class="size-full flex border-l border-border-weaker-base"> <Show when={open()}>
<div class="size-full flex border-l border-border-weaker-base">
<div <div
aria-hidden={!reviewOpen()} aria-hidden={!reviewOpen()}
inert={!reviewOpen()} inert={!reviewOpen()}
@@ -313,7 +314,7 @@ export function SessionSidePanel(props: {
<Show when={reviewTab() && props.canReview()}> <Show when={reviewTab() && props.canReview()}>
<Tabs.Content value="review" class="flex flex-col h-full overflow-hidden contain-strict"> <Tabs.Content value="review" class="flex flex-col h-full overflow-hidden contain-strict">
<Show when={activeTab() === "review"}>{props.reviewPanel()}</Show> <Show when={reviewOpen() && activeTab() === "review"}>{props.reviewPanel()}</Show>
</Tabs.Content> </Tabs.Content>
</Show> </Show>
@@ -453,7 +454,8 @@ export function SessionSidePanel(props: {
</Show> </Show>
</div> </div>
</Show> </Show>
</div> </div>
</Show>
</aside> </aside>
</Show> </Show>
) )