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, 20:15 UTC
Color settled PR labels on hover (#4451)
Co-authored-by: codex <codex@users.noreply.github.com>
Julius Marminge committed
Jul 24, 2026 at 14:08 UTC
a7ee3092c3c4383a65a16a51de7e0328d6e027c9
3 files changed
+43
-4
apps/web/src/components/SidebarV2.tsx
+7
-2
@@ -117,7 +117,11 @@ import {
117
sortThreadsForSidebarV2,
118
} from "./Sidebar.logic";
119
import { resolveLocalCheckoutBranchMismatch } from "./BranchToolbar.logic";
120
-import { prStatusIndicator, resolveThreadPr } from "./ThreadStatusIndicators";
120
+import {
121
+ prStatusIndicator,
122
+ resolveThreadPr,
123
+ settledPrHoverColorClass,
124
+} from "./ThreadStatusIndicators";
125
import {
126
resolveSnoozePresets,
127
snoozeWakeDescription,
@@ -498,6 +502,7 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {
502
hasDedicatedWorktree: thread.worktreePath !== null,
503
});
504
const prStatus = prStatusIndicator(pr, gitStatus.data?.sourceControlProvider);
505
+ const settledPrHoverClass = pr ? settledPrHoverColorClass(pr.state) : undefined;
506
// Report the PR state up: the parent partitions rows with effectiveSettled,
507
// and a merged/closed PR auto-settles a thread — data only rows have.
508
const prState = pr?.state ?? null;
@@ -714,7 +719,7 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {
719
variant === "slim" && variantAction === "unsettle"
720
? props.isActive
721
? "text-muted-foreground/70"
717
- : "text-muted-foreground/35 transition-colors group-hover/v2-row:text-muted-foreground/65"
722
+ : cn("text-muted-foreground/35 transition-colors", settledPrHoverClass)
723
: prStatus.colorClass,
724
)}
725
aria-label={prStatus.tooltip}
apps/web/src/components/ThreadStatusIndicators.test.ts
+24
-1
@@ -1,7 +1,11 @@
1
import type { VcsStatusResult } from "@t3tools/contracts";
2
import { describe, expect, it } from "vite-plus/test";
3
4
-import { prStatusIndicator, resolveThreadPr } from "./ThreadStatusIndicators";
4
+import {
5
+ prStatusIndicator,
6
+ resolveThreadPr,
7
+ settledPrHoverColorClass,
8
+} from "./ThreadStatusIndicators";
9
10
function status(overrides: Partial<VcsStatusResult> = {}): VcsStatusResult {
11
return {
@@ -70,4 +74,23 @@ describe("prStatusIndicator", () => {
74
tooltipTitle: "PR branch",
75
});
76
});
77
+
78
+ it("uses red for closed pull requests", () => {
79
+ const closedPr = status().pr;
80
+ if (!closedPr) throw new Error("Expected pull request fixture");
81
+
82
+ expect(prStatusIndicator({ ...closedPr, state: "closed" }, undefined)?.colorClass).toContain(
83
+ "text-red-600",
84
+ );
85
+ });
86
+});
87
+
88
+describe("settledPrHoverColorClass", () => {
89
+ it.each([
90
+ ["open", "text-emerald-600"],
91
+ ["merged", "text-violet-600"],
92
+ ["closed", "text-red-600"],
93
+ ] as const)("restores the %s pull request color on row hover", (state, colorClass) => {
94
+ expect(settledPrHoverColorClass(state)).toContain(`group-hover/v2-row:${colorClass}`);
95
+ });
96
});
apps/web/src/components/ThreadStatusIndicators.tsx
+12
-1
@@ -35,6 +35,17 @@ export interface TerminalStatusIndicator {
35
36
export type ThreadPr = VcsStatusResult["pr"];
37
38
+export function settledPrHoverColorClass(state: NonNullable<ThreadPr>["state"]): string {
39
+ switch (state) {
40
+ case "open":
41
+ return "group-hover/v2-row:text-emerald-600 dark:group-hover/v2-row:text-emerald-300/90";
42
+ case "merged":
43
+ return "group-hover/v2-row:text-violet-600 dark:group-hover/v2-row:text-violet-300/90";
44
+ case "closed":
45
+ return "group-hover/v2-row:text-red-600 dark:group-hover/v2-row:text-red-300/90";
46
+ }
47
+}
48
+
49
export function prStatusIndicator(
50
pr: ThreadPr,
51
provider: VcsStatusResult["sourceControlProvider"] | null | undefined,
@@ -65,7 +76,7 @@ export function prStatusIndicator(
76
if (pr.state === "closed") {
77
return {
78
label: `${presentation.shortName} closed`,
68
- colorClass: "text-zinc-500 dark:text-zinc-400/80",
79
+ colorClass: "text-red-600 dark:text-red-300/90",
80
tooltip,
81
tooltipLead,
82
tooltipTitle: pr.title,