([])
const [checksLoading, setChecksLoading] = useState(false)
+ const [emptyRefreshing, setEmptyRefreshing] = useState(false)
const [editingTitle, setEditingTitle] = useState(false)
const [titleDraft, setTitleDraft] = useState('')
const [titleSaving, setTitleSaving] = useState(false)
@@ -99,6 +57,13 @@ export default function ChecksPanel(): React.JSX.Element {
const pr: PRInfo | null = prCacheKey ? (prCache[prCacheKey]?.data ?? null) : null
const prNumber = pr?.number ?? null
+ // Fetch PR data when the active worktree/branch changes
+ useEffect(() => {
+ if (repo && branch) {
+ void fetchPRForBranch(repo.path, branch)
+ }
+ }, [repo, branch, fetchPRForBranch])
+
// Fetch checks via cached store method
const fetchChecks = useCallback(async () => {
if (!repo || !prNumber) {
@@ -247,6 +212,20 @@ export default function ChecksPanel(): React.JSX.Element {
Push your branch and open a PR to see checks here
+
)
}
diff --git a/src/renderer/src/components/right-sidebar/checks-helpers.tsx b/src/renderer/src/components/right-sidebar/checks-helpers.tsx
new file mode 100644
index 00000000000..3e06bc93158
--- /dev/null
+++ b/src/renderer/src/components/right-sidebar/checks-helpers.tsx
@@ -0,0 +1,47 @@
+import React from 'react'
+import { CircleCheck, CircleX, LoaderCircle, CircleDashed, CircleMinus } from 'lucide-react'
+import type { PRInfo } from '../../../../shared/types'
+
+export function PullRequestIcon({ className }: { className?: string }): React.JSX.Element {
+ return (
+
+ )
+}
+
+export const CHECK_ICON: Record> = {
+ success: CircleCheck,
+ failure: CircleX,
+ pending: LoaderCircle,
+ neutral: CircleDashed,
+ skipped: CircleMinus,
+ cancelled: CircleX,
+ timed_out: CircleX
+}
+
+export const CHECK_COLOR: Record = {
+ success: 'text-emerald-500',
+ failure: 'text-rose-500',
+ pending: 'text-amber-500',
+ neutral: 'text-muted-foreground',
+ skipped: 'text-muted-foreground/60',
+ cancelled: 'text-muted-foreground/60',
+ timed_out: 'text-rose-500'
+}
+
+export function prStateColor(state: PRInfo['state']): string {
+ switch (state) {
+ case 'merged':
+ return 'bg-purple-500/15 text-purple-500 border-purple-500/20'
+ case 'open':
+ return 'bg-emerald-500/15 text-emerald-500 border-emerald-500/20'
+ case 'closed':
+ return 'bg-muted text-muted-foreground border-border'
+ case 'draft':
+ return 'bg-muted text-muted-foreground/70 border-border'
+ }
+}