Compare commits

...

2 Commits

Author SHA1 Message Date
Ralph Khreish
10e5591bf8 chore: apply requested changes 2025-10-02 15:35:13 +02:00
claude[bot]
ae4c4d9b93 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 <Crunchyman-ralph@users.noreply.github.com>
2025-10-02 15:32:47 +02:00

View File

@@ -619,9 +619,29 @@ async function tags(
headers.push(chalk.cyan.bold('Description'));
}
// Calculate dynamic column widths based on terminal width
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
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
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({
head: headers,
colWidths: showMetadata ? [20, 10, 12, 15, 50] : [25, 10, 12]
colWidths: colWidths,
wordWrap: true
});
// Add rows