-
Notifications
You must be signed in to change notification settings - Fork 0
fix(init): align main menu order #346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11325,8 +11325,8 @@ func TestHuhInitMenuPrompterAccessibleShowsMenuEntries(t *testing.T) { | |
| } | ||
| out := stderr.String() | ||
| for _, want := range []string{ | ||
| "Configure reviewer entities (3)", | ||
| "Configure LLM runtimes (2)", | ||
| "Configure reviewer entities (3)", | ||
| "Configure review profiles (1)", | ||
| "Configure global settings", | ||
| "Configure secrets management", | ||
|
|
@@ -11344,11 +11344,13 @@ func TestHuhInitMenuPrompterAccessibleShowsMenuEntries(t *testing.T) { | |
| t.Fatalf("stderr = %q, want temporary v2 menu item removed", out) | ||
| } | ||
| assertContentOrder(t, out, | ||
| "Configure reviewer entities (3)", | ||
| "Configure LLM runtimes (2)", | ||
| "Configure reviewer entities (3)", | ||
| "Configure review profiles (1)", | ||
| "Configure global settings", | ||
| "Configure secrets management", | ||
| "Commit staged changes and exit", | ||
| "Discard staged changes and exit", | ||
| ) | ||
| } | ||
|
|
||
|
|
@@ -11396,8 +11398,25 @@ func TestHuhInitMenuPrompterDefaultStartsAtTopWhenProfileIsActive(t *testing.T) | |
| if err != nil { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 Low (harness-engineering:harness-self-documenting-code-reviewer): TestHuhInitMenuPrompterDefaultStartsAtTopWhenProfileIsActive uses 'top' abstractly, but this PR changed what 'top' maps to (LLM runtimes is now first, previously reviewer entities). A name like TestHuhInitMenuPrompterDefaultStartsAtLLMRuntimesWhenWorkspaceActive makes the contract explicit and would catch future ordering regressions at the name level. Reply to this thread when addressed. |
||
| t.Fatalf("ChooseAction: %v", err) | ||
| } | ||
| if action != initMenuActionLLMRuntimes { | ||
| t.Fatalf("action = %q, want LLM runtimes as first active-workspace configuration item", action) | ||
| } | ||
| } | ||
|
|
||
| func TestInitMenuInitialActionFallsBackToReviewerWhenLLMDisabled(t *testing.T) { | ||
| action := initMenuInitialAction(initMenuPrompt{ | ||
| HasWorkspace: true, | ||
| CanConfigureReviewer: true, | ||
| }) | ||
| if action != initMenuActionReviewerEntities { | ||
| t.Fatalf("action = %q, want first main-menu configuration item", action) | ||
| t.Fatalf("action = %q, want reviewer entities when LLM runtimes are disabled", action) | ||
| } | ||
| } | ||
|
|
||
| func TestInitMenuInitialActionStartsAtReviewProfilesBeforeWorkspace(t *testing.T) { | ||
| action := initMenuInitialAction(initMenuPrompt{}) | ||
| if action != initMenuActionReviewProfiles { | ||
| t.Fatalf("action = %q, want review profiles before workspace-dependent actions are enabled", action) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -11447,7 +11466,7 @@ func TestHuhInitMenuPrompterAccessibleRejectsDisabledLLMUntilProfileExists(t *te | |
| var stderr bytes.Buffer | ||
| prompter := huhInitMenuPrompter{ | ||
| stdin: strings.NewReader(strings.Join([]string{ | ||
| "2", // Configure LLM runtimes (disabled) | ||
| "1", // Configure LLM runtimes (disabled) | ||
| "7", // Discard staged changes and exit | ||
| "", | ||
| }, "\n")), | ||
|
|
@@ -11465,6 +11484,29 @@ func TestHuhInitMenuPrompterAccessibleRejectsDisabledLLMUntilProfileExists(t *te | |
| } | ||
| } | ||
|
|
||
| func TestHuhInitMenuPrompterAccessibleRejectsDisabledReviewerUntilProfileExists(t *testing.T) { | ||
| t.Setenv("TERM", "dumb") | ||
| var stderr bytes.Buffer | ||
| prompter := huhInitMenuPrompter{ | ||
| stdin: strings.NewReader(strings.Join([]string{ | ||
| "2", // Configure reviewer entities (disabled) | ||
| "7", // Discard staged changes and exit | ||
| "", | ||
| }, "\n")), | ||
| stderr: &stderr, | ||
| } | ||
| action, err := prompter.ChooseAction(initMenuPrompt{}) | ||
| if err != nil { | ||
| t.Fatalf("ChooseAction: %v", err) | ||
| } | ||
| if action == initMenuActionReviewerEntities { | ||
| t.Fatalf("action = %q, want disabled reviewer selection to be rejected", action) | ||
| } | ||
| if !strings.Contains(stderr.String(), "configure a review profile before editing reviewer entities") { | ||
| t.Fatalf("stderr = %q, want disabled-reviewer validation message", stderr.String()) | ||
| } | ||
| } | ||
|
|
||
| func TestHuhInitMenuPrompterAccessibleSelectsReviewProfiles(t *testing.T) { | ||
| t.Setenv("TERM", "dumb") | ||
| var stderr bytes.Buffer | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔵 Low (harness-engineering:harness-knowledge-reviewer): The PR description references a 'documented UX contract' for menu ordering (LLM runtimes → reviewer entities → review profiles → global settings → secrets management → commit → discard) but does not cite where that contract lives in the repo. If the rationale exists only in issue #341 or PR descriptions, it should be captured in a versioned docs/ artifact so contributors can understand the ordering without mining git history.
Reply to this thread when addressed.