From 8fac43950ab9b208bced7e9464e8a6ed1c438b31 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 13 Aug 2026 11:16:08 +0200 Subject: [PATCH] fix(web): restore main's collapse chrome and tab-status keying on the PR panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The round-5 ChatView reconciliation kept the round-3-era PullRequestDetailPanel call, so the panel mounted without chromeVariant="collapse" — the #6039 scroll-condensing chrome never engaged and the description scrolled under a full-height chrome. Restore main's call exactly: collapse chrome, composerDraftTarget for same-thread hand-offs, the isThreadOwnPullRequest context check, and tab statuses keyed by the active surface id via updatePullRequestTabStatus instead of a key rebuilt from the status payload. Co-Authored-By: Claude Fable 5 --- apps/web/src/components/ChatView.tsx | 37 +++++++++++++++++++--------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 22fa9f17c0..6d9c15ab99 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -131,9 +131,9 @@ import { resolveThreadPanelPresentation, } from "../rightPanelLayout"; import { - pullRequestSurfaceId, selectActiveRightPanel, selectActiveRightPanelSurface, + updatePullRequestTabStatus, selectThreadPanelOpen, selectThreadRightPanelState, type RightPanelSurface, @@ -153,6 +153,7 @@ import { selectThreadPreviewMiniPlayer, usePreviewMiniPlayerStore, } from "../previewMiniPlayerStore"; +import { isThreadOwnPullRequest } from "./pullRequest/pullRequestDetail.logic"; import { PullRequestDetailPanel } from "./pullRequest/PullRequestDetailPanel"; import { PullRequestDetailGhost } from "./pullRequest/PullRequestGhosts"; import { PullRequestsUnavailableState } from "./pullRequest/PullRequestsUnavailableState"; @@ -1671,14 +1672,16 @@ function ChatViewContent(props: ChatViewProps) { const [pullRequestTabStatuses, setPullRequestTabStatuses] = useState< Record >({}); - const handlePullRequestTabStatusChange = useCallback((status: PullRequestTabStatus) => { - const id = pullRequestSurfaceId(status); - setPullRequestTabStatuses((current) => - current[id]?.state === status.state && current[id]?.isDraft === status.isDraft - ? current - : { ...current, [id]: status }, - ); - }, []); + const activePullRequestSurfaceId = + activeRightPanelSurface?.kind === "pull-request" ? activeRightPanelSurface.id : undefined; + const handlePullRequestTabStatusChange = useCallback( + (status: PullRequestTabStatus) => { + const id = activePullRequestSurfaceId; + if (id === undefined) return; + setPullRequestTabStatuses((current) => updatePullRequestTabStatus(current, id, status)); + }, + [activePullRequestSurfaceId], + ); const activeFileSurface = activeRightPanelSurface?.kind === "file" ? activeRightPanelSurface : null; const activePreviewState = useThreadPreviewState(activeThreadRef); @@ -6149,11 +6152,23 @@ function ChatViewContent(props: ChatViewProps) { number: activeRightPanelSurface.number, }} context={ - activeThreadPr?.number === activeRightPanelSurface.number && - threadRepository === activeRightPanelSurface.repository + isThreadOwnPullRequest( + { + projectId: activeProject?.id ?? null, + repository: threadRepository, + number: activeThreadPr?.number ?? null, + }, + { + projectId: activeRightPanelSurface.projectId, + repository: activeRightPanelSurface.repository, + number: activeRightPanelSurface.number, + }, + ) ? "thread" : "page" } + chromeVariant="collapse" + composerDraftTarget={composerDraftTarget} onStateChange={handlePullRequestTabStatusChange} /> ) : activeRightPanelSurface?.kind === "agents" ? (