fix(cli): name list chrome heights
- commit
- 6e3936de11abe0404614327f53ac175f24e0681a
- author
- brice · · 2026-07-04 07:29 UTC
- parent
- da71e78
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +8 -3
M internal/cli/model/dmenu.go +5 -2
| @@ -64,7 +64,10 @@ type dmenuLoadedMsg struct { | |||
| 64 | 64 | err error | |
| 65 | 65 | } | |
| 66 | 66 | ||
| 67 | - | const defaultDmenuHistoryLimit = 500 | |
| 67 | + | const ( | |
| 68 | + | defaultDmenuHistoryLimit = 500 | |
| 69 | + | dmenuListChromeHeight = 6 | |
| 70 | + | ) | |
| 68 | 71 | ||
| 69 | 72 | // Init implements tea.Model. | |
| 70 | 73 | func (m DmenuModel) Init() tea.Cmd { | |
| @@ -174,7 +177,7 @@ func (m *DmenuModel) updateList() { | |||
| 174 | 177 | // Create list | |
| 175 | 178 | listHeight := max( | |
| 176 | 179 | // Account for search, help | |
| 177 | - | m.height-6, 5) | |
| 180 | + | m.height-dmenuListChromeHeight, 5) | |
| 178 | 181 | ||
| 179 | 182 | m.list = styles.NewHistoryList(m.theme, items, m.width, listHeight) | |
| 180 | 183 | } | |
| @@ -64,7 +64,10 @@ type dmenuLoadedMsg struct { | |||||
| 64 | err error | 64 | err error | ||
| 65 | } | 65 | } | ||
| 66 | 66 | ||||
| 67 | - | const defaultDmenuHistoryLimit = 500 | 67 | + | const ( |
| 68 | + | defaultDmenuHistoryLimit = 500 | |||
| 69 | + | dmenuListChromeHeight = 6 | |||
| 70 | + | ) | |||
| 68 | 71 | ||||
| 69 | // Init implements tea.Model. | 72 | // Init implements tea.Model. | ||
| 70 | func (m DmenuModel) Init() tea.Cmd { | 73 | func (m DmenuModel) Init() tea.Cmd { | ||
| @@ -174,7 +177,7 @@ func (m *DmenuModel) updateList() { | |||||
| 174 | // Create list | 177 | // Create list | ||
| 175 | listHeight := max( | 178 | listHeight := max( | ||
| 176 | // Account for search, help | 179 | // Account for search, help | ||
| 177 | - | m.height-6, 5) | 180 | + | m.height-dmenuListChromeHeight, 5) |
| 178 | 181 | ||||
| 179 | m.list = styles.NewHistoryList(m.theme, items, m.width, listHeight) | 182 | m.list = styles.NewHistoryList(m.theme, items, m.width, listHeight) | ||
| 180 | } | 183 | } | ||
M internal/cli/model/history.go +3 -1
| @@ -20,6 +20,8 @@ import ( | |||
| 20 | 20 | "github.com/bnema/dumber/internal/logging" | |
| 21 | 21 | ) | |
| 22 | 22 | ||
| 23 | + | const historyListChromeHeight = 8 | |
| 24 | + | ||
| 23 | 25 | // HistoryModel is the Bubble Tea model for interactive history browser. | |
| 24 | 26 | type HistoryModel struct { | |
| 25 | 27 | // UI components | |
| @@ -414,7 +416,7 @@ func (m *HistoryModel) updateList() { | |||
| 414 | 416 | // Create new list | |
| 415 | 417 | listHeight := max( | |
| 416 | 418 | // Account for tabs, search, help | |
| 417 | - | m.height-8, 5) | |
| 419 | + | m.height-historyListChromeHeight, 5) | |
| 418 | 420 | ||
| 419 | 421 | m.list = styles.NewHistoryList(m.theme, items, m.width, listHeight) | |
| 420 | 422 | } | |
| @@ -20,6 +20,8 @@ import ( | |||||
| 20 | "github.com/bnema/dumber/internal/logging" | 20 | "github.com/bnema/dumber/internal/logging" | ||
| 21 | ) | 21 | ) | ||
| 22 | 22 | ||||
| 23 | + | const historyListChromeHeight = 8 | |||
| 24 | + | ||||
| 23 | // HistoryModel is the Bubble Tea model for interactive history browser. | 25 | // HistoryModel is the Bubble Tea model for interactive history browser. | ||
| 24 | type HistoryModel struct { | 26 | type HistoryModel struct { | ||
| 25 | // UI components | 27 | // UI components | ||
| @@ -414,7 +416,7 @@ func (m *HistoryModel) updateList() { | |||||
| 414 | // Create new list | 416 | // Create new list | ||
| 415 | listHeight := max( | 417 | listHeight := max( | ||
| 416 | // Account for tabs, search, help | 418 | // Account for tabs, search, help | ||
| 417 | - | m.height-8, 5) | 419 | + | m.height-historyListChromeHeight, 5) |
| 418 | 420 | ||||
| 419 | m.list = styles.NewHistoryList(m.theme, items, m.width, listHeight) | 421 | m.list = styles.NewHistoryList(m.theme, items, m.width, listHeight) | ||
| 420 | } | 422 | } | ||