The best way to control Claude Code, Codex and more from any computer or phone
fix(web): match composer pull request state icons (#9375)
oliver committed
Sep 4, 2026 at 00:57 UTC
706231535ceac8618712913dfdc4a058c2ffb0d8
4 files changed
+43
-8
apps/web/src/components/BranchToolbarBranchSelector.tsx
+5
-1
@@ -745,7 +745,11 @@ export function BranchToolbarBranchSelector({
745
/>
746
}
747
>
748
- <ChangeRequestStatusIcon className="size-3" />
748
+ <ChangeRequestStatusIcon
749
+ state={branchPr.state}
750
+ isDraft={branchPr.isDraft}
751
+ className="size-3"
752
+ />
753
<span
754
data-composer-label
755
className="min-w-0 max-w-12 overflow-hidden group-data-[compact]/composer-context:max-w-0"
apps/web/src/components/LegacySidebar.tsx
+6
-2
@@ -720,7 +720,7 @@ export const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThr
720
onContextMenu={handleRowContextMenu}
721
>
722
<div className="flex min-w-0 flex-1 items-center gap-1.5 text-left">
723
- {prStatus && (
723
+ {prStatus && pr && (
724
<Tooltip>
725
<TooltipTrigger
726
render={
@@ -733,7 +733,11 @@ export const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThr
733
onPointerDown={(event) => event.stopPropagation()}
734
onClick={handlePrClick}
735
>
736
- <ChangeRequestStatusIcon className="size-3" />
736
+ <ChangeRequestStatusIcon
737
+ state={pr.state}
738
+ isDraft={pr.isDraft}
739
+ className="size-3"
740
+ />
741
</a>
742
}
743
/>
apps/web/src/components/ThreadStatusIndicators.test.ts
+18
@@ -2,8 +2,15 @@ import { ProjectId, type PullRequestSummary, type VcsStatusResult } from "@t3too
2
import { describe, expect, it } from "@effect/vitest";
3
import * as Effect from "effect/Effect";
4
import { AtomRegistry } from "effect/unstable/reactivity";
5
+import {
6
+ GitMergeIcon,
7
+ GitPullRequestClosedIcon,
8
+ GitPullRequestDraftIcon,
9
+ GitPullRequestIcon,
10
+} from "lucide-react";
11
12
import {
13
+ ChangeRequestStatusIcon,
14
nextThreadChangeRequestSnapshot,
15
prStatusIndicator,
16
resolveDisplayedThreadPr,
@@ -16,6 +23,17 @@ import {
23
} from "./ThreadStatusIndicators";
24
import { newestPullRequestSummary } from "../state/pullRequests";
25
26
+describe("ChangeRequestStatusIcon", () => {
27
+ it.each([
28
+ ["open", "open", false, GitPullRequestIcon],
29
+ ["draft", "open", true, GitPullRequestDraftIcon],
30
+ ["closed", "closed", false, GitPullRequestClosedIcon],
31
+ ["merged", "merged", false, GitMergeIcon],
32
+ ] as const)("uses the %s pull request glyph", (_label, state, isDraft, expectedIcon) => {
33
+ expect(ChangeRequestStatusIcon({ state, isDraft }).type).toBe(expectedIcon);
34
+ });
35
+});
36
+
37
function status(overrides: Partial<VcsStatusResult> = {}): VcsStatusResult {
38
return {
39
isRepo: true,
apps/web/src/components/ThreadStatusIndicators.tsx
+14
-5
@@ -11,7 +11,7 @@ import {
11
type VcsStatusResult,
12
} from "@t3tools/contracts";
13
import { Atom } from "effect/unstable/reactivity";
14
-import { FolderGit2Icon, GitPullRequestIcon, TerminalIcon } from "lucide-react";
14
+import { FolderGit2Icon, TerminalIcon } from "lucide-react";
15
import { useMemo } from "react";
16
import { appAtomRegistry } from "../rpc/atomRegistry";
17
import { useEnvironment, usePrimaryEnvironmentId } from "../state/environments";
@@ -24,6 +24,7 @@ import { vcsEnvironment } from "../state/vcs";
24
import { useUiStateStore } from "../uiStateStore";
25
import { resolveChangeRequestPresentation } from "../sourceControlPresentation";
26
import { resolveThreadStatusPill, type ThreadStatusPill } from "./Sidebar.logic";
27
+import { resolvePullRequestState } from "./pullRequest/pullRequestPresentation";
28
import type { SidebarThreadSummary } from "../types";
29
import { formatWorktreePathForDisplay } from "../worktreeCleanup";
30
import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";
@@ -155,8 +156,16 @@ export function prStatusIndicator(
156
return null;
157
}
158
158
-export function ChangeRequestStatusIcon({ className }: { className?: string }) {
159
- return <GitPullRequestIcon className={className} />;
159
+export function ChangeRequestStatusIcon({
160
+ state,
161
+ isDraft = false,
162
+ className,
163
+}: Pick<NonNullable<ThreadPr>, "state"> & {
164
+ readonly isDraft?: boolean | undefined;
165
+ readonly className?: string | undefined;
166
+}) {
167
+ const presentation = resolvePullRequestState({ state, isDraft });
168
+ return <presentation.Icon className={className} />;
169
}
170
171
export function PrStatusTooltipContent({ status }: { status: PrStatusIndicator }) {
@@ -585,7 +594,7 @@ export function ThreadRowLeadingStatus({ thread }: { thread: SidebarThreadSummar
594
595
return (
596
<span className="inline-flex shrink-0 items-center gap-1.5">
588
- {prStatus ? (
597
+ {prStatus && pr ? (
598
<Tooltip>
599
<TooltipTrigger
600
render={
@@ -595,7 +604,7 @@ export function ThreadRowLeadingStatus({ thread }: { thread: SidebarThreadSummar
604
/>
605
}
606
>
598
- <ChangeRequestStatusIcon className="size-3" />
607
+ <ChangeRequestStatusIcon state={pr.state} isDraft={pr.isDraft} className="size-3" />
608
</TooltipTrigger>
609
<TooltipPopup side="top">
610
<PrStatusTooltipContent status={prStatus} />