Skip to content

Commit 7374cb8

Browse files
committed
fix(tui): show correct state in footer
1 parent 2b817ff commit 7374cb8

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

apps/tui/src/components/run-details-panel.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { StatusIndicator } from "./status-indicator";
1818

1919
interface RunDetailsPanelProps {
2020
selectedStatus: string | null;
21-
selectedRunStatus:
21+
selectedFooterStatus:
2222
| "Queued"
2323
| "Running"
2424
| "Success"
@@ -57,7 +57,7 @@ export function RunDetailsPanel(props: RunDetailsPanelProps) {
5757
() => firstLogTimestamp() ?? props.selectedRunUpdatedAt ?? nowMs()
5858
);
5959
const runEndTimestamp = createMemo(() => {
60-
const status = props.selectedRunStatus;
60+
const status = props.selectedFooterStatus;
6161
if (status === "Running" || status === "Queued") {
6262
return nowMs();
6363
}
@@ -76,7 +76,7 @@ export function RunDetailsPanel(props: RunDetailsPanelProps) {
7676
return `Waiting on ${waitingOnValue} for ${formatElapsedDuration(waitingDurationMs())}`;
7777
}
7878

79-
const runStatus = props.selectedRunStatus;
79+
const runStatus = props.selectedFooterStatus;
8080
if (runStatus === "Running") {
8181
return `Running for ${formatElapsedDuration(runDurationMs())}`;
8282
}
@@ -197,7 +197,7 @@ export function RunDetailsPanel(props: RunDetailsPanelProps) {
197197
<Show when={props.selectedStatus !== "Indeterminate"}>
198198
<box flexDirection="row">
199199
<StatusIndicator
200-
status={props.selectedRunStatus ?? undefined}
200+
status={props.selectedFooterStatus ?? undefined}
201201
/>
202202
<text> {footerStatusText()}</text>
203203
</box>

apps/tui/src/index.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,18 @@ function App() {
146146
return getDirectChildTaskKeys(tasks(), row.key).length > 0;
147147
});
148148
const selectedHasCommand = createMemo(() => selectedCommand() !== null);
149+
const selectedFooterStatus = createMemo<
150+
"Queued" | "Running" | "Success" | "Cancelled" | "Failed" | null
151+
>(() => {
152+
if (selectedHasChildren() && !selectedHasCommand()) {
153+
const displayStatus = selectedDisplayStatus();
154+
if (displayStatus === "Indeterminate" || !displayStatus) {
155+
return null;
156+
}
157+
return displayStatus;
158+
}
159+
return selectedRun()?.status ?? null;
160+
});
149161
const canToggleLogMode = createMemo(
150162
() => selectedHasChildren() && selectedHasCommand()
151163
);
@@ -634,7 +646,7 @@ function App() {
634646
logColorByTaskKey={logColorByTaskKey()}
635647
logs={logs()}
636648
logTaskTagWidth={logTaskTagWidth()}
637-
selectedRunStatus={selectedRun()?.status ?? null}
649+
selectedFooterStatus={selectedFooterStatus()}
638650
selectedRunUpdatedAt={selectedRun()?.updatedAt ?? null}
639651
selectedStatus={selectedDisplayStatus() ?? null}
640652
waitingOn={selectedWaitingOn()}

0 commit comments

Comments
 (0)