From 2d778877f6873c4dcf5848610ba897c99a4b4d4d Mon Sep 17 00:00:00 2001 From: Rudy Celekli Date: Sat, 10 Oct 2026 12:19:58 -0400 Subject: [PATCH 1/2] fix(cli-core): fit truncation markers in narrow columns Signed-off-by: Rudy Celekli --- tests/output-narrow-columns.test.mjs | 11 +++++++++++ v3/@claude-flow/cli-core/src/output.ts | 1 + 2 files changed, 12 insertions(+) create mode 100644 tests/output-narrow-columns.test.mjs diff --git a/tests/output-narrow-columns.test.mjs b/tests/output-narrow-columns.test.mjs new file mode 100644 index 0000000000..50c0eef02a --- /dev/null +++ b/tests/output-narrow-columns.test.mjs @@ -0,0 +1,11 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { OutputFormatter } from '../v3/@claude-flow/cli-core/src/output.ts'; +test('one to three character columns never overflow their border', () => { + const f = new OutputFormatter({ color: false }); + for (const width of [1, 2, 3, 4]) { + const lines = f.table({ columns: [{ key: 'value', header: 'Header', width }], data: [{ value: 'Longer content' }] }).split('\n'); + for (const line of lines) assert.equal(line.length, lines[0].length); + assert.equal(lines[0].length, width + 4); + } +}); diff --git a/v3/@claude-flow/cli-core/src/output.ts b/v3/@claude-flow/cli-core/src/output.ts index 9052a53923..034e4ae96c 100644 --- a/v3/@claude-flow/cli-core/src/output.ts +++ b/v3/@claude-flow/cli-core/src/output.ts @@ -370,6 +370,7 @@ export class OutputFormatter { private truncate(text: string, maxLength: number): string { const stripped = this.stripAnsi(text); if (stripped.length <= maxLength) return text; + if (maxLength <= 3) return '.'.repeat(Math.max(0, maxLength)); return stripped.slice(0, maxLength - 3) + '...'; } From 3dc25790343c44057d0d5e3ed85fd3f189f5579d Mon Sep 17 00:00:00 2001 From: Rudy Celekli Date: Sat, 10 Oct 2026 15:34:59 -0400 Subject: [PATCH 2/2] test: run focused regressions with the repository Vitest runner Signed-off-by: Rudy Celekli --- tests/output-narrow-columns.test.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/output-narrow-columns.test.mjs b/tests/output-narrow-columns.test.mjs index 50c0eef02a..637b4b7eb6 100644 --- a/tests/output-narrow-columns.test.mjs +++ b/tests/output-narrow-columns.test.mjs @@ -1,4 +1,4 @@ -import test from 'node:test'; +import { test } from 'vitest'; import assert from 'node:assert/strict'; import { OutputFormatter } from '../v3/@claude-flow/cli-core/src/output.ts'; test('one to three character columns never overflow their border', () => {