Read PR description, comments, commits, and changed files.
UnderstandIdentified and read linked issues.
UnderstandAnalyzed PR diff and relevant code files.
UnderstandYou are given one or more GitHub PR URLs: https://github.com/badlogic/pi-mono/pull/972
For each PR URL, do the following in order:
packages/*/CHANGELOG.md files. Report whether an entry exists. If missing, state that a changelog entry is required before merge and that you will add it if the user decides to merge. Follow the changelog format rules in AGENTS.md. Verify:
### Breaking Changes, ### Added, ### Fixed, etc.)Fixed foo ([#123](https://github.com/badlogic/pi-mono/pull/123) by [@user](https://github.com/user))### Breaking Changes, not just ### FixedOutput format per PR: PR: Changelog:
If no issues are found, say so under Bad and Ugly.
Let me start by reading the PR page in full to understand what changes are being proposed.
>gh pr view 972 --json title,body,comments,commits,files{"body":"Fixes #916\n\nAdds an `autocompleteMaxVisible` setting (range 3-20, default 5) to control how many items are visible in the editor's autocomplete dropdown.\n\n\n\n### Changes\n- `packages/tui/src/components/editor.ts`: Add `autocompleteMaxVisible` to `EditorOptions`, store as field, use in `SelectList` creation instead of hardcoded `5`\n- `packages/coding-agent/src/core/settings-manager.ts`: Add to `Settings` interface, add getter/setter\n- `packages/coding-agent/src/modes/interactive/components/settings-selector.ts`: Add UI toggle with presets [3, 5, 7, 10, 15, 20]\n- `packages/coding-agent/src/modes/interactive/interactive-mode.ts`: Pass setting to editor, wire up callback\n- `packages/coding-agent/docs/settings.md`: Document in settings table","comments":[{"id":"IC_kwDOPbFNk87jAVEX","author":{"login":"badlogic"},"authorAssociation":"OWNER","body":"@masonc15 Left a tiny review, please amend.","createdAt":"2026-01-28T01:54:58Z","includesCreatedEdit":false,"isMinimized":false,"minimizedReason":"","reactionGroups":[],"url":"https://github.com/badlogic/pi-mono/pull/972#issuecomment-3808514327","viewerDidAuthor":true}],"commits":[{"authoredDate":"2026-01-27T01:02:24Z","authors":[{"email":"[REDACTED]","id":"MDQ6VXNlcjcwNjk1MjE=","login":"masonc15","name":"Colin Mason"}],"committedDate":"2026-01-27T01:04:20Z","messageBody":"…ight","messageHeadline":"feat: add autocompleteMaxVisible setting for configurable dropdown he…","oid":"76d4573938691e9cc6549244a9047ba0cbf21667"}],"files":[{"path":"packages/coding-agent/docs/settings.md","additions":1,"deletions":0},{"path":"packages/coding-agent/src/core/settings-manager.ts","additions":10,"deletions":0},{"path":"packages/coding-agent/src/modes/interactive/components/settings-selector.ts","additions":15,"deletions":0},{"path":"packages/coding-agent/src/modes/interactive/interactive-mode.ts","additions":10,"deletions":1},{"path":"packages/tui/src/components/editor.ts","additions":19,"deletions":3}],"title":"feat: add autocompleteMaxVisible setting for configurable dropdown height"}Good, I have an overview of the PR. Let me now read the linked issue #916 in full to understand the context better.
>gh issue view 916 --json title,body,comments,labels,state{"body":"### What do you want to change?\n\nHey! I would like to add a configurable `autocompleteMaxVisible` setting which allows the user to specify how many lines (height) they want pi to display for its prompt autocomplete dropdown.\n\n### Why?\n\nThe current hardcoded value is 5, which I often find too cramped or compact compared to other coding agents I use (Claude Code, Amp, etc.). \n\n<img width=\"1938\" height=\"406\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/c45b7d84-cacf-414b-a7e4-21d7ab239dd6\" />\n\nI went with a few configurable preset values for simplicity (3, 5, 7, 10, 15, and 20) but any line value can be set manually in `settings.json`.\n\n**After**:\n\n<img width=\"2376\" height=\"788\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/974be64d-2ca7-4549-85ad-633949633703\" />\n\n Let me know if this implementation makes sense for pi or should be tweaked at all!\n\n### How? (optional)\n\nFollow the `editorPaddingX` pattern:\n- `packages/tui/src/components/editor.ts`: Add `autocompleteMaxVisible` to `EditorOptions`, store as field, use in `SelectList` creation instead of hardcoded `5`\n- `packages/coding-agent/src/core/settings-manager.ts`: Add to `Settings` interface, add getter/setter\n- `packages/coding-agent/src/modes/interactive/components/settings-selector.ts`: Add UI toggle with presets [3, 5, 7, 10, 15, 20]\n- `packages/coding-agent/src/modes/interactive/interactive-mode.ts`: Pass setting to editor, wire up callback\n- `packages/coding-agent/README.md`: Document in settings table","comments":[{"id":"IC_kwDOPbFNk87h-_Qu","author":{"login":"badlogic"},"authorAssociation":"OWNER","body":"lgtm please send a PR.","createdAt":"2026-01-23T17:24:31Z","includesCreatedEdit":false,"isMinimized":false,"minimizedReason":"","reactionGroups":[],"url":"https://github.com/badlogic/pi-mono/issues/916#issuecomment-3791385646","viewerDidAuthor":true},{"id":"IC_kwDOPbFNk87h-_di","author":{"login":"github-actions"},"authorAssociation":"CONTRIBUTOR","body":"@masonc15 has been added to the approved contributors list. You can now submit PRs. Thanks for contributing!","createdAt":"2026-01-23T17:24:40Z","includesCreatedEdit":false,"isMinimized":false,"minimizedReason":"","reactionGroups":[],"url":"https://github.com/badlogic/pi-mono/issues/916#issuecomment-3791386466","viewerDidAuthor":false}],"labels":[],"state":"CLOSED","title":"Add autocompleteMaxVisible setting for configurable dropdown height"}None
Now let me get the diff for the PR and read all the changed files for analysis.
>gh pr diff 972diff --git a/packages/coding-agent/docs/settings.md b/packages/coding-agent/docs/settings.md
index 7798cc7f2..1690dec62 100644
--- a/packages/coding-agent/docs/settings.md
+++ b/packages/coding-agent/docs/settings.md
@@ -43,6 +43,7 @@ Edit directly or use `/settings` for common options.
| `collapseChangelog` | boolean | `false` | Show condensed changelog after updates |
| `doubleEscapeAction` | string | `"tree"` | Action for double-escape: `"tree"` or `"fork"` |
| `editorPaddingX` | number | `0` | Horizontal padding for input editor (0-3) |
+| `autocompleteMaxVisible` | number | `5` | Max visible items in autocomplete dropdown (3-20) |
| `showHardwareCursor` | boolean | `false` | Show terminal cursor |
### Compaction
diff --git a/packages/coding-agent/src/core/settings-manager.ts b/packages/coding-agent/src/core/settings-manager.ts
index 177c3ecdd..42111970f 100644
--- a/packages/coding-agent/src/core/settings-manager.ts
+++ b/packages/coding-agent/src/core/settings-manager.ts
@@ -81,6 +81,7 @@ export interface Settings {
doubleEscapeAction?: "fork" | "tree"; // Action for double-escape with empty editor (default: "tree")
thinkingBudgets?: ThinkingBudgetsSettings; // Custom token budgets for thinking levels
editorPaddingX?: number; // Horizontal padding for input editor (default: 0)
+ autocompleteMaxVisible?: number; // Max visible items in autocomplete dropdown (default: 5)
showHardwareCursor?: boolean; // Show terminal cursor while still positioning it for IME
markdown?: MarkdownSettings;
}
@@ -611,6 +612,15 @@ export class SettingsManager {
this.save();
}
+ getAutocompleteMaxVisible(): number {
+ return this.settings.autocompleteMaxVisible ?? 5;
+ }
+
+ setAutocompleteMaxVisible(maxVisible: number): void {
+ this.globalSettings.autocompleteMaxVisible = Math.max(3, Math.min(20, Math.floor(maxVisible)));
+ this.save();
+ }
+
getCodeBlockIndent(): string {
return this.settings.markdown?.codeBlockIndent ?? " ";
}
diff --git a/packages/coding-agent/src/modes/interactive/components/settings-selector.ts b/packages/coding-agent/src/modes/interactive/components/settings-selector.ts
index 4b67e4a22..a79a7d48a 100644
--- a/packages/coding-agent/src/modes/interactive/components/settings-selector.ts
+++ b/packages/coding-agent/src/modes/interactive/components/settings-selector.ts
@@ -38,6 +38,7 @@ export interface SettingsConfig {
doubleEscapeAction: "fork" | "tree";
showHardwareCursor: boolean;
editorPaddingX: number;
+ autocompleteMaxVisible: number;
quietStartup: boolean;
}
@@ -57,6 +58,7 @@ export interface SettingsCallbacks {
onDoubleEscapeActionChange: (action: "fork" | "tree") => void;
onShowHardwareCursorChange: (enabled: boolean) => void;
onEditorPaddingXChange: (padding: number) => void;
+ onAutocompleteMaxVisibleChange: (maxVisible: number) => void;
onQuietStartupChange: (enabled: boolean) => void;
onCancel: () => void;
}
@@ -300,6 +302,16 @@ export class SettingsSelectorComponent extends Container {
values: ["0", "1", "2", "3"],
});
+ // Autocomplete max visible toggle (insert after editor-padding)
+ const editorPaddingIndex = items.findIndex((item) => item.id === "editor-padding");
+ items.splice(editorPaddingIndex + 1, 0, {
+ id: "autocomplete-max-visible",
+ label: "Autocomplete max items",
+ description: "Max visible items in autocomplete dropdown (3-20)",
+ currentValue: String(config.autocompleteMaxVisible),
+ values: ["3", "5", "7", "10", "15", "20"],
+ });
+
// Add borders
this.addChild(new DynamicBorder());
@@ -348,6 +360,9 @@ export class SettingsSelectorComponent extends Container {
case "editor-padding":
callbacks.onEditorPaddingXChange(parseInt(newValue, 10));
break;
+ case "autocomplete-max-visible":
+ callbacks.onAutocompleteMaxVisibleChange(parseInt(newValue, 10));
+ break;
}
},
callbacks.onCancel,
diff --git a/packages/coding-agent/src/modes/interactive/interactive-mode.ts b/packages/coding-agent/src/modes/interactive/interactive-mode.ts
index b1bd9dfa6..5a02b0373 100644
--- a/packages/coding-agent/src/modes/interactive/interactive-mode.ts
+++ b/packages/coding-agent/src/modes/interactive/interactive-mode.ts
@@ -261,7 +261,11 @@ export class InteractiveMode {
this.widgetContainerBelow = new Container();
this.keybindings = KeybindingsManager.create();
const editorPaddingX = this.settingsManager.getEditorPaddingX();
- this.defaultEditor = new CustomEditor(this.ui, getEditorTheme(), this.keybindings, { paddingX: editorPaddingX });
+ const autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();
+ this.defaultEditor = new CustomEditor(this.ui, getEditorTheme(), this.keybindings, {
+ paddingX: editorPaddingX,
+ autocompleteMaxVisible,
+ });
this.editor = this.defaultEditor;
this.editorContainer = new Container();
this.editorContainer.addChild(this.editor as Component);
@@ -2963,6 +2967,7 @@ export class InteractiveMode {
doubleEscapeAction: this.settingsManager.getDoubleEscapeAction(),
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
editorPaddingX: this.settingsManager.getEditorPaddingX(),
+ autocompleteMaxVisible: this.settingsManager.getAutocompleteMaxVisible(),
quietStartup: this.settingsManager.getQuietStartup(),
},
{
@@ -3045,6 +3050,10 @@ export class InteractiveMode {
this.editor.setPaddingX(padding);
}
},
+ onAutocompleteMaxVisibleChange: (maxVisible) => {
+ this.settingsManager.setAutocompleteMaxVisible(maxVisible);
+ this.defaultEditor.setAutocompleteMaxVisible(maxVisible);
+ },
onCancel: () => {
done();
this.ui.requestRender();
diff --git a/packages/tui/src/components/editor.ts b/packages/tui/src/components/editor.ts
index 328293675..ab2ba54f8 100644
--- a/packages/tui/src/components/editor.ts
+++ b/packages/tui/src/components/editor.ts
@@ -146,6 +146,7 @@ export interface EditorTheme {
export interface EditorOptions {
paddingX?: number;
+ autocompleteMaxVisible?: number;
}
export class Editor implements Component, Focusable {
@@ -176,6 +177,7 @@ export class Editor implements Component, Focusable {
private autocompleteList?: SelectList;
private isAutocompleting: boolean = false;
private autocompletePrefix: string = "";
+ private autocompleteMaxVisible: number = 5;
// Paste tracking for large pastes
private pastes: Map<number, string> = new Map();
@@ -208,6 +210,8 @@ export class Editor implements Component, Focusable {
this.borderColor = theme.borderColor;
const paddingX = options.paddingX ?? 0;
this.paddingX = Number.isFinite(paddingX) ? Math.max(0, Math.floor(paddingX)) : 0;
+ const maxVisible = options.autocompleteMaxVisible ?? 5;
+ this.autocompleteMaxVisible = Number.isFinite(maxVisible) ? Math.max(3, Math.min(20, Math.floor(maxVisible))) : 5;
}
getPaddingX(): number {
@@ -222,6 +226,18 @@ export class Editor implements Component, Focusable {
}
}
+ getAutocompleteMaxVisible(): number {
+ return this.autocompleteMaxVisible;
+ }
+
+ setAutocompleteMaxVisible(maxVisible: number): void {
+ const newMaxVisible = Number.isFinite(maxVisible) ? Math.max(3, Math.min(20, Math.floor(maxVisible))) : 5;
+ if (this.autocompleteMaxVisible !== newMaxVisible) {
+ this.autocompleteMaxVisible = newMaxVisible;
+ this.tui.requestRender();
+ }
+ }
+
setAutocompleteProvider(provider: AutocompleteProvider): void {
this.autocompleteProvider = provider;
}
@@ -1742,7 +1758,7 @@ export class Editor implements Component, Focusable {
if (suggestions && suggestions.items.length > 0) {
this.autocompletePrefix = suggestions.prefix;
- this.autocompleteList = new SelectList(suggestions.items, 5, this.theme.selectList);
+ this.autocompleteList = new SelectList(suggestions.items, this.autocompleteMaxVisible, this.theme.selectList);
this.isAutocompleting = true;
} else {
this.cancelAutocomplete();
@@ -1792,7 +1808,7 @@ https://github.com/EsotericSoftware/spine-runtimes/actions/runs/19536643416/job/
if (suggestions && suggestions.items.length > 0) {
this.autocompletePrefix = suggestions.prefix;
- this.autocompleteList = new SelectList(suggestions.items, 5, this.theme.selectList);
+ this.autocompleteList = new SelectList(suggestions.items, this.autocompleteMaxVisible, this.theme.selectList);
this.isAutocompleting = true;
} else {
this.cancelAutocomplete();
@@ -1821,7 +1837,7 @@ https://github.com/EsotericSoftware/spine-runtimes/actions/runs/19536643416/job/
if (suggestions && suggestions.items.length > 0) {
this.autocompletePrefix = suggestions.prefix;
// Always create new SelectList to ensure update
- this.autocompleteList = new SelectList(suggestions.items, 5, this.theme.selectList);
+ this.autocompleteList = new SelectList(suggestions.items, this.autocompleteMaxVisible, this.theme.selectList);
} else {
this.cancelAutocomplete();
}None None Now let me read the current main branch files to compare against the diff. I'll read all the files that are modified in the PR. <|tool_calls_section_begin|> <|tool_call_begin|> functions.read:3 <|tool_call_argument_begin|> {"path": "/Users/badlogic/workspaces/pi-mono/packages/tui/src/components/editor.ts"} <|tool_call_end|> <|tool_call_begin|> functions.read:4 <|tool_call_argument_begin|> {"path": "/Users/badlogic/workspaces/pi-mono/packages/coding-agent/src/core/settings-manager.ts"} <|tool_call_end|> <|tool_call_begin|> functions.read:5 <|tool_call_argument_begin|> {"path": "/Users/badlogic/workspaces/pi-mono/packages/coding-agent/src/modes/interactive/components/settings-selector.ts"} <|tool_call_end|> <|tool_call_begin|> functions.read:6 <|tool_call_argument_begin|> {"path": "/Users/badlogic/workspaces/pi-mono/packages/coding-agent/src/modes/interactive/interactive-mode.ts"} <|tool_call_end|> <|tool_call_begin|> functions.read:7 <|tool_call_argument_begin|> {"path": "/Users/badlogic/workspaces/pi-mono/packages/coding-agent/docs/settings.md"} <|tool_call_end|> <|tool_calls_section_end|>