MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / renderInputMode

Method renderInputMode

internal/tui/picker.go:708–739  ·  view source on GitHub ↗

renderInputMode renders the input mode for new PRD name.

(width int)

Source from the content-addressed store, hash-verified

706
707// renderInputMode renders the input mode for new PRD name.
708func (p *PRDPicker) renderInputMode(width int) string {
709 var content strings.Builder
710
711 labelStyle := lipgloss.NewStyle().
712 Foreground(PrimaryColor).
713 Bold(true)
714 content.WriteString(labelStyle.Render("New PRD name:"))
715 content.WriteString("\n\n")
716
717 // Input field
718 inputStyle := lipgloss.NewStyle().
719 Border(lipgloss.RoundedBorder()).
720 BorderForeground(PrimaryColor).
721 Padding(0, 1).
722 Width(width - 4)
723
724 inputValue := p.inputValue
725 if inputValue == "" {
726 inputValue = lipgloss.NewStyle().Foreground(MutedColor).Render("(type a name...)")
727 }
728 // Add cursor
729 cursorStyle := lipgloss.NewStyle().Foreground(PrimaryColor).Blink(true)
730 inputValue += cursorStyle.Render("▌")
731
732 content.WriteString(inputStyle.Render(inputValue))
733 content.WriteString("\n\n")
734
735 hintStyle := lipgloss.NewStyle().Foreground(MutedColor)
736 content.WriteString(hintStyle.Render("Only letters, numbers, - and _ allowed"))
737
738 return content.String()
739}
740
741// buildFooterShortcuts builds context-sensitive shortcuts based on selected entry's state.
742func (p *PRDPicker) buildFooterShortcuts() string {

Callers 1

RenderMethod · 0.95

Calls 2

RenderMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected