Files
Lyra/web/src/app/_ui/job-row.tsx
T
Jonathan 73f1ae6e2f feat(web): order the In-queue tab next-up-first with a "Next up" marker
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>
2026-07-20 20:56:42 +02:00

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>
);
}