diff --git a/apps/web/src/components/BranchToolbarBranchSelector.tsx b/apps/web/src/components/BranchToolbarBranchSelector.tsx index 12952829566e..434516808aa1 100644 --- a/apps/web/src/components/BranchToolbarBranchSelector.tsx +++ b/apps/web/src/components/BranchToolbarBranchSelector.tsx @@ -749,6 +749,7 @@ export function BranchToolbarBranchSelector({ {displayMode === "panel" && prNumber !== undefined && prUrl !== undefined ? ( ) => void; /** An action changed the pull request on the host, so the vcs status behind the row is stale. */ onActed?: () => void; + /** Set while the server watches this pull request for the thread; stops the watch. */ + onStopWatching?: (() => void) | undefined; }) { const serverConfigs = useServerConfigs(); const supportsPullRequests = @@ -341,6 +351,40 @@ export function ThreadDetailsPrRow({ ); + // The server ends a watch when the pull request closes, so only an open one shows the eye. + // It takes the row's rounded end when nothing follows it. + const watchIsLast = + detail === null || + ((checksRollup === null || conflicting || detail.isDraft) && trailingAction === null); + const watchSegment = + onStopWatching && (detail?.state ?? pr?.state ?? "open") === "open" ? ( + <> +