diff --git a/internal/ui/form.go b/internal/ui/form.go index de55cde..58231ad 100644 --- a/internal/ui/form.go +++ b/internal/ui/form.go @@ -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), @@ -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() diff --git a/internal/ui/form_test.go b/internal/ui/form_test.go index 212de0a..ade3e9a 100644 --- a/internal/ui/form_test.go +++ b/internal/ui/form_test.go @@ -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) } }) @@ -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 {