worktreeDisplayPath returns a display-friendly worktree path.
(entry PRDEntry)
| 625 | |
| 626 | // worktreeDisplayPath returns a display-friendly worktree path. |
| 627 | func (p *PRDPicker) worktreeDisplayPath(entry PRDEntry) string { |
| 628 | if entry.WorktreeDir == "" { |
| 629 | return "(current directory)" |
| 630 | } |
| 631 | // Show relative path from base dir |
| 632 | rel, err := filepath.Rel(p.basePath, entry.WorktreeDir) |
| 633 | if err != nil { |
| 634 | return entry.WorktreeDir |
| 635 | } |
| 636 | return rel + "/" |
| 637 | } |
| 638 | |
| 639 | // formatBranchPath formats branch and path info to fit within maxWidth. |
| 640 | // maxWidth is in display characters (runes). |
no outgoing calls