fix(PBI-59): jobs sorted newest-first, unified on created_at

- actions/jobs-page.ts: beide kolommen orderBy created_at desc
- stores/jobs-store.ts: nieuwe actieve jobs unshift (top) i.p.v. push (bottom)

Hiermee komen nieuw aangemaakte QUEUED/CLAIMED jobs bovenaan in de
linker kolom, in plaats van onderaan waar ze buiten het scrollbare deel
kunnen vallen.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Janpeter Visser 2026-05-07 20:54:01 +02:00
parent 883534a521
commit 97f696422e
2 changed files with 3 additions and 3 deletions

View file

@ -151,12 +151,12 @@ export async function fetchJobsPageData(): Promise<{ activeJobs: JobWithRelation
prisma.claudeJob.findMany({
where: { user_id: session.userId, status: { notIn: ['DONE'] } },
include: JOB_INCLUDE,
orderBy: { created_at: 'asc' },
orderBy: { created_at: 'desc' },
}),
prisma.claudeJob.findMany({
where: { user_id: session.userId, status: 'DONE' },
include: JOB_INCLUDE,
orderBy: { finished_at: 'desc' },
orderBy: { created_at: 'desc' },
take: 100,
}),
prisma.modelPrice.findMany(),

View file

@ -50,7 +50,7 @@ export const useJobsStore = create<JobsState & JobsActions>()(
if (idx !== -1) {
Object.assign(state.activeJobs[idx], job)
} else {
state.activeJobs.push(job as JobWithRelations)
state.activeJobs.unshift(job as JobWithRelations)
}
}
})