chore(widgets): 🔧 Update widget-related utility file HealthMonitor.ts with latest configuration/bug fixes

This commit is contained in:
Lilith 2026-01-20 04:46:12 -08:00
parent 54ae93c4da
commit 0d204112a5

View file

@ -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
}
}