Skip to content

Commit f6d1767

Browse files
fix: restore Enabled/Paused status badges on schedule jobs
1 parent 5a9e487 commit f6d1767

3 files changed

Lines changed: 34 additions & 21 deletions

File tree

frontend/src/components/schedules/JobDetailTab.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import type { ScheduleJob } from '@opencode-manager/shared/types'
22
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
33
import { Button } from '@/components/ui/button'
4+
import { Badge } from '@/components/ui/badge'
45
import {
56
formatScheduleSummary,
67
formatTimestamp,
8+
getJobStatusTone,
79
hasSkillMetadata,
810
} from '@/components/schedules/schedule-utils'
911
import { Bot, CalendarClock, Clock3, History, Loader2, Pencil, Play, Sparkles, Trash2 } from 'lucide-react'
@@ -49,7 +51,10 @@ export function JobDetailTab({
4951
<div className="border-b border-border/60 bg-card px-3 py-4 sm:px-6 sm:py-5">
5052
<div className="flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between">
5153
<div className="space-y-2">
52-
<h3 className="text-xl font-semibold tracking-tight">{selectedJob.name}</h3>
54+
<div className="flex flex-wrap items-center gap-2">
55+
<h3 className="text-xl font-semibold tracking-tight">{selectedJob.name}</h3>
56+
<Badge className={getJobStatusTone(selectedJob)}>{selectedJob.enabled ? 'Enabled' : 'Paused'}</Badge>
57+
</div>
5358
<p className="text-sm text-muted-foreground">{selectedJob.description || 'No description provided.'}</p>
5459
<div className="flex flex-wrap gap-2 text-xs text-muted-foreground">
5560
<span className="inline-flex items-center gap-1"><Clock3 className="h-3.5 w-3.5" /> {formatTimestamp(selectedJob.nextRunAt)}</span>

frontend/src/components/schedules/JobsTab.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { ScheduleJob } from '@opencode-manager/shared/types'
2-
import { formatScheduleShortLabel } from '@/components/schedules/schedule-utils'
2+
import { Badge } from '@/components/ui/badge'
3+
import { formatScheduleShortLabel, getJobStatusTone } from '@/components/schedules/schedule-utils'
34
import { Bot, Clock3 } from 'lucide-react'
45
import { cn } from '@/lib/utils'
56

@@ -24,9 +25,12 @@ export function JobsTab({ jobs, selectedJobId, onSelectJob }: JobsTabProps) {
2425
: 'border-border/70 bg-background/60 hover:bg-accent/40'
2526
)}
2627
>
27-
<div>
28-
<p className="font-medium truncate">{job.name}</p>
29-
<p className="mt-1 truncate text-xs text-muted-foreground">{job.description || 'No description yet'}</p>
28+
<div className="flex items-start justify-between gap-2">
29+
<div className="min-w-0">
30+
<p className="font-medium truncate">{job.name}</p>
31+
<p className="mt-1 truncate text-xs text-muted-foreground">{job.description || 'No description yet'}</p>
32+
</div>
33+
<Badge className={getJobStatusTone(job)}>{job.enabled ? 'Enabled' : 'Paused'}</Badge>
3034
</div>
3135
<div className="mt-2 flex flex-wrap gap-2 text-xs text-muted-foreground">
3236
<span className="inline-flex items-center gap-1"><Clock3 className="h-3.5 w-3.5" /> {formatScheduleShortLabel(job)}</span>

frontend/src/pages/GlobalSchedules.tsx

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import { useAllSchedules, useAllScheduleRuns, useCancelRepoScheduleRun } from '@
44
import { useDeleteRepoSchedule, useRunRepoSchedule, useUpdateRepoSchedule, useCreateRepoSchedule } from '@/hooks/useSchedules'
55
import { ScheduleJobDialog, RunHistoryCards, PromptsTab } from '@/components/schedules'
66
import type { CreateScheduleJobRequest } from '@opencode-manager/shared/types'
7-
import { toUpdateScheduleRequest, formatScheduleShortLabel, formatTimestamp } from '@/components/schedules/schedule-utils'
7+
import { toUpdateScheduleRequest, formatScheduleShortLabel, formatTimestamp, getJobStatusTone } from '@/components/schedules/schedule-utils'
88
import { Header } from '@/components/ui/header'
99
import { Button } from '@/components/ui/button'
1010
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuCheckboxItem, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator } from '@/components/ui/dropdown-menu'
1111
import { Card, CardContent } from '@/components/ui/card'
12+
import { Badge } from '@/components/ui/badge'
1213
import { DeleteDialog } from '@/components/ui/delete-dialog'
1314
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
1415
import { CalendarClock, Loader2, Plus, ArrowLeft, Play, Pencil, Trash2, Pause, PlayCircle, Clock3, History, SlidersHorizontal } from 'lucide-react'
@@ -553,21 +554,24 @@ export function GlobalSchedules() {
553554
onClick={() => navigate(`/repos/${job.repoId}/schedules`)}
554555
>
555556
<CardContent className="p-4 space-y-3">
556-
<div className="min-w-0">
557-
<button
558-
type="button"
559-
onClick={(e) => {
560-
e.stopPropagation()
561-
handleNavigateToRepo(job.repoPath)
562-
}}
563-
className="text-xs text-muted-foreground hover:text-foreground hover:underline truncate block mb-1"
564-
>
565-
{job.repoName}
566-
</button>
567-
<h3 className="font-medium truncate">{job.name}</h3>
568-
<p className="mt-1 text-xs text-muted-foreground line-clamp-2">
569-
{job.description || 'No description'}
570-
</p>
557+
<div className="flex items-start justify-between gap-2">
558+
<div className="min-w-0 flex-1">
559+
<button
560+
type="button"
561+
onClick={(e) => {
562+
e.stopPropagation()
563+
handleNavigateToRepo(job.repoPath)
564+
}}
565+
className="text-xs text-muted-foreground hover:text-foreground hover:underline truncate block mb-1"
566+
>
567+
{job.repoName}
568+
</button>
569+
<h3 className="font-medium truncate">{job.name}</h3>
570+
<p className="mt-1 text-xs text-muted-foreground line-clamp-2">
571+
{job.description || 'No description'}
572+
</p>
573+
</div>
574+
<Badge className={getJobStatusTone(job)}>{job.enabled ? 'Enabled' : 'Paused'}</Badge>
571575
</div>
572576

573577
<div className="space-y-2 text-xs text-muted-foreground">

0 commit comments

Comments
 (0)