From 1aa4b92bb36e683d4c32e500e62e7ce83e22a5bc Mon Sep 17 00:00:00 2001 From: Hadi Date: Fri, 29 May 2026 10:51:10 +0200 Subject: [PATCH] add titles Signed-off-by: Hadi --- internal/ui/app/view.go | 20 +++++++++++--------- internal/ui/home/view.go | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/internal/ui/app/view.go b/internal/ui/app/view.go index e4b4003..99c8c1a 100644 --- a/internal/ui/app/view.go +++ b/internal/ui/app/view.go @@ -6,25 +6,28 @@ import ( ilovetui "github.com/anotherhadi/ilovetui" ) +func (m Model) newView(content string) tea.View { + v := tea.NewView(content) + v.AltScreen = true + v.WindowTitle = "Spilltea: " + m.projectName + return v +} + func (m Model) View() tea.View { if m.width == 0 { - v := tea.NewView("") - v.AltScreen = true - return v + return m.newView("") } normal := m.renderNormal() if m.copyAs.IsOpen() { - v := tea.NewView(m.copyAs.View(normal)) - v.AltScreen = true + v := m.newView(m.copyAs.View(normal)) v.MouseMode = tea.MouseModeCellMotion return v } if m.copy.IsOpen() { - v := tea.NewView(m.copy.View(normal)) - v.AltScreen = true + v := m.newView(m.copy.View(normal)) v.MouseMode = tea.MouseModeCellMotion return v } @@ -34,8 +37,7 @@ func (m Model) View() tea.View { rendered = m.notifications.View(normal) } - v := tea.NewView(rendered) - v.AltScreen = true + v := m.newView(rendered) v.MouseMode = tea.MouseModeCellMotion return v } diff --git a/internal/ui/home/view.go b/internal/ui/home/view.go index 56002e1..cfc6f3e 100644 --- a/internal/ui/home/view.go +++ b/internal/ui/home/view.go @@ -45,6 +45,7 @@ func (m Model) View() tea.View { v := tea.NewView(content) v.AltScreen = true v.MouseMode = tea.MouseModeCellMotion + v.WindowTitle = "Spilltea" return v }