diff --git a/frontend/src/components/schedules/PromptsTab.tsx b/frontend/src/components/schedules/PromptsTab.tsx index 89a8d7e4..5819562c 100644 --- a/frontend/src/components/schedules/PromptsTab.tsx +++ b/frontend/src/components/schedules/PromptsTab.tsx @@ -145,20 +145,22 @@ export function PromptsTab({ promptDialog, templateId, onNew, onEdit, onDelete, {visibleTemplates.map((template) => ( onEdit(template.id)} - onKeyDown={(event) => { - if (event.target !== event.currentTarget) return - if (event.key === 'Enter' || event.key === ' ') { - event.preventDefault() - onEdit(template.id) - } - }} className="cursor-pointer transition-colors hover:bg-accent/40" >
- {template.title} + {template.description && ( {template.description} )} diff --git a/frontend/src/components/schedules/RunHistoryTab.tsx b/frontend/src/components/schedules/RunHistoryTab.tsx index f862248b..b8d92e8f 100644 --- a/frontend/src/components/schedules/RunHistoryTab.tsx +++ b/frontend/src/components/schedules/RunHistoryTab.tsx @@ -57,7 +57,7 @@ export function RunHistoryTab({ formatRunBranch(run), run.errorText, ].some((field) => field?.toLowerCase().includes(searchTerm))) - const activeRun = runId !== null ? runList.find((run) => run.id === runId) ?? null : null + const activeRun = runId !== null ? runs?.find((run) => run.id === runId) ?? null : null const activeIndex = activeRun ? runList.findIndex((run) => run.id === activeRun.id) : -1 return ( diff --git a/frontend/src/components/schedules/ScheduleJobsTable.tsx b/frontend/src/components/schedules/ScheduleJobsTable.tsx index eae89876..52bde885 100644 --- a/frontend/src/components/schedules/ScheduleJobsTable.tsx +++ b/frontend/src/components/schedules/ScheduleJobsTable.tsx @@ -1,4 +1,4 @@ -import type { KeyboardEvent, MouseEvent } from 'react' +import type { MouseEvent } from 'react' import { formatDistanceToNow } from 'date-fns' import { Loader2, MoreHorizontal } from 'lucide-react' import { Button } from '@/components/ui/button' @@ -97,14 +97,6 @@ export function ScheduleJobsTable({ action?.(job) } - const handleKeyDown = (job: ScheduleJobWithRepo) => (event: KeyboardEvent) => { - if (event.target !== event.currentTarget) return - if (event.key === 'Enter' || event.key === ' ') { - event.preventDefault() - onOpen(job) - } - } - return ( @@ -162,9 +154,7 @@ export function ScheduleJobsTable({ return ( onOpen(job)} - onKeyDown={handleKeyDown(job)} className={cn( 'cursor-pointer transition-colors hover:bg-accent/40', isPaused && 'opacity-60', @@ -179,7 +169,17 @@ export function ScheduleJobsTable({ onSelectRun(run.id)} - onKeyDown={(event) => { - if (event.target !== event.currentTarget) return - if (event.key === 'Enter' || event.key === ' ') { - event.preventDefault() - onSelectRun(run.id) - } - }} className={cn('cursor-pointer transition-colors hover:bg-accent/40', isSelected && 'bg-accent/30')} > diff --git a/frontend/src/pages/GlobalSchedules.tsx b/frontend/src/pages/GlobalSchedules.tsx index e6fdd966..1d778dd0 100644 --- a/frontend/src/pages/GlobalSchedules.tsx +++ b/frontend/src/pages/GlobalSchedules.tsx @@ -102,7 +102,7 @@ export function GlobalSchedules() { useEffect(() => { if (scheduleTab !== 'runs' && runId === null) return const handleKeyDown = (event: KeyboardEvent) => { - if (event.key !== 'u') return + if (event.key !== 'u' || event.metaKey || event.ctrlKey || event.altKey) return const target = event.target as HTMLElement | null if (target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable)) return event.preventDefault()
- {job.name} + {job.description && {job.description}} {mobileDetail} diff --git a/frontend/src/components/schedules/ScheduleRunDrawer.tsx b/frontend/src/components/schedules/ScheduleRunDrawer.tsx index 05bc6116..cafc4127 100644 --- a/frontend/src/components/schedules/ScheduleRunDrawer.tsx +++ b/frontend/src/components/schedules/ScheduleRunDrawer.tsx @@ -42,7 +42,6 @@ export function ScheduleRunDrawer({ const title = run ? getRunTitle(run) : 'Run' const repoName = run ? getRunRepoName(run) : null const branch = activeRun ? formatRunBranch(activeRun) : null - const startedAt = activeRun ? activeRun.finishedAt ?? activeRun.startedAt : null const meta = activeRun ? (
@@ -51,11 +50,9 @@ export function ScheduleRunDrawer({ {getRunStatusLabel(activeRun.status)} {repoName && {repoName}} - {startedAt !== null && ( - - {activeRun.status === 'running' ? 'Running' : formatDistanceToNow(startedAt, { addSuffix: true })} - - )} + + {activeRun.status === 'running' ? 'Running' : formatDistanceToNow(activeRun.startedAt, { addSuffix: true })} + {formatRunDuration(activeRun)} {branch && {branch}}
diff --git a/frontend/src/components/schedules/ScheduleRunsTable.tsx b/frontend/src/components/schedules/ScheduleRunsTable.tsx index 78771fc7..9495c38f 100644 --- a/frontend/src/components/schedules/ScheduleRunsTable.tsx +++ b/frontend/src/components/schedules/ScheduleRunsTable.tsx @@ -65,21 +65,12 @@ export function ScheduleRunsTable({ {runs.map((run) => { const isUnread = run.viewedAt === null && (run.status === 'completed' || run.status === 'failed') const isSelected = selectedRunId === run.id - const startedAt = run.finishedAt ?? run.startedAt const repoName = getRunRepoName(run) return (
@@ -91,7 +82,17 @@ export function ScheduleRunsTable({
- {getRunTitle(run)} + {isUnread && ( NEW )} @@ -110,8 +111,8 @@ export function ScheduleRunsTable({ )}
{run.triggerSource} - - {run.status === 'running' ? 'Running' : formatDistanceToNow(startedAt, { addSuffix: true })} + + {run.status === 'running' ? 'Running' : formatDistanceToNow(run.startedAt, { addSuffix: true })} {formatRunDuration(run)}