@@ -143,9 +143,11 @@ func (s *splashCmp) Init() tea.Cmd {
144// SetSize implements SplashPage.
144// SetSize implements SplashPage.
145func (s *splashCmp) SetSize(width int, height int) tea.Cmd {
145func (s *splashCmp) SetSize(width int, height int) tea.Cmd {
146+ wasSmallScreen := s.isSmallScreen()
147+ rerenderLogo := width != s.width
146 s.height = height
148 s.height = height
147− if width != s.width {
149+ s.width = width
148− s.width = width
150+ if rerenderLogo || wasSmallScreen != s.isSmallScreen() {
149 s.logoRendered = s.logoBlock()
151 s.logoRendered = s.logoBlock()
151 // remove padding, logo height, gap, title space
153 // remove padding, logo height, gap, title space
@@ -541,9 +543,19 @@ func (s *splashCmp) Cursor() *tea.Cursor {
541 return nil
543 return nil
546+func (s *splashCmp) isSmallScreen() bool {
547+ // Consider a screen small if either the width is less than 40 or if the
548+ // height is less than 20
549+ return s.width < 55 || s.height < 20
544func (s *splashCmp) infoSection() string {
552func (s *splashCmp) infoSection() string {
545 t := styles.CurrentTheme()
553 t := styles.CurrentTheme()
546− return t.S().Base.PaddingLeft(2).Render(
554+ infoStyle := t.S().Base.PaddingLeft(2)
555+ if s.isSmallScreen() {
556+ infoStyle = infoStyle.MarginTop(1)
558+ return infoStyle.Render(
547 lipgloss.JoinVertical(
559 lipgloss.JoinVertical(
548 lipgloss.Left,
560 lipgloss.Left,
@@ -556,14 +568,25 @@ func (s *splashCmp) infoSection() string {
557func (s *splashCmp) logoBlock() string {
569func (s *splashCmp) logoBlock() string {
558 t := styles.CurrentTheme()
570 t := styles.CurrentTheme()
559− return t.S().Base.Padding(0, 2).Width(s.width).Render(
571+ logoStyle := t.S().Base.Padding(0, 2).Width(s.width)
572+ if s.isSmallScreen() {
573+ // If the width is too small, render a smaller version of the logo
574+ // NOTE: 20 is not correct because [splashCmp.height] is not the
575+ // *actual* window height, instead, it is the height of the splash
576+ // component and that depends on other variables like compact mode and
577+ // the height of the editor.
578+ return logoStyle.Render(
579+ logo.SmallRender(s.width - logoStyle.GetHorizontalFrameSize()),
582+ return logoStyle.Render(
560 logo.Render(version.Version, false, logo.Opts{
583 logo.Render(version.Version, false, logo.Opts{
561 FieldColor: t.Primary,
584 FieldColor: t.Primary,
562 TitleColorA: t.Secondary,
585 TitleColorA: t.Secondary,
563 TitleColorB: t.Primary,
586 TitleColorB: t.Primary,
564 CharmColor: t.Secondary,
587 CharmColor: t.Secondary,
565 VersionColor: t.Primary,
588 VersionColor: t.Primary,
566− Width: s.width - 4,
589+ Width: s.width - logoStyle.GetHorizontalFrameSize(),