@@ -2,6 +2,7 @@ package editor
@@ -48,14 +49,16 @@ type FileCompletionItem struct {
50type editorCmp struct {
51type editorCmp struct {
51− width int
52+ width int
52− height int
53+ height int
54− app *app.App
55+ app *app.App
55− session session.Session
56+ session session.Session
56− textarea textarea.Model
57+ textarea textarea.Model
57− attachments []message.Attachment
58+ attachments []message.Attachment
58− deleteMode bool
59+ deleteMode bool
60+ readyPlaceholder string
61+ workingPlaceholder string
60 keyMap EditorKeyMap
63 keyMap EditorKeyMap
@@ -157,6 +160,10 @@ func (m *editorCmp) send() tea.Cmd {
157 if value == "" {
160 if value == "" {
158 return nil
161 return nil
164+ // Change the placeholder when sending a new message.
165+ m.randomizePlaceholders()
160 return tea.Batch(
167 return tea.Batch(
161 util.CmdHandler(chat.SendMsg{
168 util.CmdHandler(chat.SendMsg{
162 Text: value,
169 Text: value,
@@ -379,8 +386,31 @@ func (m *editorCmp) Cursor() *tea.Cursor {
379 return cursor
386 return cursor
389+var readyPlaceholders = [...]string{
395+var workingPlaceholders = [...]string{
401+func (m *editorCmp) randomizePlaceholders() {
402+ m.workingPlaceholder = workingPlaceholders[rand.Intn(len(workingPlaceholders))]
403+ m.readyPlaceholder = readyPlaceholders[rand.Intn(len(readyPlaceholders))]
382func (m *editorCmp) View() string {
406func (m *editorCmp) View() string {
383 t := styles.CurrentTheme()
407 t := styles.CurrentTheme()
408+ // Update placeholder
409+ if m.app.CoderAgent.IsBusy() {
410+ m.textarea.Placeholder = m.workingPlaceholder
412+ m.textarea.Placeholder = m.readyPlaceholder
384 if len(m.attachments) == 0 {
414 if len(m.attachments) == 0 {
385 content := t.S().Base.Padding(1).Render(
415 content := t.S().Base.Padding(1).Render(
386 m.textarea.View(),
416 m.textarea.View(),
@@ -510,14 +540,18 @@ func New(app *app.App) Editor {
511 ta.ShowLineNumbers = false
541 ta.ShowLineNumbers = false
512 ta.CharLimit = -1
542 ta.CharLimit = -1
513− ta.Placeholder = "Tell me more about this project..."
514 ta.SetVirtualCursor(false)
543 ta.SetVirtualCursor(false)
515 ta.Focus()
544 ta.Focus()
517− return &editorCmp{
546+ e := &editorCmp{
518 // TODO: remove the app instance from here
547 // TODO: remove the app instance from here
519 app: app,
548 app: app,
520 textarea: ta,
549 textarea: ta,
521 keyMap: DefaultEditorKeyMap(),
550 keyMap: DefaultEditorKeyMap(),
553+ e.randomizePlaceholders()
554+ e.textarea.Placeholder = e.readyPlaceholder