Skip to content

Commit 11d27b2

Browse files
authored
Merge pull request #831 from benodiwal/fix/todos-layout-sidebar
fix: moved TODOs up in the sidebar
2 parents 05988bc + 14cd217 commit 11d27b2

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

pkg/tui/components/sidebar/sidebar.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -244,18 +244,9 @@ func (m *model) verticalView() string {
244244

245245
m.todoComp.SetSize(m.width)
246246
todoContent := strings.TrimSuffix(m.todoComp.Render(), "\n")
247-
248-
// Calculate available height for content
249-
availableHeight := m.height - 2 // Account for borders
250-
topHeight := strings.Count(topContent, "\n") + 1
251-
todoHeight := strings.Count(todoContent, "\n") + 1
252-
253-
// Calculate padding needed to push todos to bottom
254-
paddingHeight := max(availableHeight-topHeight-todoHeight, 0)
255-
for range paddingHeight {
256-
topContent += "\n"
247+
if todoContent != "" {
248+
topContent += "\n\n" + todoContent
257249
}
258-
topContent += todoContent
259250

260251
return styles.BaseStyle.
261252
Width(m.width).

pkg/tui/components/tool/todotool/sidebar.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func (c *SidebarComponent) Render() string {
6363
}
6464

6565
var content strings.Builder
66-
content.WriteString(styles.HighlightStyle.Render("TODOs"))
66+
content.WriteString(styles.HighlightStyle.Render("TODOS"))
6767
content.WriteString("\n")
6868

6969
for _, todo := range c.manager.GetTodos() {

0 commit comments

Comments
 (0)