Skip to content

Commit 59784af

Browse files
feat: improve UI rendering and overlay
- Adjust main UI rendering to ensure background fills viewport - Refactor tag filter overlay to correctly position modal and maintain background - Bumped up version yay
1 parent dfc1b49 commit 59784af

2 files changed

Lines changed: 12 additions & 24 deletions

File tree

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.3
1+
1.0.7

internal/app/model.go

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,14 @@ func (m *Model) renderMainUI() string {
770770
Background(m.s.Theme.Bg).
771771
Render(body)
772772

773-
return lipgloss.JoinVertical(lipgloss.Left, head, body, foot)
773+
mainContent := lipgloss.JoinVertical(lipgloss.Left, head, body, foot)
774+
775+
// Wrap the entire vertical layout to ensure background fills the complete viewport
776+
return lipgloss.NewStyle().
777+
Width(m.width).
778+
Height(m.height).
779+
Background(m.s.Theme.Bg).
780+
Render(mainContent)
774781
}
775782

776783
func (m *Model) rebuildComponentSizes() {
@@ -935,26 +942,6 @@ func (m *Model) renderFooter() string {
935942

936943
// renderTagFilterOverlay renders the tag filter input modal
937944
func (m *Model) renderTagFilterOverlay() string {
938-
head := m.renderHeader()
939-
foot := m.renderFooter()
940-
941-
hHeight := lipgloss.Height(head)
942-
fHeight := lipgloss.Height(foot)
943-
availableHeight := m.height - hHeight - fHeight
944-
if availableHeight < 0 {
945-
availableHeight = 0
946-
}
947-
948-
// Render the body (tasklist) in the background
949-
body := m.list.View()
950-
body = lipgloss.NewStyle().
951-
Height(availableHeight).
952-
Width(m.width).
953-
Background(m.s.Theme.Bg).
954-
Render(body)
955-
956-
mainUI := lipgloss.JoinVertical(lipgloss.Left, head, body, foot)
957-
958945
// Create filter input modal
959946
inputLabel := m.s.Title.Render("Filter by Tag")
960947
input := lipgloss.NewStyle().Padding(0, 1).Render(m.tagFilterInput.View())
@@ -972,10 +959,11 @@ func (m *Model) renderTagFilterOverlay() string {
972959
cardStyle := m.s.Overlay.Width(60)
973960
card := cardStyle.Render(modal)
974961

975-
// Overlay the modal on top of the main UI
962+
// Overlay the modal on top of the screen with proper background
976963
return lipgloss.Place(m.width, m.height, lipgloss.Center, lipgloss.Center, card,
964+
lipgloss.WithWhitespaceChars(" "),
977965
lipgloss.WithWhitespaceBackground(m.s.Theme.Bg),
978-
) + "\n" + mainUI
966+
)
979967
}
980968

981969
func (m *Model) setActiveView(id core.ViewID) {

0 commit comments

Comments
 (0)