diff --git a/src/widgets/HealthMonitor.ts b/src/widgets/HealthMonitor.ts index 9441789..148a888 100644 --- a/src/widgets/HealthMonitor.ts +++ b/src/widgets/HealthMonitor.ts @@ -433,13 +433,24 @@ export class HealthMonitor { // Build output lines const outputLines: string[] = Array(this.MAX_LINES).fill('') + // Calculate max width per column for proper spacing + const columnWidths: number[] = [] for (const column of visibleColumns) { + const maxWidth = Math.max(...column.map(item => this.stripTags(item.text).length)) + columnWidths.push(maxWidth) + } + + for (let colIdx = 0; colIdx < visibleColumns.length; colIdx++) { + const column = visibleColumns[colIdx] + const columnWidth = columnWidths[colIdx] + for (let lineIdx = 0; lineIdx < column.length && lineIdx < this.MAX_LINES; lineIdx++) { const item = column[lineIdx] if (item) { // Pad previous content on this line and append this item const currentLength = this.stripTags(outputLines[lineIdx]).length - const padding = lineIdx === 0 || currentLength === 0 ? '' : ' ' + // Use larger spacing between columns (6 spaces instead of 2) + const padding = currentLength === 0 ? '' : ' '.repeat(6) outputLines[lineIdx] += padding + item.text } }