From 3da82d5d384a5f45e3e4a9c5bdb8336eb54e49ff Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Mon, 5 Oct 2026 16:16:50 -0700 Subject: [PATCH] feat(web): see and stop pull request watches in the thread details card (#16235) Co-authored-by: Claude Opus 5.5 (1M context) --- .../BranchToolbarBranchSelector.tsx | 1 + .../components/chat/ThreadDetailsPrRow.tsx | 68 ++++++++++++++++++- .../chat/ThreadDetailsPrRows.test.tsx | 61 ++++++++++++++++- .../components/chat/ThreadDetailsPrRows.tsx | 31 ++++++++- docs/user/source-control.md | 3 +- 5 files changed, 157 insertions(+), 7 deletions(-) diff --git a/apps/web/src/components/BranchToolbarBranchSelector.tsx b/apps/web/src/components/BranchToolbarBranchSelector.tsx index 12952829566e192648e63254187c598901bee2b4..434516808aa125ecda543a2e1d9056631f6f803a 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" ? ( + <> +