feat: improve --list output formatting (issue #68) #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Improves the readability and compactness of the
--listcommand output by implementing dynamic column formatting and intelligent path truncation that preserves path structure.Changes
1. Dynamic Column Spacing
2. Intelligent Directory Path Truncation (Improved)
~/) and compresses the middle with...feature/,worktrees/)~/code/worktrees/feature/103-manager-reply-from-dashboard→~/.../feature/...r-reply-from-dashboardtruncateDirectoryPath()helper function3. Always Show Name Column
Example Output
Before (v0.9.0):
After (This PR):
Note how parent directories (
feature/,worktrees/) are preserved!Very Long Path Example (New):
For paths with extremely long names:
Note: The truncation preserves the structure and shows
.../...-branch-with-extremely-long-nameto indicate there's a long path structure that's been compressed.Testing
Implementation Details
The implementation uses a two-pass approach:
The truncation algorithm intelligently:
~/.../parent/filenameWhen a port is busy and has Docker container info, the directory is updated from live data, which is then reflected in the output.
Closes #68
🤖 Generated with Claude Code