Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions internal/ui/form.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func NewFormModel(database *db.DB, width, height int, workingDir string, availab
db: database,
width: width,
height: height,
focused: FieldTitle, // Start on Title for simpler first experience
focused: FieldProject, // Project first for immediate context
autocompleteSvc: autocompleteSvc,
autocompleteEnabled: autocompleteEnabled,
taskRefAutocomplete: NewTaskRefAutocompleteModel(database, width-24),
Expand Down Expand Up @@ -383,13 +383,17 @@ func NewFormModel(database *db.DB, width, height int, workingDir string, availab
// Load last used executor for the selected project (overrides default if available)
m.loadLastExecutorForProject()

// Title input - focused by default for simpler first experience
// Title input
m.titleInput = textinput.New()
m.titleInput.Placeholder = "What needs to be done?"
m.titleInput.Prompt = ""
m.titleInput.Cursor.SetMode(cursor.CursorStatic)
m.titleInput.Width = width - 24
m.titleInput.Focus() // Start with title focused
// Focus title only if project field is not visible (showAdvanced is false)
if !m.showAdvanced {
m.focused = FieldTitle
m.titleInput.Focus()
}

// Body textarea
m.bodyInput = textarea.New()
Expand Down
7 changes: 4 additions & 3 deletions internal/ui/form_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -875,14 +875,14 @@ func TestFormDefaultsToFirstAvailableExecutor(t *testing.T) {
}

func TestFormProgressiveDisclosure(t *testing.T) {
t.Run("new form starts in advanced mode focused on title", func(t *testing.T) {
t.Run("new form starts in advanced mode focused on project", func(t *testing.T) {
m := NewFormModel(nil, 100, 50, "", []string{"claude"})

if !m.showAdvanced {
t.Error("expected new form to start with showAdvanced=true")
}
if m.focused != FieldTitle {
t.Errorf("expected focus on FieldTitle, got %d", m.focused)
if m.focused != FieldProject {
t.Errorf("expected focus on FieldProject, got %d", m.focused)
}
})

Expand Down Expand Up @@ -945,6 +945,7 @@ func TestFormProgressiveDisclosure(t *testing.T) {
t.Run("focusNext skips hidden fields in simple mode", func(t *testing.T) {
m := NewFormModel(nil, 100, 50, "", []string{"claude"})
m.showAdvanced = false // Switch to simple mode for this test
m.focused = FieldTitle // Manually set focus to first visible field for this test

// Start on Title
if m.focused != FieldTitle {
Expand Down