diff --git a/apps/web/src/components/BranchToolbarBranchSelector.tsx b/apps/web/src/components/BranchToolbarBranchSelector.tsx index d87f7d638c..3928ae3b46 100644 --- a/apps/web/src/components/BranchToolbarBranchSelector.tsx +++ b/apps/web/src/components/BranchToolbarBranchSelector.tsx @@ -620,14 +620,8 @@ export function BranchToolbarBranchSelector({ startFromOrigin, }); - // PR pill shown next to the branch selector when the active branch has one. - const branchPr = resolveThreadPr({ - threadBranch: resolveBranchToolbarPrBranch({ - activeThreadBranch, - resolvedActiveBranch, - }), - gitStatus: branchStatusQuery.data ?? null, - }); + // Change request state is compact in the composer and gets a dedicated row in the panel. + const branchPr = resolveThreadPr(resolvedActiveBranch, branchStatusQuery.data ?? null); const branchPrStatus = prStatusIndicator(branchPr, branchStatusQuery.data?.sourceControlProvider); // Action-oriented tooltip (the pill opens the PR), distinct from the sidebar's // state-description tooltip. @@ -635,6 +629,12 @@ export function BranchToolbarBranchSelector({ ? `Open ${sourceControlPresentation.terminology.singular} #${branchPr.number} (${branchPr.state})` : ""; const openPrLink = useOpenPrLink(threadRef); + const panelPrStateClass = + branchPr?.state === "open" + ? "bg-emerald-500/10 text-emerald-700 dark:bg-emerald-400/10 dark:text-emerald-300" + : branchPr?.state === "merged" + ? "bg-violet-500/10 text-violet-700 dark:bg-violet-400/10 dark:text-violet-300" + : "bg-muted text-muted-foreground"; function renderPickerItem(itemValue: string, index: number) { if (checkoutPullRequestItemValue && itemValue === checkoutPullRequestItemValue) { @@ -735,12 +735,12 @@ export function BranchToolbarBranchSelector({ >
- {branchPr && branchPrStatus ? ( + {displayMode !== "panel" && branchPr && branchPrStatus ? ( + {displayMode === "panel" && branchPr && branchPrStatus ? ( + + openPrLink(event, branchPrStatus.url)} + /> + } + > + + + View {sourceControlPresentation.terminology.shortLabel} #{branchPr.number} + + + + + {branchPrStatus.tooltip} + + ) : null}
(() => { - const items: ComposerBannerStackItem[] = []; - const updateRunning = serverUpdateState.status === "running"; - const unavailableConnection = activeEnvironmentUnavailableState?.connection ?? null; - const environmentReconnecting = - unavailableConnection !== null && - (unavailableConnection.phase === "connecting" || - unavailableConnection.phase === "reconnecting"); - // Reconnecting to a version-skewed server with no update in flight - // usually means the server is restarting mid-update and a refresh wiped - // the in-memory update state. Fold the reconnect and version banners - // into one calm line instead of stacking "Failed to connect" on - // "versions differ". A failed update never folds: its error and retry - // action must stay visible. - const reconnectingThroughVersionSkew = - serverUpdateState.status === "idle" && environmentReconnecting && versionMismatch !== null; - // While an update runs, transient connect blips are expected (the server - // restarts) and the update banner already shows progress. Hard failure - // phases still surface so the Reconnect action stays reachable. - const suppressUnavailableBanner = - environmentReconnecting && - (updateRunning || (!reconnectingThroughVersionSkew && !reconnectWarningGraceElapsed)); - if (activeEnvironmentUnavailableState && unavailableConnection && !suppressUnavailableBanner) { - if (reconnectingThroughVersionSkew) { - items.push({ - id: `environment-unavailable:${activeEnvironmentUnavailableState.environmentId}`, - variant: "default", - // Live connection status: calm styling, but it must front the stack. - urgent: true, - icon: ( -