on main help sign in
feat: show path when asking if the user wants to initialize project (#867)
a378eb0Andrey Nering
internal/tui/components/chat/splash/splash.go+11−4
@@ -452,6 +452,7 @@ func (s *splashCmp) View() string {
452 )
452 )
453 } else if s.needsProjectInit {
453 } else if s.needsProjectInit {
454 titleStyle := t.S().Base.Foreground(t.FgBase)
454 titleStyle := t.S().Base.Foreground(t.FgBase)
455+ pathStyle := t.S().Base.Foreground(t.Success).PaddingLeft(2)
455 bodyStyle := t.S().Base.Foreground(t.FgMuted)
456 bodyStyle := t.S().Base.Foreground(t.FgMuted)
456 shortcutStyle := t.S().Base.Foreground(t.Success)
457 shortcutStyle := t.S().Base.Foreground(t.Success)
457
458
@@ -459,6 +460,8 @@ func (s *splashCmp) View() string {
459 lipgloss.Left,
460 lipgloss.Left,
460 titleStyle.Render("Would you like to initialize this project?"),
461 titleStyle.Render("Would you like to initialize this project?"),
461 "",
462 "",
463+ pathStyle.Render(s.cwd()),
464+ "",
462 bodyStyle.Render("When I initialize your codebase I examine the project and put the"),
465 bodyStyle.Render("When I initialize your codebase I examine the project and put the"),
463 bodyStyle.Render("result into a CRUSH.md file which serves as general context."),
466 bodyStyle.Render("result into a CRUSH.md file which serves as general context."),
464 "",
467 "",
@@ -545,7 +548,7 @@ func (s *splashCmp) infoSection() string {
545 return infoStyle.Render(
548 return infoStyle.Render(
546 lipgloss.JoinVertical(
549 lipgloss.JoinVertical(
547 lipgloss.Left,
550 lipgloss.Left,
548− s.cwd(),
551+ s.cwdPart(),
549 "",
552 "",
550 s.currentModelBlock(),
553 s.currentModelBlock(),
551 "",
554 "",
@@ -638,15 +641,19 @@ func (s *splashCmp) getMaxInfoWidth() int {
638 return min(s.width-2, 90) // 2 for left padding
641 return min(s.width-2, 90) // 2 for left padding
639}
642}
640
643
644+func (s *splashCmp) cwdPart() string {
645+ t := styles.CurrentTheme()
646+ maxWidth := s.getMaxInfoWidth()
647+ return t.S().Muted.Width(maxWidth).Render(s.cwd())
648+}
649+
641func (s *splashCmp) cwd() string {
650func (s *splashCmp) cwd() string {
642 cwd := config.Get().WorkingDir()
651 cwd := config.Get().WorkingDir()
643− t := styles.CurrentTheme()
644 homeDir, err := os.UserHomeDir()
652 homeDir, err := os.UserHomeDir()
645 if err == nil && cwd != homeDir {
653 if err == nil && cwd != homeDir {
646 cwd = strings.ReplaceAll(cwd, homeDir, "~")
654 cwd = strings.ReplaceAll(cwd, homeDir, "~")
647 }
655 }
648− maxWidth := s.getMaxInfoWidth()
649− return t.S().Muted.Width(maxWidth).Render(cwd)
656+ return cwd
650}
657}
651
658
652func LSPList(maxWidth int) []string {
659func LSPList(maxWidth int) []string {