fix(web): restore main's collapse chrome and tab-status keying on the PR panel
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 <[email protected]>
This commit is contained in:
1 parent
0e370e7521
commit
8fac43950a
1 file changed
+26
-11
@@ -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<string, PullRequestTabStatus>
|
||||
>({});
|
||||
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" ? (
|
||||
|
||||
Reference in new issue
Block a user