feat(schedules): add unread run report notifications and run search

This commit is contained in:
Chris Scott committed 2026-10-01 23:35:10 -04:00
1 parent 7cac8baade
commit 5a8a81419c
43 files changed
+2463 -798

No files matched your search

+21 -1
View File
@@ -24,6 +24,10 @@ import {
listAllScheduleJobsWithRepos,
listScheduleRunArtifactsByJob,
listAllScheduleRuns,
listUnreadScheduleRuns,
countUnreadScheduleRuns,
markScheduleRunViewed,
markAllScheduleRunsViewed,
listEnabledScheduleJobs,
listScheduleJobIdsByRepo,
listScheduleJobsByRepo,
@@ -35,7 +39,7 @@ import {
updateScheduleRunMetadata,
updateScheduleRunWorktree,
} from '../db/schedules'
import type { ListAllRunsOptions, ScheduleRunWithContext } from '../db/schedules'
import type { ListAllRunsOptions, ScheduleRunWithContext, ScheduleRunWithUnreadPreview } from '../db/schedules'
import {
buildCreateSchedulePersistenceInput,
buildUpdatedSchedulePersistenceInput,
@@ -373,6 +377,22 @@ export class ScheduleService {
return listAllScheduleRuns(this.db, { ...options, limit, offset })
}
listUnreadRuns(limit: number): ScheduleRunWithUnreadPreview[] {
return listUnreadScheduleRuns(this.db, limit)
}
countUnreadRuns(): { total: number; failed: number } {
return countUnreadScheduleRuns(this.db)
}
markRunViewed(runId: number): boolean {
return markScheduleRunViewed(this.db, runId)
}
markAllRunsViewed(): number {
return markAllScheduleRunsViewed(this.db)
}
async recoverRunningRuns(): Promise<void> {
const runningRuns = listRunningScheduleRuns(this.db)