Skip to content

Commit 6bdcd7c

Browse files
committed
Skip empty idle status fleet digest
1 parent c506b76 commit 6bdcd7c

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/tui/commands/built-in.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ describe("/status command", () => {
7979
});
8080
});
8181

82+
it("noops when the live fleet digest is empty so idle /status paints no blank row", () => {
83+
const ctx: CommandContext = {
84+
signalClear: () => undefined,
85+
getFleetStatus: () => "",
86+
};
87+
expect(defined(getCommand("status"), "status").handler("", ctx)).toEqual({
88+
type: "noop",
89+
});
90+
});
91+
8292
it("says so rather than throwing when no fleet source is wired", () => {
8393
expect(
8494
defined(getCommand("status"), "status").handler("", makeCtx()),

src/tui/commands/built-in.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ export function registerBuiltInCommands(): void {
146146
text: "Fleet status is not available in this session.",
147147
};
148148
}
149+
if (status.length === 0) {
150+
return { type: "noop" };
151+
}
149152
return { type: "message", text: status };
150153
},
151154
});

0 commit comments

Comments
 (0)