on main help sign in
fix(ui): editor: show yolo prompt correctly
commit7b1914262610b73ed6873705402dee5760b32feb authorAyman Bagabas <ayman.bagabas@gmail.com> dateTue 16 Dec 2025, 13:47 (1 year ago) parente593297
2 files changed+12−7
internal/ui/model/ui.go+10−5 internal/ui/styles/styles.go+2−2
internal/ui/model/ui.go+10−5
@@ -151,7 +151,7 @@ func New(com *common.Common) *UI {
151151 ui.focus = uiFocusEditor
152152 }
153153
154− ui.setEditorPrompt()
154+ ui.setEditorPrompt(false)
155155 ui.randomizePlaceholders()
156156 ui.textarea.Placeholder = ui.readyPlaceholder
157157 ui.help.Styles = com.Styles.Help
@@ -390,7 +390,9 @@ func (m *UI) handleKeyPressMsg(msg tea.KeyPressMsg) (cmds []tea.Cmd) {
390390
391391 // Command dialog messages
392392 case dialog.ToggleYoloModeMsg:
393− m.com.App.Permissions.SetSkipRequests(!m.com.App.Permissions.SkipRequests())
393+ yolo := !m.com.App.Permissions.SkipRequests()
394+ m.com.App.Permissions.SetSkipRequests(yolo)
395+ m.setEditorPrompt(yolo)
394396 m.dialog.CloseDialog(dialog.CommandsID)
395397 case dialog.SwitchSessionsMsg:
396398 cmds = append(cmds, m.listSessions)
@@ -927,8 +929,8 @@ type layout struct {
927929
928930// setEditorPrompt configures the textarea prompt function based on whether
929931// yolo mode is enabled.
930−func (m *UI) setEditorPrompt() {
931− if m.com.App.Permissions.SkipRequests() {
932+func (m *UI) setEditorPrompt(yolo bool) {
933+ if yolo {
932934 m.textarea.SetPromptFunc(4, m.yoloPromptFunc)
933935 return
934936 }
@@ -940,7 +942,10 @@ func (m *UI) setEditorPrompt() {
940942func (m *UI) normalPromptFunc(info textarea.PromptInfo) string {
941943 t := m.com.Styles
942944 if info.LineNumber == 0 {
943− return " > "
945+ if info.Focused {
946+ return " > "
947+ }
948+ return "::: "
944949 }
945950 if info.Focused {
946951 return t.EditorPromptNormalFocused.Render()
internal/ui/styles/styles.go+2−2
@@ -828,9 +828,9 @@ func DefaultStyles() Styles {
828828 // Editor
829829 s.EditorPromptNormalFocused = lipgloss.NewStyle().Foreground(greenDark).SetString("::: ")
830830 s.EditorPromptNormalBlurred = s.EditorPromptNormalFocused.Foreground(fgMuted)
831− s.EditorPromptYoloIconFocused = lipgloss.NewStyle().Foreground(charmtone.Oyster).Background(charmtone.Citron).Bold(true).SetString(" ! ")
831+ s.EditorPromptYoloIconFocused = lipgloss.NewStyle().MarginRight(1).Foreground(charmtone.Oyster).Background(charmtone.Citron).Bold(true).SetString(" ! ")
832832 s.EditorPromptYoloIconBlurred = s.EditorPromptYoloIconFocused.Foreground(charmtone.Pepper).Background(charmtone.Squid)
833− s.EditorPromptYoloDotsFocused = lipgloss.NewStyle().Foreground(charmtone.Zest).SetString(":::")
833+ s.EditorPromptYoloDotsFocused = lipgloss.NewStyle().MarginRight(1).Foreground(charmtone.Zest).SetString(":::")
834834 s.EditorPromptYoloDotsBlurred = s.EditorPromptYoloDotsFocused.Foreground(charmtone.Squid)
835835
836836 // Logo colors