From 85b13fcd8100d9752b10865d97f672eb25e7f63e Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Thu, 17 Jul 2025 13:27:49 -0400 Subject: [PATCH] fix(tui): splash: cache logo rendering on resize Only re-render the logo when the width changes. --- internal/tui/components/chat/splash/splash.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/tui/components/chat/splash/splash.go b/internal/tui/components/chat/splash/splash.go index 8dd30ec0258b83e52e80cf3af2baa05727857ea1..60fd5e42bcdd2f608d596590accb9c9734c0435c 100644 --- a/internal/tui/components/chat/splash/splash.go +++ b/internal/tui/components/chat/splash/splash.go @@ -133,9 +133,12 @@ func (s *splashCmp) Init() tea.Cmd { // SetSize implements SplashPage. func (s *splashCmp) SetSize(width int, height int) tea.Cmd { + rerenderLogo := width != s.width s.height = height s.width = width - s.logoRendered = s.logoBlock() + if rerenderLogo { + s.logoRendered = s.logoBlock() + } // remove padding, logo height, gap, title space s.listHeight = s.height - lipgloss.Height(s.logoRendered) - (SplashScreenPaddingY * 2) - s.logoGap() - 2 listWidth := min(60, width)