From 8578146fb91f80d6860f982da46d3b2cfc72e25c Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 20 Feb 2026 00:21:21 +0000 Subject: [PATCH] Fix findLatestPr to prioritize open PRs and remove unused icon imports - findLatestPr: sort open PRs before merged/closed so the UI correctly detects existing open PRs and avoids offering duplicate 'Create PR' - Sidebar: remove unused MonitorIcon, MoonIcon, SunIcon imports --- apps/server/src/gitManager.ts | 3 +++ apps/web/src/components/Sidebar.tsx | 8 +------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/server/src/gitManager.ts b/apps/server/src/gitManager.ts index 8aaf529115..bf20881fee 100644 --- a/apps/server/src/gitManager.ts +++ b/apps/server/src/gitManager.ts @@ -458,6 +458,9 @@ export class GitManager { } const parsed = parsePullRequestList(parsedJson).toSorted((a, b) => { + const aOpen = a.state === "open" ? 1 : 0; + const bOpen = b.state === "open" ? 1 : 0; + if (aOpen !== bOpen) return bOpen - aOpen; const left = a.updatedAt ? Date.parse(a.updatedAt) : 0; const right = b.updatedAt ? Date.parse(b.updatedAt) : 0; return right - left; diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 34ffe14f04..7d19c3feca 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -1,10 +1,4 @@ -import { - GitPullRequestIcon, - MonitorIcon, - MoonIcon, - SunIcon, - TerminalIcon, -} from "lucide-react"; +import { GitPullRequestIcon, TerminalIcon } from "lucide-react"; import { useCallback, useEffect, useMemo, useState } from "react"; import type { ResolvedKeybindingsConfig } from "@t3tools/contracts"; import { useMutation, useQueries, useQuery, useQueryClient } from "@tanstack/react-query";