fix(ui): align tree subtitle with title text after icons
- commit
- 92c9587cdc029ca7c36fedf6f775c0176dc3263d
- author
- brice · · 2026-03-24 06:07 UTC
- parent
- 736bcae
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +3 -3
M internal/adapters/in/cli/ui/components/tree.go +3 -3
| @@ -101,10 +101,10 @@ func (t *Tree) renderNode(b *strings.Builder, node *Node, prefix string) { | |||
| 101 | 101 | // Title line | |
| 102 | 102 | b.WriteString(prefix + node.Title + "\n") | |
| 103 | 103 | ||
| 104 | - | // Subtitle line (muted) | |
| 104 | + | // Subtitle line (muted, aligned with title text after icons) | |
| 105 | 105 | if node.Subtitle != "" { | |
| 106 | 106 | subtitle := styles.Theme.Muted.Render(node.Subtitle) | |
| 107 | - | b.WriteString(prefix + " " + subtitle + "\n") | |
| 107 | + | b.WriteString(prefix + " " + subtitle + "\n") | |
| 108 | 108 | } | |
| 109 | 109 | ||
| 110 | 110 | // Children | |
| @@ -127,7 +127,7 @@ func (t *Tree) renderNode(b *strings.Builder, node *Node, prefix string) { | |||
| 127 | 127 | // Child subtitle (indented to align under child name) | |
| 128 | 128 | if child.Subtitle != "" { | |
| 129 | 129 | subtitle := styles.Theme.Muted.Render(child.Subtitle) | |
| 130 | - | b.WriteString(prefix + " " + childPrefix + " " + subtitle + "\n") | |
| 130 | + | b.WriteString(prefix + " " + childPrefix + " " + subtitle + "\n") | |
| 131 | 131 | } | |
| 132 | 132 | } | |
| 133 | 133 | } | |
| @@ -101,10 +101,10 @@ func (t *Tree) renderNode(b *strings.Builder, node *Node, prefix string) { | |||||
| 101 | // Title line | 101 | // Title line | ||
| 102 | b.WriteString(prefix + node.Title + "\n") | 102 | b.WriteString(prefix + node.Title + "\n") | ||
| 103 | 103 | ||||
| 104 | - | // Subtitle line (muted) | 104 | + | // Subtitle line (muted, aligned with title text after icons) |
| 105 | if node.Subtitle != "" { | 105 | if node.Subtitle != "" { | ||
| 106 | subtitle := styles.Theme.Muted.Render(node.Subtitle) | 106 | subtitle := styles.Theme.Muted.Render(node.Subtitle) | ||
| 107 | - | b.WriteString(prefix + " " + subtitle + "\n") | 107 | + | b.WriteString(prefix + " " + subtitle + "\n") |
| 108 | } | 108 | } | ||
| 109 | 109 | ||||
| 110 | // Children | 110 | // Children | ||
| @@ -127,7 +127,7 @@ func (t *Tree) renderNode(b *strings.Builder, node *Node, prefix string) { | |||||
| 127 | // Child subtitle (indented to align under child name) | 127 | // Child subtitle (indented to align under child name) | ||
| 128 | if child.Subtitle != "" { | 128 | if child.Subtitle != "" { | ||
| 129 | subtitle := styles.Theme.Muted.Render(child.Subtitle) | 129 | subtitle := styles.Theme.Muted.Render(child.Subtitle) | ||
| 130 | - | b.WriteString(prefix + " " + childPrefix + " " + subtitle + "\n") | 130 | + | b.WriteString(prefix + " " + childPrefix + " " + subtitle + "\n") |
| 131 | } | 131 | } | ||
| 132 | } | 132 | } | ||
| 133 | } | 133 | } | ||