From 10e5591bf8f806881ee11e7cfa0cb1f2c0099b4c Mon Sep 17 00:00:00 2001 From: Ralph Khreish <35776126+Crunchyman-ralph@users.noreply.github.com> Date: Thu, 2 Oct 2025 15:35:13 +0200 Subject: [PATCH] chore: apply requested changes --- .../modules/task-manager/tag-management.js | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/scripts/modules/task-manager/tag-management.js b/scripts/modules/task-manager/tag-management.js index 2c3fd6a8..a4abd183 100644 --- a/scripts/modules/task-manager/tag-management.js +++ b/scripts/modules/task-manager/tag-management.js @@ -620,25 +620,22 @@ async function tags( } // Calculate dynamic column widths based on terminal width - const terminalWidth = process.stdout.columns * 0.95 || 100; - + const terminalWidth = Math.max(process.stdout.columns || 120, 80); + const usableWidth = Math.floor(terminalWidth * 0.95); + let colWidths; if (showMetadata) { // With metadata: Tag Name, Tasks, Completed, Created, Description - colWidths = [ - Math.floor(terminalWidth * 0.25), // Tag Name (25%) - Math.floor(terminalWidth * 0.1), // Tasks (10%) - Math.floor(terminalWidth * 0.12), // Completed (12%) - Math.floor(terminalWidth * 0.15), // Created (15%) - Math.floor(terminalWidth * 0.38) // Description (38%) - ]; + const widths = [0.25, 0.1, 0.12, 0.15, 0.38]; + colWidths = widths.map((w, i) => + Math.max(Math.floor(usableWidth * w), i === 0 ? 15 : 8) + ); } else { // Without metadata: Tag Name, Tasks, Completed - colWidths = [ - Math.floor(terminalWidth * 0.7), // Tag Name (70%) - Math.floor(terminalWidth * 0.15), // Tasks (15%) - Math.floor(terminalWidth * 0.15) // Completed (15%) - ]; + const widths = [0.7, 0.15, 0.15]; + colWidths = widths.map((w, i) => + Math.max(Math.floor(usableWidth * w), i === 0 ? 20 : 10) + ); } const table = new Table({