From ae4c4d9b931a7cb8a1fdd29836ad5cd607a91122 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 12:54:44 +0000 Subject: [PATCH] fix: make tag listing table use dynamic column widths to prevent truncation - Replace hardcoded colWidths with terminal-width-based calculation - Tag Name column now gets 70% width (normal) or 25% width (metadata mode) - Add wordWrap support for better handling of long tag names - Fixes issue where tag names >20 chars were truncated with ellipsis - Users can now see full tag names for use with use-tag command Co-authored-by: Ralph Khreish --- .../modules/task-manager/tag-management.js | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/scripts/modules/task-manager/tag-management.js b/scripts/modules/task-manager/tag-management.js index c17f7068..2c3fd6a8 100644 --- a/scripts/modules/task-manager/tag-management.js +++ b/scripts/modules/task-manager/tag-management.js @@ -619,9 +619,32 @@ async function tags( headers.push(chalk.cyan.bold('Description')); } + // Calculate dynamic column widths based on terminal width + const terminalWidth = process.stdout.columns * 0.95 || 100; + + 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%) + ]; + } 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 table = new Table({ head: headers, - colWidths: showMetadata ? [20, 10, 12, 15, 50] : [25, 10, 12] + colWidths: colWidths, + wordWrap: true }); // Add rows