fix(PBI-59): jobs sorted newest-first, unified on created_at (#157)
- 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:
parent
883534a521
commit
25bd59c0b9
2 changed files with 3 additions and 3 deletions
|
|
@ -151,12 +151,12 @@ export async function fetchJobsPageData(): Promise<{ activeJobs: JobWithRelation
|
||||||
prisma.claudeJob.findMany({
|
prisma.claudeJob.findMany({
|
||||||
where: { user_id: session.userId, status: { notIn: ['DONE'] } },
|
where: { user_id: session.userId, status: { notIn: ['DONE'] } },
|
||||||
include: JOB_INCLUDE,
|
include: JOB_INCLUDE,
|
||||||
orderBy: { created_at: 'asc' },
|
orderBy: { created_at: 'desc' },
|
||||||
}),
|
}),
|
||||||
prisma.claudeJob.findMany({
|
prisma.claudeJob.findMany({
|
||||||
where: { user_id: session.userId, status: 'DONE' },
|
where: { user_id: session.userId, status: 'DONE' },
|
||||||
include: JOB_INCLUDE,
|
include: JOB_INCLUDE,
|
||||||
orderBy: { finished_at: 'desc' },
|
orderBy: { created_at: 'desc' },
|
||||||
take: 100,
|
take: 100,
|
||||||
}),
|
}),
|
||||||
prisma.modelPrice.findMany(),
|
prisma.modelPrice.findMany(),
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ export const useJobsStore = create<JobsState & JobsActions>()(
|
||||||
if (idx !== -1) {
|
if (idx !== -1) {
|
||||||
Object.assign(state.activeJobs[idx], job)
|
Object.assign(state.activeJobs[idx], job)
|
||||||
} else {
|
} else {
|
||||||
state.activeJobs.push(job as JobWithRelations)
|
state.activeJobs.unshift(job as JobWithRelations)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue