Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apps/loopover-miner-ui/src/app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ describe("OverviewView (#4853)", () => {
expect(statValue("Done")).toBe("2");
expect(statValue("Active")).toBe("3");
expect(statValue("Total recorded")).toBe("4");
// Oldest-queued age is omitted when null (empty queue), matching the CLI (#6185).
expect(screen.queryByText("Oldest queued")).toBeNull();
});

it("renders the oldest-queued age in CLI-parity minutes when the queue has one (#6185)", () => {
const portfolioWithAge: PortfolioQueueResult = {
ok: true,
summary: { total: 3, byStatus: { queued: 3, in_progress: 0, done: 0 }, repos: [], oldestQueuedAgeMs: 5_400_000 },
};
render(<OverviewView runs={runsOk} portfolio={portfolioWithAge} claims={claimsOk} />);
// 5_400_000ms / 60000 = 90m, matching portfolio-dashboard.js's `Math.round(oldestQueuedAgeMs / 60000)m`.
expect(statValue("Oldest queued")).toBe("90m");
});

it("shows an independent loading message per card before data arrives", () => {
Expand Down
6 changes: 6 additions & 0 deletions apps/loopover-miner-ui/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ export function OverviewPortfolioCard({ portfolio }: { portfolio: PortfolioQueue
<Stat label="Queued" value={portfolio.summary.byStatus.queued} />
<Stat label="In progress" value={portfolio.summary.byStatus.in_progress} tone="text-[var(--warning)]" />
<Stat label="Done" value={portfolio.summary.byStatus.done} tone="text-[var(--success)]" />
{/* Deliver the CLI/web-UI parity the portfolio-queue data path promises (#6185): the CLI's `queue
dashboard` renders "oldest-queued: Xm" (portfolio-dashboard.js), and the same minutes-rounded age
is shown here. Omitted (like the CLI) when the queue is empty and the age is null. */}
{portfolio.summary.oldestQueuedAgeMs !== null && (
<Stat label="Oldest queued" value={`${Math.round(portfolio.summary.oldestQueuedAgeMs / 60000)}m`} />
)}
</>
)}
</SummaryCard>
Expand Down
Loading