From 7b1914262610b73ed6873705402dee5760b32feb Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Tue, 16 Dec 2025 13:47:21 -0500 Subject: [PATCH] fix(ui): editor: show yolo prompt correctly --- internal/ui/model/ui.go | 15 ++++++++++----- internal/ui/styles/styles.go | 4 ++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/internal/ui/model/ui.go b/internal/ui/model/ui.go index bc8d1bb17ac9e1c651cf3f3aac150047ee16fa7c..52b6f80a71d02b2866fead4f296abccbd66b5ae1 100644 --- a/internal/ui/model/ui.go +++ b/internal/ui/model/ui.go @@ -151,7 +151,7 @@ func New(com *common.Common) *UI { ui.focus = uiFocusEditor } - ui.setEditorPrompt() + ui.setEditorPrompt(false) ui.randomizePlaceholders() ui.textarea.Placeholder = ui.readyPlaceholder ui.help.Styles = com.Styles.Help @@ -390,7 +390,9 @@ func (m *UI) handleKeyPressMsg(msg tea.KeyPressMsg) (cmds []tea.Cmd) { // Command dialog messages case dialog.ToggleYoloModeMsg: - m.com.App.Permissions.SetSkipRequests(!m.com.App.Permissions.SkipRequests()) + yolo := !m.com.App.Permissions.SkipRequests() + m.com.App.Permissions.SetSkipRequests(yolo) + m.setEditorPrompt(yolo) m.dialog.CloseDialog(dialog.CommandsID) case dialog.SwitchSessionsMsg: cmds = append(cmds, m.listSessions) @@ -927,8 +929,8 @@ type layout struct { // setEditorPrompt configures the textarea prompt function based on whether // yolo mode is enabled. -func (m *UI) setEditorPrompt() { - if m.com.App.Permissions.SkipRequests() { +func (m *UI) setEditorPrompt(yolo bool) { + if yolo { m.textarea.SetPromptFunc(4, m.yoloPromptFunc) return } @@ -940,7 +942,10 @@ func (m *UI) setEditorPrompt() { func (m *UI) normalPromptFunc(info textarea.PromptInfo) string { t := m.com.Styles if info.LineNumber == 0 { - return " > " + if info.Focused { + return " > " + } + return "::: " } if info.Focused { return t.EditorPromptNormalFocused.Render() diff --git a/internal/ui/styles/styles.go b/internal/ui/styles/styles.go index 7690bdb704de6338754d931373fcf29924efc6a8..c78cdcacd2b4a3636ae07fc2f75ccdf9fe984d9b 100644 --- a/internal/ui/styles/styles.go +++ b/internal/ui/styles/styles.go @@ -828,9 +828,9 @@ func DefaultStyles() Styles { // Editor s.EditorPromptNormalFocused = lipgloss.NewStyle().Foreground(greenDark).SetString("::: ") s.EditorPromptNormalBlurred = s.EditorPromptNormalFocused.Foreground(fgMuted) - s.EditorPromptYoloIconFocused = lipgloss.NewStyle().Foreground(charmtone.Oyster).Background(charmtone.Citron).Bold(true).SetString(" ! ") + s.EditorPromptYoloIconFocused = lipgloss.NewStyle().MarginRight(1).Foreground(charmtone.Oyster).Background(charmtone.Citron).Bold(true).SetString(" ! ") s.EditorPromptYoloIconBlurred = s.EditorPromptYoloIconFocused.Foreground(charmtone.Pepper).Background(charmtone.Squid) - s.EditorPromptYoloDotsFocused = lipgloss.NewStyle().Foreground(charmtone.Zest).SetString(":::") + s.EditorPromptYoloDotsFocused = lipgloss.NewStyle().MarginRight(1).Foreground(charmtone.Zest).SetString(":::") s.EditorPromptYoloDotsBlurred = s.EditorPromptYoloDotsFocused.Foreground(charmtone.Squid) // Logo colors