From cc1256d6ecb63dbb6cd53b8e44d25e2977d32ed3 Mon Sep 17 00:00:00 2001
From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com>
Date: Wed, 25 Mar 2026 15:49:37 -0400
Subject: [PATCH] Add run history tab to GlobalSchedules page
Extract RunDetailPanel, create RunHistoryCards component, add runs tab with filtering
---
frontend/src/api/schedules.ts | 27 +
.../components/schedules/RunDetailPanel.tsx | 82 ++
.../components/schedules/RunHistoryCards.tsx | 131 +++
.../components/schedules/RunHistoryTab.tsx | 221 +----
frontend/src/components/schedules/index.ts | 2 +
frontend/src/hooks/useSchedules.ts | 15 +-
frontend/src/pages/GlobalSchedules.tsx | 920 ++++++++++++------
7 files changed, 887 insertions(+), 511 deletions(-)
create mode 100644 frontend/src/components/schedules/RunDetailPanel.tsx
create mode 100644 frontend/src/components/schedules/RunHistoryCards.tsx
diff --git a/frontend/src/api/schedules.ts b/frontend/src/api/schedules.ts
index 26bab949..c09684d8 100644
--- a/frontend/src/api/schedules.ts
+++ b/frontend/src/api/schedules.ts
@@ -13,6 +13,21 @@ export interface ScheduleJobWithRepo extends ScheduleJob {
repoUrl: string
}
+export interface ScheduleRunWithContext extends ScheduleRun {
+ jobName: string
+ repoName: string
+ repoPath: string
+}
+
+export interface ListAllRunsParams {
+ limit?: number
+ offset?: number
+ status?: string
+ repoId?: number
+ jobId?: number
+ triggerSource?: string
+}
+
export interface ScheduleCount {
total: number
enabled: number
@@ -22,6 +37,18 @@ export async function listAllSchedules(): Promise<{ jobs: ScheduleJobWithRepo[]
return fetchWrapper(`${API_BASE_URL}/api/schedules/all`)
}
+export async function listAllScheduleRuns(params: ListAllRunsParams = {}): Promise<{ runs: ScheduleRunWithContext[] }> {
+ const searchParams = new URLSearchParams()
+ if (params.limit !== undefined) searchParams.set('limit', String(params.limit))
+ if (params.offset !== undefined) searchParams.set('offset', String(params.offset))
+ if (params.status) searchParams.set('status', params.status)
+ if (params.repoId !== undefined) searchParams.set('repoId', String(params.repoId))
+ if (params.jobId !== undefined) searchParams.set('jobId', String(params.jobId))
+ if (params.triggerSource) searchParams.set('triggerSource', params.triggerSource)
+ const qs = searchParams.toString()
+ return fetchWrapper(`${API_BASE_URL}/api/schedules/all/runs${qs ? `?${qs}` : ''}`)
+}
+
export async function listRepoSchedules(repoId: number): Promise<{ jobs: ScheduleJob[] }> {
return fetchWrapper(`${API_BASE_URL}/api/repos/${repoId}/schedules`)
}
diff --git a/frontend/src/components/schedules/RunDetailPanel.tsx b/frontend/src/components/schedules/RunDetailPanel.tsx
new file mode 100644
index 00000000..1a0f4206
--- /dev/null
+++ b/frontend/src/components/schedules/RunDetailPanel.tsx
@@ -0,0 +1,82 @@
+import { useNavigate } from 'react-router-dom'
+import { Button } from '@/components/ui/button'
+import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
+import { ScheduleRunMarkdown } from '@/components/schedules/ScheduleRunMarkdown'
+import { Loader2 } from 'lucide-react'
+import type { ScheduleRun } from '@opencode-manager/shared/types'
+
+interface RunDetailPanelProps {
+ repoId: number
+ activeRun: ScheduleRun | null
+ selectedRunLoading: boolean
+ onCancelRun: () => void
+ cancelRunPending: boolean
+}
+
+export function RunDetailPanel({ repoId, activeRun, selectedRunLoading, onCancelRun, cancelRunPending }: RunDetailPanelProps) {
+ const navigate = useNavigate()
+
+ if (selectedRunLoading && !activeRun) {
+ return (
+
+
+
+ )
+ }
+
+ if (!activeRun) {
+ return Select a run to inspect logs and output.
+ }
+
+ return (
+
+
+
+ Log
+ Assistant Output
+ {activeRun.status === 'cancelled' ? 'Details' : 'Error'}
+
+
+ {(activeRun.status === 'running' || activeRun.sessionId || activeRun.responseText) && (
+
+
+ {activeRun.sessionId && (
+ navigate(`/repos/${repoId}/sessions/${activeRun.sessionId}`)}>
+ Open session
+
+ )}
+
+
+ {cancelRunPending ? : null}
+ Cancel run
+
+
+ )}
+
+ {selectedRunLoading && !activeRun ? (
+
+ ) : (
+ {activeRun.logText ?? 'No log text captured.'}
+ )}
+
+
+ {selectedRunLoading && !activeRun ? (
+
+ ) : activeRun.responseText ? (
+
+
+
+ ) : (
+ No assistant output captured.
+ )}
+
+
+ {selectedRunLoading && !activeRun ? (
+
+ ) : (
+ {activeRun.errorText ?? 'No error recorded.'}
+ )}
+
+
+ )
+}
diff --git a/frontend/src/components/schedules/RunHistoryCards.tsx b/frontend/src/components/schedules/RunHistoryCards.tsx
new file mode 100644
index 00000000..0306b74c
--- /dev/null
+++ b/frontend/src/components/schedules/RunHistoryCards.tsx
@@ -0,0 +1,131 @@
+import { useState } from 'react'
+import { Badge } from '@/components/ui/badge'
+import { History, Loader2, XCircle, CheckCircle2, Ban, ChevronDown } from 'lucide-react'
+import type { ScheduleRun } from '@opencode-manager/shared/types'
+import type { ScheduleRunWithContext } from '@/api/schedules'
+import { getRunTone } from '@/components/schedules/schedule-utils'
+import { RunDetailPanel } from '@/components/schedules/RunDetailPanel'
+import { useRepoScheduleRun } from '@/hooks/useSchedules'
+
+interface RunHistoryCardsProps {
+ runs: ScheduleRunWithContext[] | undefined
+ runsLoading: boolean
+ onSelectRun: (id: number) => void
+ onCancelRun: () => void
+ cancelRunPending: boolean
+}
+
+export function RunHistoryCards({
+ runs,
+ runsLoading,
+ onSelectRun,
+ onCancelRun,
+ cancelRunPending,
+}: RunHistoryCardsProps) {
+ const [expandedRunId, setExpandedRunId] = useState(null)
+ const [expandedRunRepoId, setExpandedRunRepoId] = useState(null)
+ const [expandedRunJobId, setExpandedRunJobId] = useState(null)
+
+ const { data: runDetail, isLoading } = useRepoScheduleRun(
+ expandedRunRepoId ?? undefined,
+ expandedRunJobId,
+ expandedRunId
+ )
+
+ function getRunStatusIcon(status: ScheduleRun['status']) {
+ if (status === 'completed') return
+ if (status === 'failed') return
+ if (status === 'running') return
+ return
+ }
+
+ function handleCardClick(runId: number, repoId: number, jobId: number) {
+ if (expandedRunId === runId) {
+ setExpandedRunId(null)
+ setExpandedRunRepoId(null)
+ setExpandedRunJobId(null)
+ } else {
+ setExpandedRunId(runId)
+ setExpandedRunRepoId(repoId)
+ setExpandedRunJobId(jobId)
+ onSelectRun(runId)
+ }
+ }
+
+ if (runsLoading) {
+ return (
+
+
+
+ )
+ }
+
+ if (!runs?.length) {
+ return (
+
+
+
+
No runs yet
+
Use Run now to generate the first execution record and log bundle.
+
+
+ )
+ }
+
+ return (
+
+
+ {runs.map((run, index) => {
+ const isExpanded = expandedRunId === run.id
+ const displayRun = isExpanded && runDetail ? runDetail : run
+
+ return (
+
+
handleCardClick(run.id, run.repoId, run.jobId)}
+ className="w-full px-3 py-2 text-left flex items-center justify-between gap-2"
+ >
+
+
+
+ {getRunStatusIcon(run.status)}
+ {run.status}
+
+
{run.triggerSource}
+
+
+ {run.sessionTitle ?? 'No session recorded'}
+
+
{new Date(run.startedAt).toLocaleString()}
+ {run.errorText && (
+
{run.errorText}
+ )}
+
+
+
+ {isExpanded && (
+
+ )}
+
+ )
+ })}
+
+
+ )
+}
diff --git a/frontend/src/components/schedules/RunHistoryTab.tsx b/frontend/src/components/schedules/RunHistoryTab.tsx
index 3ab2b093..4dff1640 100644
--- a/frontend/src/components/schedules/RunHistoryTab.tsx
+++ b/frontend/src/components/schedules/RunHistoryTab.tsx
@@ -1,135 +1,31 @@
import type { ScheduleJob, ScheduleRun } from '@opencode-manager/shared/types'
-import { useState } from 'react'
-import { useNavigate } from 'react-router-dom'
import { Card, CardContent } from '@/components/ui/card'
-import { Button } from '@/components/ui/button'
-import { Badge } from '@/components/ui/badge'
-import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
-import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'
-import { ScheduleRunMarkdown } from '@/components/schedules/ScheduleRunMarkdown'
-import { getRunTone } from '@/components/schedules/schedule-utils'
-import { Ban, CheckCircle2, ChevronDown, History, Loader2, XCircle } from 'lucide-react'
+import { History, Loader2 } from 'lucide-react'
+import { RunHistoryCards, RunDetailPanel } from '@/components/schedules'
interface RunHistoryTabProps {
repoId: number
selectedJob: ScheduleJob | undefined
runs: ScheduleRun[] | undefined
runsLoading: boolean
- selectedRunId: number | null
+ activeRun: ScheduleRun | null
+ selectedRunLoading: boolean
onSelectRun: (id: number) => void
- activeRun: ScheduleRun | null
- selectedRunLoading: boolean
onCancelRun: () => void
cancelRunPending: boolean
}
-interface RunDetailPanelProps {
- repoId: number
- activeRun: ScheduleRun | null
- selectedRunLoading: boolean
- onCancelRun: () => void
- cancelRunPending: boolean
-}
-
-function RunDetailPanel({ repoId, activeRun, selectedRunLoading, onCancelRun, cancelRunPending }: RunDetailPanelProps) {
- const navigate = useNavigate()
-
- if (selectedRunLoading && !activeRun) {
- return (
-
-
-
- )
- }
-
- if (!activeRun) {
- return Select a run to inspect logs and output.
- }
-
- return (
-
-
-
- Log
- Assistant Output
- {activeRun.status === 'cancelled' ? 'Details' : 'Error'}
-
-
- {(activeRun.status === 'running' || activeRun.sessionId || activeRun.responseText) && (
-
-
- {activeRun.sessionId && (
- navigate(`/repos/${repoId}/sessions/${activeRun.sessionId}`)}>
- Open session
-
- )}
-
-
- {cancelRunPending ? : null}
- Cancel run
-
-
- )}
-
- {selectedRunLoading && !activeRun ? (
-
- ) : (
- {activeRun.logText ?? 'No log text captured.'}
- )}
-
-
- {selectedRunLoading && !activeRun ? (
-
- ) : activeRun.responseText ? (
-
-
-
- ) : (
- No assistant output captured.
- )}
-
-
- {selectedRunLoading && !activeRun ? (
-
- ) : (
- {activeRun.errorText ?? 'No error recorded.'}
- )}
-
-
- )
-}
-
export function RunHistoryTab({
repoId,
selectedJob,
runs,
runsLoading,
- selectedRunId,
onSelectRun,
activeRun,
selectedRunLoading,
onCancelRun,
cancelRunPending,
}: RunHistoryTabProps) {
- const [expandedRunId, setExpandedRunId] = useState(null)
-
-
- function getRunStatusIcon(status: ScheduleRun['status']) {
- if (status === 'completed') return
- if (status === 'failed') return
- if (status === 'running') return
- return
- }
-
- function handleCardClick(runId: number) {
- if (expandedRunId === runId) {
- setExpandedRunId(null)
- } else {
- setExpandedRunId(runId)
- onSelectRun(runId)
- }
- }
-
if (!selectedJob) {
if (selectedRunLoading) {
return (
@@ -154,108 +50,14 @@ export function RunHistoryTab({
return (
+
- {/* Mobile: collapsible list (hidden on xl+) */}
-
-
- {runsLoading ? (
-
- ) : runs?.length ? runs.map((run, index) => (
-
-
handleCardClick(run.id)}
- className="w-full px-3 py-2 text-left flex items-center justify-between gap-2"
- >
-
-
-
- {getRunStatusIcon(run.status)}
- {run.status}
-
-
{run.triggerSource}
-
-
- {run.sessionTitle ?? 'No session recorded'}
-
-
{new Date(run.startedAt).toLocaleString()}
- {run.errorText && (
-
{run.errorText}
- )}
-
-
-
- {expandedRunId === run.id && (
-
- )}
-
- )) : (
-
-
- No runs yet
- Use Run now to generate the first execution record and log bundle.
-
- )}
-
-
-
- {/* Desktop: original two-column layout (hidden below xl) */}
-
- {runsLoading ? (
-
- ) : runs?.length ? runs.map((run) => (
-
onSelectRun(run.id)}
- className={`w-full rounded-xl border px-4 py-3 text-left transition-all ${
- selectedRunId === run.id
- ? 'border-primary bg-primary/10 ring-2 ring-primary/30'
- : 'border-border/70 bg-background/60 hover:bg-accent/40'
- }`}
- >
-
-
- {getRunStatusIcon(run.status)}
- {run.status}
-
-
{run.triggerSource}
-
-
- {run.sessionTitle ?? 'No session recorded'}
-
- {new Date(run.startedAt).toLocaleString()}
- {run.errorText && (
- {run.errorText}
- )}
-
- )) : (
-
-
- No runs yet
- Use Run now to generate the first execution record and log bundle.
-
- )}
-
-
- {/* Desktop: detail panel (hidden below xl) */}
-
)
diff --git a/frontend/src/components/schedules/index.ts b/frontend/src/components/schedules/index.ts
index 7880aa91..19bc48ae 100644
--- a/frontend/src/components/schedules/index.ts
+++ b/frontend/src/components/schedules/index.ts
@@ -1,6 +1,8 @@
export { JobsTab } from './JobsTab'
export { JobDetailTab } from './JobDetailTab'
export { RunHistoryTab } from './RunHistoryTab'
+export { RunHistoryCards } from './RunHistoryCards'
+export { RunDetailPanel } from './RunDetailPanel'
export { ScheduleJobDialog } from './ScheduleJobDialog'
export { ScheduleRunMarkdown } from './ScheduleRunMarkdown'
export { ScheduleTabMenu } from './ScheduleTabMenu'
diff --git a/frontend/src/hooks/useSchedules.ts b/frontend/src/hooks/useSchedules.ts
index 7ff77193..a8b6ac91 100644
--- a/frontend/src/hooks/useSchedules.ts
+++ b/frontend/src/hooks/useSchedules.ts
@@ -6,6 +6,7 @@ import {
deleteRepoSchedule,
getRepoSchedule,
getRepoScheduleRun,
+ listAllScheduleRuns,
listAllSchedules,
listRepoScheduleRuns,
listRepoSchedules,
@@ -13,7 +14,7 @@ import {
updateRepoSchedule,
} from '@/api/schedules'
import { showToast } from '@/lib/toast'
-import type { ScheduleJobWithRepo } from '@/api/schedules'
+import type { ListAllRunsParams, ScheduleJobWithRepo, ScheduleRunWithContext } from '@/api/schedules'
export function useAllSchedules() {
return useQuery({
@@ -25,6 +26,18 @@ export function useAllSchedules() {
})
}
+export function useAllScheduleRuns(params: ListAllRunsParams, enabled: boolean = true) {
+ return useQuery({
+ queryKey: ['all-schedule-runs', params],
+ queryFn: async () => {
+ const response = await listAllScheduleRuns(params)
+ return response.runs as ScheduleRunWithContext[]
+ },
+ enabled,
+ refetchInterval: 5000,
+ })
+}
+
export function useRepoSchedules(repoId: number | undefined) {
return useQuery({
queryKey: ['repo-schedules', repoId],
diff --git a/frontend/src/pages/GlobalSchedules.tsx b/frontend/src/pages/GlobalSchedules.tsx
index a491782c..88eee3ab 100644
--- a/frontend/src/pages/GlobalSchedules.tsx
+++ b/frontend/src/pages/GlobalSchedules.tsx
@@ -1,8 +1,8 @@
-import { useState, useMemo } from 'react'
+import { useState, useMemo, useEffect, useRef } from 'react'
import { useNavigate } from 'react-router-dom'
-import { useAllSchedules } from '@/hooks/useSchedules'
+import { useAllSchedules, useAllScheduleRuns, useCancelRepoScheduleRun } from '@/hooks/useSchedules'
import { useDeleteRepoSchedule, useRunRepoSchedule, useUpdateRepoSchedule, useCreateRepoSchedule } from '@/hooks/useSchedules'
-import { ScheduleJobDialog } from '@/components/schedules'
+import { ScheduleJobDialog, RunHistoryCards } from '@/components/schedules'
import type { CreateScheduleJobRequest } from '@opencode-manager/shared/types'
import { toUpdateScheduleRequest, formatScheduleShortLabel, getJobStatusTone, formatTimestamp } from '@/components/schedules/schedule-utils'
import { Header } from '@/components/ui/header'
@@ -11,9 +11,10 @@ import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuChe
import { Badge } from '@/components/ui/badge'
import { Card, CardContent } from '@/components/ui/card'
import { DeleteDialog } from '@/components/ui/delete-dialog'
+import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
import { CalendarClock, Loader2, Plus, ArrowLeft, Play, Pencil, Trash2, Pause, PlayCircle, Clock3, History, SlidersHorizontal } from 'lucide-react'
-import type { ScheduleJobWithRepo } from '@/api/schedules'
+import type { ScheduleJobWithRepo, ScheduleRunWithContext } from '@/api/schedules'
import { Combobox } from '@/components/ui/combobox'
type StatusFilter = 'all' | 'enabled' | 'disabled'
@@ -30,14 +31,80 @@ export function GlobalSchedules() {
const [scheduleModeFilter, setScheduleModeFilter] = useState('all')
const [repoFilter, setRepoFilter] = useState('all')
const [sortOption, setSortOption] = useState('nextRun')
+ const [activeTab, setActiveTab] = useState<'jobs' | 'runs'>('jobs')
+ const [runStatusFilter, setRunStatusFilter] = useState('all')
+ const [runRepoFilter, setRunRepoFilter] = useState('all')
+ const [runTriggerFilter, setRunTriggerFilter] = useState('all')
+ const [runSortOption, setRunSortOption] = useState<'startedAt' | 'jobName' | 'duration'>('startedAt')
+ const [runOffset, setRunOffset] = useState(0)
+ const [allRuns, setAllRuns] = useState([])
+ const [selectedRunId, setSelectedRunId] = useState(null)
+ const runOffsetRef = useRef(runOffset)
+
+ const cancelRunMutation = useCancelRepoScheduleRun()
+ const cancelRunPending = cancelRunMutation.isPending
+
+ useEffect(() => {
+ runOffsetRef.current = runOffset
+ }, [runOffset])
const { data: jobs = [], isLoading, error } = useAllSchedules()
+ const runsParams = useMemo(() => ({
+ limit: 50,
+ offset: runOffset,
+ status: runStatusFilter !== 'all' ? runStatusFilter : undefined,
+ repoId: runRepoFilter !== 'all' ? Number(runRepoFilter.split('|')[0]) : undefined,
+ triggerSource: runTriggerFilter !== 'all' ? runTriggerFilter : undefined,
+ }), [runStatusFilter, runRepoFilter, runTriggerFilter, runOffset])
+
+ const { data: runsPage = [], isLoading: runsLoading } = useAllScheduleRuns(runsParams, activeTab === 'runs')
+
const createMutation = useCreateRepoSchedule()
const deleteMutation = useDeleteRepoSchedule()
const runMutation = useRunRepoSchedule()
const updateMutation = useUpdateRepoSchedule()
+ useEffect(() => {
+ setRunOffset(0)
+ setAllRuns([])
+ }, [runStatusFilter, runRepoFilter, runTriggerFilter])
+
+ useEffect(() => {
+ if (runsPage.length > 0) {
+ if (runOffsetRef.current === 0) {
+ setAllRuns(runsPage)
+ } else {
+ setAllRuns((prev) => {
+ const existingIds = new Set(prev.map((r) => r.id))
+ const newRuns = runsPage.filter((r) => !existingIds.has(r.id))
+ return newRuns.length > 0 ? [...prev, ...newRuns] : prev
+ })
+ }
+ } else if (runOffsetRef.current === 0) {
+ setAllRuns((prev) => prev.length > 0 ? [] : prev)
+ }
+ }, [runsPage])
+
+ const sortedRuns = useMemo(() => {
+ const sorted = [...allRuns]
+ sorted.sort((a, b) => {
+ switch (runSortOption) {
+ case 'jobName':
+ return a.jobName.localeCompare(b.jobName)
+ case 'duration': {
+ const aDuration = a.finishedAt ? a.finishedAt - a.startedAt : 0
+ const bDuration = b.finishedAt ? b.finishedAt - b.startedAt : 0
+ return bDuration - aDuration
+ }
+ case 'startedAt':
+ default:
+ return new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime()
+ }
+ })
+ return sorted
+ }, [allRuns, runSortOption])
+
const uniqueRepos = useMemo(() => {
const repoMap = new Map()
jobs.forEach((job) => {
@@ -125,6 +192,35 @@ export function GlobalSchedules() {
{ value: 'repo', label: 'Repository' },
], [])
+ const runStatusOptions = useMemo(() => [
+ { value: 'all', label: 'All Status' },
+ { value: 'running', label: 'Running' },
+ { value: 'completed', label: 'Completed' },
+ { value: 'failed', label: 'Failed' },
+ { value: 'cancelled', label: 'Cancelled' },
+ ], [])
+
+ const runTriggerOptions = useMemo(() => [
+ { value: 'all', label: 'All Triggers' },
+ { value: 'manual', label: 'Manual' },
+ { value: 'schedule', label: 'Scheduled' },
+ ], [])
+
+ const runSortOptions = useMemo(() => [
+ { value: 'startedAt', label: 'Date' },
+ { value: 'jobName', label: 'Job Name' },
+ { value: 'duration', label: 'Duration' },
+ ], [])
+
+ const runRepoOptions = useMemo(() => [
+ { value: 'all', label: 'All Repos', description: '' },
+ ...uniqueRepos.map((repo) => ({
+ value: `${jobs.find((j) => j.repoPath === repo.path)?.repoId ?? 0}|${repo.path}`,
+ label: repo.name,
+ description: repo.path,
+ })),
+ ], [uniqueRepos, jobs])
+
const handleDelete = () => {
if (!deletingJob) {
return
@@ -136,6 +232,10 @@ export function GlobalSchedules() {
)
}
+ const handleCancelRun = (repoId: number, jobId: number, runId: number) => {
+ cancelRunMutation.mutate({ repoId, jobId, runId })
+ }
+
const handleToggleEnabled = (job: ScheduleJobWithRepo) => {
updateMutation.mutate({
repoId: job.repoId,
@@ -248,314 +348,534 @@ export function GlobalSchedules() {
-
-
-
Filter by repo:
-
-
-
-
-
- {(statusFilter !== 'all' || scheduleModeFilter !== 'all') && (
-
- )}
-
-
-
- {
- setStatusFilter('all')
- setScheduleModeFilter('all')
- setRepoFilter('all')
- setSortOption('nextRun')
- }}
- className="text-xs text-muted-foreground"
- >
- Clear all filters
-
-
- Status
- setStatusFilter('all')}
- onSelect={(e) => e.preventDefault()}
- >
- All Status
-
- {statusOptions.filter((opt) => opt.value !== 'all').map((opt) => (
- {
- if (checked) {
- setStatusFilter(opt.value as StatusFilter)
- } else {
+ setActiveTab(v as 'jobs' | 'runs')} className="flex-1 min-h-0 flex flex-col overflow-hidden">
+
+
+
+ Jobs
+
+
+ Run History
+
+
+
+
+
+
+
+ Filter by repo:
+
+
+
+
+
+ {(statusFilter !== 'all' || scheduleModeFilter !== 'all') && (
+
+ )}
+
+
+
+ {
setStatusFilter('all')
- }
- }}
- onSelect={(e) => e.preventDefault()}
- >
- {opt.label}
-
- ))}
-
- Mode
- setScheduleModeFilter('all')}
- onSelect={(e) => e.preventDefault()}
- >
- All Modes
-
- {modeOptions.filter((opt) => opt.value !== 'all').map((opt) => (
- {
- if (checked) {
- setScheduleModeFilter(opt.value as ScheduleModeFilter)
- } else {
setScheduleModeFilter('all')
- }
- }}
- onSelect={(e) => e.preventDefault()}
- >
- {opt.label}
-
- ))}
-
- Sort
- setSortOption(v as SortOption)}>
- {sortOptions.map((opt) => (
-
+ Clear all filters
+
+
+ Status
+ setStatusFilter('all')}
onSelect={(e) => e.preventDefault()}
>
- {opt.label}
-
- ))}
-
-
-
-
-
-
-
Status:
-
- {statusOptions.map((opt) => (
- setStatusFilter(opt.value as StatusFilter)}
- className="h-8 px-3 text-xs"
- >
- {opt.label}
-
- ))}
-
-
-
-
Mode:
-
- {modeOptions.map((opt) => (
- setScheduleModeFilter(opt.value as ScheduleModeFilter)}
- className="h-8 px-3 text-xs"
- >
- {opt.label}
-
- ))}
-
-
-
-
Sort:
-
- {sortOptions.map((opt) => (
- setSortOption(opt.value as SortOption)}
- className="h-8 px-3 text-xs"
- >
- {opt.label}
-
- ))}
-
-
-
-
-
-
- {!hasJobs ? (
-
-
-
-
-
-
-
-
No schedules yet
-
- Create schedules for your repositories to automate recurring agent work.
-
-
- navigate('/')}>
-
- Go to Repositories
-
-
-
-
- ) : filteredAndSortedJobs.length === 0 ? (
-
-
-
-
-
-
-
-
No matching schedules
-
- Try adjusting your filters to see more results.
-
-
- {
- setStatusFilter('all')
- setScheduleModeFilter('all')
- setRepoFilter('all')
- }}
- >
- Clear Filters
-
-
-
-
- ) : (
-
- {filteredAndSortedJobs.map((job) => (
-
navigate(`/repos/${job.repoId}/schedules`)}
- >
-
-
-
-
{
- e.stopPropagation()
- handleNavigateToRepo(job.repoPath)
- }}
- className="text-xs text-muted-foreground hover:text-foreground hover:underline truncate block mb-1"
+ All Status
+
+ {statusOptions.filter((opt) => opt.value !== 'all').map((opt) => (
+ {
+ if (checked) {
+ setStatusFilter(opt.value as StatusFilter)
+ } else {
+ setStatusFilter('all')
+ }
+ }}
+ onSelect={(e) => e.preventDefault()}
+ >
+ {opt.label}
+
+ ))}
+
+ Mode
+ setScheduleModeFilter('all')}
+ onSelect={(e) => e.preventDefault()}
+ >
+ All Modes
+
+ {modeOptions.filter((opt) => opt.value !== 'all').map((opt) => (
+ {
+ if (checked) {
+ setScheduleModeFilter(opt.value as ScheduleModeFilter)
+ } else {
+ setScheduleModeFilter('all')
+ }
+ }}
+ onSelect={(e) => e.preventDefault()}
+ >
+ {opt.label}
+
+ ))}
+
+ Sort
+ setSortOption(v as SortOption)}>
+ {sortOptions.map((opt) => (
+ e.preventDefault()}
>
- {job.repoName}
-
-
{job.name}
-
- {job.description || 'No description'}
+ {opt.label}
+
+ ))}
+
+
+
+
+
+
+
Status:
+
+ {statusOptions.map((opt) => (
+ setStatusFilter(opt.value as StatusFilter)}
+ className="h-8 px-3 text-xs"
+ >
+ {opt.label}
+
+ ))}
+
+
+
+
Mode:
+
+ {modeOptions.map((opt) => (
+ setScheduleModeFilter(opt.value as ScheduleModeFilter)}
+ className="h-8 px-3 text-xs"
+ >
+ {opt.label}
+
+ ))}
+
+
+
+
Sort:
+
+ {sortOptions.map((opt) => (
+ setSortOption(opt.value as SortOption)}
+ className="h-8 px-3 text-xs"
+ >
+ {opt.label}
+
+ ))}
+
+
+
+
+
+
+ {!hasJobs ? (
+
+
+
+
+
+
+
+
No schedules yet
+
+ Create schedules for your repositories to automate recurring agent work.
-
- {job.enabled ? 'Enabled' : 'Paused'}
-
-
-
-
-
-
-
- {formatScheduleShortLabel(job)}
-
+
navigate('/')}>
+
+ Go to Repositories
+
+
+
+
+ ) : filteredAndSortedJobs.length === 0 ? (
+
+
+
+
+
-
-
-
- Next: {job.nextRunAt ? new Date(job.nextRunAt).toLocaleString() : 'Never'}
-
+
+
No matching schedules
+
+ Try adjusting your filters to see more results.
+
- {job.lastRunAt && (
-
-
-
- Last: {formatTimestamp(job.lastRunAt)}
-
+ {
+ setStatusFilter('all')
+ setScheduleModeFilter('all')
+ setRepoFilter('all')
+ }}
+ >
+ Clear Filters
+
+
+
+
+ ) : (
+
+ {filteredAndSortedJobs.map((job) => (
+
navigate(`/repos/${job.repoId}/schedules`)}
+ >
+
+
+
+
{
+ e.stopPropagation()
+ handleNavigateToRepo(job.repoPath)
+ }}
+ className="text-xs text-muted-foreground hover:text-foreground hover:underline truncate block mb-1"
+ >
+ {job.repoName}
+
+
{job.name}
+
+ {job.description || 'No description'}
+
+
+
+ {job.enabled ? 'Enabled' : 'Paused'}
+
- )}
-
-
-
{
- e.stopPropagation()
- handleRunNow(job)
- }}
- disabled={runMutation.isPending}
- >
-
- Run
-
-
{
- e.stopPropagation()
- handleToggleEnabled(job)
- }}
- >
- {job.enabled ? (
-
- ) : (
-
- )}
-
-
{
- e.stopPropagation()
- handleEdit(job)
- }}
- >
-
-
-
{
- e.stopPropagation()
- setDeletingJob(job)
- }}
- >
-
-
-
-
-
- ))}
+
+
+
+
+ {formatScheduleShortLabel(job)}
+
+
+
+
+
+ Next: {job.nextRunAt ? new Date(job.nextRunAt).toLocaleString() : 'Never'}
+
+
+ {job.lastRunAt && (
+
+
+
+ Last: {formatTimestamp(job.lastRunAt)}
+
+
+ )}
+
+
+
+
{
+ e.stopPropagation()
+ handleRunNow(job)
+ }}
+ disabled={runMutation.isPending}
+ >
+
+ Run
+
+
{
+ e.stopPropagation()
+ handleToggleEnabled(job)
+ }}
+ >
+ {job.enabled ? (
+
+ ) : (
+
+ )}
+
+
{
+ e.stopPropagation()
+ handleEdit(job)
+ }}
+ >
+
+
+
{
+ e.stopPropagation()
+ setDeletingJob(job)
+ }}
+ >
+
+
+
+
+
+ ))}
+
+ )}
- )}
-
+
+
+
+
+
+ Filter by repo:
+
+
+
+
+
+ {(runStatusFilter !== 'all' || runTriggerFilter !== 'all' || runSortOption !== 'startedAt') && (
+
+ )}
+
+
+
+ {
+ setRunStatusFilter('all')
+ setRunTriggerFilter('all')
+ setRunRepoFilter('all')
+ setRunSortOption('startedAt')
+ }}
+ className="text-xs text-muted-foreground"
+ >
+ Clear all filters
+
+
+ Status
+ setRunStatusFilter('all')}
+ onSelect={(e) => e.preventDefault()}
+ >
+ All Status
+
+ {runStatusOptions.filter((opt) => opt.value !== 'all').map((opt) => (
+ {
+ if (checked) {
+ setRunStatusFilter(opt.value)
+ } else {
+ setRunStatusFilter('all')
+ }
+ }}
+ onSelect={(e) => e.preventDefault()}
+ >
+ {opt.label}
+
+ ))}
+
+ Trigger
+ setRunTriggerFilter('all')}
+ onSelect={(e) => e.preventDefault()}
+ >
+ All Triggers
+
+ {runTriggerOptions.filter((opt) => opt.value !== 'all').map((opt) => (
+ {
+ if (checked) {
+ setRunTriggerFilter(opt.value)
+ } else {
+ setRunTriggerFilter('all')
+ }
+ }}
+ onSelect={(e) => e.preventDefault()}
+ >
+ {opt.label}
+
+ ))}
+
+ Sort
+ setRunSortOption(v as 'startedAt' | 'jobName' | 'duration')}>
+ {runSortOptions.map((opt) => (
+ e.preventDefault()}
+ >
+ {opt.label}
+
+ ))}
+
+
+
+
+
+
+
Status:
+
+ {runStatusOptions.map((opt) => (
+ setRunStatusFilter(opt.value)}
+ className="h-8 px-3 text-xs"
+ >
+ {opt.label}
+
+ ))}
+
+
+
+
Trigger:
+
+ {runTriggerOptions.map((opt) => (
+ setRunTriggerFilter(opt.value)}
+ className="h-8 px-3 text-xs"
+ >
+ {opt.label}
+
+ ))}
+
+
+
+
Sort:
+
+ {runSortOptions.map((opt) => (
+ setRunSortOption(opt.value as 'startedAt' | 'jobName' | 'duration')}
+ className="h-8 px-3 text-xs"
+ >
+ {opt.label}
+
+ ))}
+
+
+
+
+
+
+ {runsLoading && allRuns.length === 0 ? (
+
+
+
+ ) : allRuns.length === 0 ? (
+
+
+
+
+
+
+
+
No runs found
+
+ {runStatusFilter !== 'all' || runRepoFilter !== 'all' || runTriggerFilter !== 'all'
+ ? 'Try adjusting your filters to see more results.'
+ : 'Schedule runs will appear here once jobs start executing.'}
+
+
+ {(runStatusFilter !== 'all' || runRepoFilter !== 'all' || runTriggerFilter !== 'all' || runSortOption !== 'startedAt') && (
+ {
+ setRunStatusFilter('all')
+ setRunRepoFilter('all')
+ setRunTriggerFilter('all')
+ setRunSortOption('startedAt')
+ }}
+ >
+ Clear Filters
+
+ )}
+
+
+
+ ) : (
+
{
+ if (selectedRunId) {
+ const run = sortedRuns.find((r) => r.id === selectedRunId)
+ if (run) {
+ handleCancelRun(run.repoId, run.jobId, run.id)
+ }
+ }
+ }}
+ cancelRunPending={cancelRunPending}
+ />
+ )}
+
+
+