73f1ae6e2f
The queue tab showed newest-first (API returns createdAt desc) but the worker claims the oldest queued job next (claim_next: ORDER BY createdAt ASC) — so the item that ran next was at the BOTTOM. Sort the queue bucket ascending so it matches processing order, and badge the first claimable row (oldest, not individually paused) as "Next up". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import type { ReactNode } from "react";
|
|
import type { Kind } from "./status";
|
|
import { StatusChip } from "./status-chip";
|
|
|
|
// Map the severity kind to the row's visual class (stripe/bar color).
|
|
function rowClass(kind: Kind): string {
|
|
if (kind === "attention") return "attention";
|
|
if (kind === "verify" || kind === "done") return "verify";
|
|
return "working";
|
|
}
|
|
|
|
export function JobRow({
|
|
artist,
|
|
album,
|
|
kind,
|
|
label,
|
|
marker,
|
|
meta,
|
|
note,
|
|
bar,
|
|
}: {
|
|
artist: string;
|
|
album: string;
|
|
kind: Kind;
|
|
label: string;
|
|
marker?: string;
|
|
meta?: ReactNode;
|
|
note?: ReactNode;
|
|
bar?: ReactNode;
|
|
}) {
|
|
return (
|
|
<article className={`job ${rowClass(kind)}`}>
|
|
<div className="stripe" />
|
|
<div>
|
|
<h3 className="title">
|
|
{marker ? <span className="nextup">{marker}</span> : null}
|
|
{album} <span className="artist">· {artist}</span>
|
|
</h3>
|
|
{meta ? <div className="meta">{meta}</div> : null}
|
|
{note ? <div className="note">{note}</div> : kind !== "attention" ? bar : null}
|
|
</div>
|
|
<StatusChip kind={kind} label={label} />
|
|
</article>
|
|
);
|
|
}
|