Visitar URL original
feat(tui): rebuild the Workers view as a fleet console (#19) · reddb-io/redcode@7b8733f · GitHub
Skip to content

Commit 7b8733f

Browse files
feat(tui): rebuild the Workers view as a fleet console (#19)
The Workers view listed four static columns and a flat detail pane, so a running fleet gave no sense of capacity, velocity, or health. Rebuild it around what an operator asks between polls: how much of the host is in use, which Worker is moving, and what each one just did. - Header carries the host capacity meters (slots, memory) and the snapshot age; meters drop off as the terminal narrows. - Table gains a phase bar, heartbeat freshness, and token/tool counters, groups by project in host scope, and drops columns instead of wrapping. - Detail pane derives throughput rates and a token sparkline from client-side history, and keeps a per-Worker activity feed built from phase, step, failure, and log-line transitions. - enter expands one Worker, o opens its issue, R refreshes, g/G jump. - The tab badge counts the fleet and flags failed Workers. OpenTUI overlaps cells when a flex subtree asks for more rows than the terminal has, so every section is a fixed count of single lines and both panes get explicit sizes.
1 parent 3d1e6c3 commit 7b8733f

7 files changed

Lines changed: 1481 additions & 233 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"opencode": minor
3+
---
4+
5+
Rebuild the Workers view as a live fleet console: capacity meters for slots and memory, a sortable-by-project table with phase bars, heartbeat freshness and token counters, and a detail pane with throughput rates, a token sparkline, and a per-Worker activity feed. Adds enter to expand one Worker, o to open its issue, R to refresh, g/G to jump, and a tab badge that counts failed Workers.

‎packages/tui/src/app.tsx‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,10 @@ function App(props: { onSnapshot?: () => Promise<string[]>; pluginHost: TuiPlugi
376376
const tuiConfig = useTuiConfig()
377377
const redskilled = useRedskilled()
378378
const [primaryView, setPrimaryView] = createSignal<"session" | "workers">("session")
379+
const workerCount = createMemo(() => redskilled.status()?.payload?.workers.length ?? 0)
380+
const failedWorkers = createMemo(
381+
() => redskilled.status()?.payload?.workers.filter((item) => item.display?.failed).length ?? 0,
382+
)
379383
const route = useRoute()
380384
const dimensions = useTerminalDimensions()
381385
const renderer = useRenderer()
@@ -1177,8 +1181,12 @@ function App(props: { onSnapshot?: () => Promise<string[]>; pluginHost: TuiPlugi
11771181
attributes={primaryView() === "workers" ? TextAttributes.BOLD : undefined}
11781182
onMouseUp={() => setPrimaryView("workers")}
11791183
>
1180-
Workers{" "}
1181-
{redskilled.status()?.payload?.workers.length ? `(${redskilled.status()?.payload?.workers.length})` : ""}
1184+
Workers
1185+
<Show when={workerCount() > 0}>
1186+
<span style={{ fg: failedWorkers() ? theme.error : theme.textMuted }}>
1187+
{` (${workerCount()}${failedWorkers() ? ` ✗${failedWorkers()}` : ""})`}
1188+
</span>
1189+
</Show>
11821190
</text>
11831191
</box>
11841192
<Show when={primaryView() === "session"} fallback={<Workers />}>

0 commit comments

Comments
 (0)