mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-04-28 03:49:31 +00:00
fix(cli): improve visual spacing in spawn list output (#2311)
- Interactive picker: add blank separator line between entries so label and subtitle are visually grouped (not blending into adjacent entries) - Non-interactive table: wrap subtitle in pc.dim() for better contrast with the bold entry name - Update pickerHeight to account for added separator lines Fixes #2309 Agent: issue-fixer Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
252e8fc726
commit
bd41641c11
3 changed files with 10 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@openrouter/spawn",
|
||||
"version": "0.15.12",
|
||||
"version": "0.15.13",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"spawn": "cli.js"
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ function renderListTable(records: SpawnRecord[], manifest: Manifest | null): voi
|
|||
const r = records[i];
|
||||
const name = r.name || r.connection?.server_name || "unnamed";
|
||||
console.log(pc.bold(name));
|
||||
console.log(` ${buildRecordSubtitle(r, manifest)}`);
|
||||
console.log(pc.dim(` ${buildRecordSubtitle(r, manifest)}`));
|
||||
if (i < records.length - 1) {
|
||||
console.log();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -324,7 +324,9 @@ export function pickToTTYWithActions(config: PickConfig): PickResult {
|
|||
: "\u2191/\u2193 move \u23ce select Ctrl-C cancel";
|
||||
|
||||
const linesPerOption = config.options.map((o) => (o.subtitle ? 2 : 1));
|
||||
pickerHeight = 1 + linesPerOption.reduce((a, b) => a + b, 0) + 1;
|
||||
// Add 1 blank separator line between each pair of adjacent options
|
||||
const separatorCount = config.options.length > 1 ? config.options.length - 1 : 0;
|
||||
pickerHeight = 1 + linesPerOption.reduce((a, b) => a + b, 0) + separatorCount + 1;
|
||||
|
||||
render = (wr: WriteFn, first: boolean) => {
|
||||
if (!first) {
|
||||
|
|
@ -347,11 +349,15 @@ export function pickToTTYWithActions(config: PickConfig): PickResult {
|
|||
wr(` ${A.dim}${trunc(opt.subtitle, maxW - 2)}${A.reset}\r\n`);
|
||||
}
|
||||
} else {
|
||||
wr(` ${A.dim}${trunc(opt.label, maxW - 2)}${A.reset}\r\n`);
|
||||
wr(` ${trunc(opt.label, maxW - 2)}\r\n`);
|
||||
if (opt.subtitle) {
|
||||
wr(` ${A.dim}${trunc(opt.subtitle, maxW - 2)}${A.reset}\r\n`);
|
||||
}
|
||||
}
|
||||
// Blank separator between entries for visual clarity
|
||||
if (i < config.options.length - 1) {
|
||||
wr("\r\n");
|
||||
}
|
||||
}
|
||||
wr(`${A.dim} ${trunc(footerHint, maxW - 2)}${A.reset}\r\n`);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue