Address Greptile 4/5 feedback: auto-clear idle badge, restore status color, fix display gap
- Clear idle_warning errorCode in onLog when output resumes, so the orange Idle badge disappears without requiring an API call - Restore idle_timeout entry in status-colors.ts for errorCode-based badge styling - Simplify LiveRunWidget time display to a single if/else chain, eliminating the gap for non-active runs with lastOutputAt but no finishedAt Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
e58a2330a6
commit
a82f9ec7eb
3 changed files with 8 additions and 8 deletions
|
|
@ -2517,6 +2517,10 @@ export function heartbeatService(db: Db) {
|
||||||
await db.update(heartbeatRuns)
|
await db.update(heartbeatRuns)
|
||||||
.set({ lastOutputAt: lastOutputAtLatest, updatedAt: new Date() })
|
.set({ lastOutputAt: lastOutputAtLatest, updatedAt: new Date() })
|
||||||
.where(eq(heartbeatRuns.id, runId));
|
.where(eq(heartbeatRuns.id, runId));
|
||||||
|
// Clear idle_warning if set — output resumed
|
||||||
|
await db.update(heartbeatRuns)
|
||||||
|
.set({ errorCode: null, error: null })
|
||||||
|
.where(and(eq(heartbeatRuns.id, runId), eq(heartbeatRuns.errorCode, IDLE_WARNING_ERROR_CODE)));
|
||||||
lastOutputAtTimer = setTimeout(() => {
|
lastOutputAtTimer = setTimeout(() => {
|
||||||
lastOutputAtFlushPending = false;
|
lastOutputAtFlushPending = false;
|
||||||
lastOutputAtTimer = null;
|
lastOutputAtTimer = null;
|
||||||
|
|
|
||||||
|
|
@ -125,18 +125,13 @@ export function LiveRunWidget({ issueId, companyId }: LiveRunWidgetProps) {
|
||||||
Idle
|
Idle
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{run.lastOutputAt && isRunActive(run.status) && (
|
{isRunActive(run.status) && run.lastOutputAt ? (
|
||||||
<span title={`Last output: ${formatDateTime(run.lastOutputAt)}`}>
|
<span title={`Last output: ${formatDateTime(run.lastOutputAt)}`}>
|
||||||
Last output {relativeTime(run.lastOutputAt)}
|
Last output {relativeTime(run.lastOutputAt)}
|
||||||
</span>
|
</span>
|
||||||
)}
|
) : run.finishedAt ? (
|
||||||
{run.finishedAt && !isRunActive(run.status) && (
|
|
||||||
<span>{formatDateTime(run.finishedAt)}</span>
|
<span>{formatDateTime(run.finishedAt)}</span>
|
||||||
)}
|
) : (
|
||||||
{!run.lastOutputAt && isRunActive(run.status) && (
|
|
||||||
<span>{formatDateTime(run.startedAt ?? run.createdAt)}</span>
|
|
||||||
)}
|
|
||||||
{!run.finishedAt && !isRunActive(run.status) && !run.lastOutputAt && (
|
|
||||||
<span>{formatDateTime(run.startedAt ?? run.createdAt)}</span>
|
<span>{formatDateTime(run.startedAt ?? run.createdAt)}</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ export const statusBadge: Record<string, string> = {
|
||||||
// Run statuses
|
// Run statuses
|
||||||
failed: "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",
|
failed: "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",
|
||||||
timed_out: "bg-orange-100 text-orange-700 dark:bg-orange-900/50 dark:text-orange-300",
|
timed_out: "bg-orange-100 text-orange-700 dark:bg-orange-900/50 dark:text-orange-300",
|
||||||
|
idle_timeout: "bg-orange-100 text-orange-700 dark:bg-orange-900/50 dark:text-orange-300",
|
||||||
succeeded: "bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",
|
succeeded: "bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",
|
||||||
error: "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",
|
error: "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",
|
||||||
terminated: "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",
|
terminated: "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue