The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 24, 02:45 UTC
fix(web): disable linked pull requests when none are linked (#11348)
maria committed
Sep 11, 2026 at 21:36 UTC
8461c25ffd0a11dfb537b081ed8460283d04f033
3 files changed
+14
-7
apps/web/src/components/ChatView.tsx
+10
-5
@@ -1,4 +1,5 @@
1
import { useLoadBalancedEnvironment } from "../hooks/useLoadBalancedEnvironment";
2
+import { visibleThreadPullRequests } from "@t3tools/shared/threadPullRequests";
3
import type { UsageLimitSourceSnapshots } from "@t3tools/contracts";
4
import {
5
collectProviderUsageLimits,
@@ -4203,10 +4204,14 @@ export default function ChatView(props: ChatViewProps) {
4204
}, [activeThreadRef]);
4205
const supportsThreadPullRequests =
4206
serverConfig?.environment.capabilities.threadPullRequests === true;
4207
+ const pullRequestsSurfaceAvailable =
4208
+ isServerThread &&
4209
+ supportsThreadPullRequests &&
4210
+ visibleThreadPullRequests((activeThreadShell ?? activeThread)?.pullRequests ?? []).length > 0;
4211
const addPullRequestsSurface = useCallback(() => {
4207
- if (!activeThreadRef || !supportsThreadPullRequests) return;
4212
+ if (!activeThreadRef || !pullRequestsSurfaceAvailable) return;
4213
useRightPanelStore.getState().open(activeThreadRef, "pull-requests");
4209
- }, [activeThreadRef, supportsThreadPullRequests]);
4214
+ }, [activeThreadRef, pullRequestsSurfaceAvailable]);
4215
const { state: deviceState, loaded: deviceStateLoaded } = useDeviceState(
4216
activeThreadRef?.environmentId ?? null,
4217
);
@@ -8340,7 +8345,7 @@ export default function ChatView(props: ChatViewProps) {
8345
}
8346
composerDraftTarget={composerDraftTarget}
8347
onBack={
8343
- activeThreadRef !== null && supportsThreadPullRequests
8348
+ activeThreadRef !== null && pullRequestsSurfaceAvailable
8349
? addPullRequestsSurface
8350
: undefined
8351
}
@@ -8981,7 +8986,7 @@ export default function ChatView(props: ChatViewProps) {
8986
diffAvailable={isServerThread && isGitRepo}
8987
filesAvailable={activeProject !== null}
8988
pullRequestAvailable={pullRequestSurfaceAvailable}
8984
- pullRequestsAvailable={isServerThread && supportsThreadPullRequests}
8989
+ pullRequestsAvailable={pullRequestsSurfaceAvailable}
8990
agentsAvailable
8991
deviceAvailable={activeThreadRef !== null}
8992
liveAgentCount={agentPanelModel.liveCount}
@@ -9039,7 +9044,7 @@ export default function ChatView(props: ChatViewProps) {
9044
diffAvailable={isServerThread && isGitRepo}
9045
filesAvailable={activeProject !== null}
9046
pullRequestAvailable={pullRequestSurfaceAvailable}
9042
- pullRequestsAvailable={isServerThread && supportsThreadPullRequests}
9047
+ pullRequestsAvailable={pullRequestsSurfaceAvailable}
9048
agentsAvailable
9049
deviceAvailable={activeThreadRef !== null}
9050
liveAgentCount={agentPanelModel.liveCount}
apps/web/src/components/CommandPalette.tsx
+2
@@ -1,6 +1,7 @@
1
"use client";
2
3
import { threadPullRequestLinkMode } from "@t3tools/client-runtime/thread-pull-request-compatibility";
4
+import { visibleThreadPullRequests } from "@t3tools/shared/threadPullRequests";
5
6
import { scopeProjectRef, scopeThreadRef } from "@t3tools/client-runtime/environment";
7
import {
@@ -1708,6 +1709,7 @@ function OpenCommandPaletteDialog(props: {
1709
value: "action:open-thread-pull-requests",
1710
searchTerms: ["pull requests", "linked", "stack", "prs"],
1711
title: "Show linked pull requests",
1712
+ disabled: visibleThreadPullRequests(activeThread.pullRequests).length === 0,
1713
icon: <GitPullRequestArrowIcon className={ITEM_ICON_CLASS} />,
1714
run: async () => {
1715
useRightPanelStore.getState().open(threadRef, "pull-requests");
apps/web/src/components/RightPanelTabs.tsx
+2
-2
@@ -154,7 +154,7 @@ const SURFACE_DISABLED_REASONS = {
154
files: "Files are only available when a project is open.",
155
diff: "Diff is only available for server threads in Git repositories.",
156
pullRequest: "This thread's branch has no pull request yet.",
157
- pullRequests: "Linked pull requests are only available for server threads.",
157
+ pullRequests: "No linked pull requests are available for this thread.",
158
agents: "Agents are only available from a thread.",
159
device: "Devices are only available from a thread.",
160
} as const;
@@ -178,7 +178,7 @@ const SURFACE_UNAVAILABLE_HINTS = {
178
files: "Available when a project is open.",
179
diff: "Available for Git repositories.",
180
pullRequest: "No pull request on this branch yet.",
181
- pullRequests: "Available for server threads.",
181
+ pullRequests: "No linked pull requests available.",
182
agents: "Available from a thread.",
183
device: "Available from a thread.",
184
} as const;