From 86e17cd2f8b28f567c98465239b61d11ef29d227 Mon Sep 17 00:00:00 2001 From: Duc Date: Sun, 1 Nov 2026 22:18:07 +0700 Subject: [PATCH] fix(tui): separate rigs in the instance table (#2327) The rig tui instance table drew a dotted rule between pods inside a rig but nothing between rigs, so one rig's last pod shared a block with the next rig's first pod, and trailing single-pod rigs ran together. Each rig boundary now gets a solid rule, and pods inside a rig keep the dotted rule. Source +4, tests +2. --- packages/tui/src/render.ts | 4 ++++ packages/tui/test/instance-mission-control.test.ts | 2 ++ 2 files changed, 6 insertions(+) diff --git a/packages/tui/src/render.ts b/packages/tui/src/render.ts index 86f4ac585..13d4c21fe 100644 --- a/packages/tui/src/render.ts +++ b/packages/tui/src/render.ts @@ -709,6 +709,7 @@ function noRigsText(snap: FleetSnapshot, host: FleetSnapshot["hosts"][number], l : ` (no rigs served by ${host.name})`; } +/** Rig boundaries take a solid rule and pod boundaries a dotted one; RIG repeats on every row so scrolled rows keep it. */ function instanceContentLines( state: ViewState, snap: FleetSnapshot, @@ -808,10 +809,13 @@ function instanceContentLines( let attentionCount = 0; let attentionUnknown = 0; let openCount = 0; + let firstRig = true; for (const rig of host.rigs) { const agents = rig.pods.flatMap((pod) => pod.agents.map((agent) => ({ pod: pod.name, agent }))) .filter(({ pod, agent }) => !state.filter || rig.name.includes(state.filter) || pod.includes(state.filter) || agent.name.includes(state.filter)); if (state.filter && agents.length === 0 && !rig.name.includes(state.filter)) continue; + if (!firstRig) lines.push({ text: "─".repeat(columnsWidth(columns)) }); + firstRig = false; const rigAction: Action = { type: "drill", resource: "rig", name: rig.name, target: { host: host.name } }; if (agents.length === 0) { lines.push({ diff --git a/packages/tui/test/instance-mission-control.test.ts b/packages/tui/test/instance-mission-control.test.ts index 650c80039..b3bb349f3 100644 --- a/packages/tui/test/instance-mission-control.test.ts +++ b/packages/tui/test/instance-mission-control.test.ts @@ -140,6 +140,8 @@ describe("S12 instance mission control", () => { expect(whole).toMatch(/empty\s+—\s+\(no seats\).*stopped/); expect(whole).toMatch(/dev\s+[\s\S]*┈{8,}[\s\S]*qa\s+/); expect((whole.match(/┈{8,}/g) ?? [])).toHaveLength(1); + expect(whole).toMatch(/build\s+qa\s+[^\n]*\n[^\n]*─{8,}[^\n]*\n[^\n]*docs\s+write/); + expect(whole).toMatch(/docs\s+write\s+[^\n]*\n[^\n]*─{8,}[^\n]*\n[^\n]*empty\s+—/); expect(whole).not.toMatch(/\+\d+|more hidden/i); expect(reached).toEqual(expectedAgents); expect(scrolledSeatRows).toBeGreaterThan(0);