Skip to content

fix(list): respect terminal width and work from repo root#268

Merged
avihut merged 2 commits intomasterfrom
fix/list
Feb 24, 2026
Merged

fix(list): respect terminal width and work from repo root#268
avihut merged 2 commits intomasterfrom
fix/list

Conversation

@avihut
Copy link
Owner

@avihut avihut commented Feb 24, 2026

Summary

  • Detect terminal width and dynamically truncate the table to fit using tabled's Width::truncate() with Priority::max (widest columns shrink first). When piped (no TTY), full content is preserved for scripting.
  • Fix daft list failing when run from the bare repo root directory (outside any worktree) by making get_current_worktree_path() optional — no worktree gets the > current marker when not inside one.

Test plan

  • mise run fmt — no changes needed
  • mise run clippy — zero warnings
  • mise run test:unit — all tests pass
  • Manual: resize terminal to various widths and run daft list — table fits within boundaries
  • Manual: daft list | cat — full content preserved (no truncation)
  • Manual: run daft list from repo root (outside any worktree) — works without error

🤖 Generated with Claude Code

avihut and others added 2 commits February 24, 2026 14:55
Detect terminal width and dynamically truncate the table to fit,
shrinking the widest columns first via tabled's Priority::max. When
piped (no TTY), full content is preserved for scripting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Handle the case where `daft list` is run from the bare repo root
directory (not inside an active worktree). Use `.ok()` on
`get_current_worktree_path()` so the command continues gracefully
instead of bailing — no worktree gets the `>` current marker.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@avihut avihut added this to the v1.1.0 milestone Feb 24, 2026
@avihut avihut added the fix Bug fix label Feb 24, 2026
@avihut avihut self-assigned this Feb 24, 2026
@avihut avihut merged commit c60dee0 into master Feb 24, 2026
6 checks passed
@avihut avihut deleted the fix/list branch February 24, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant