fix(coding-agent): allow tool expansion during extension confirms
closes #4429
This commit is contained in:
@@ -12,6 +12,7 @@ import { keyHint, rawKeyHint } from "./keybinding-hints.js";
|
||||
export interface ExtensionSelectorOptions {
|
||||
tui?: TUI;
|
||||
timeout?: number;
|
||||
onToggleToolsExpanded?: () => void;
|
||||
}
|
||||
|
||||
export class ExtensionSelectorComponent extends Container {
|
||||
@@ -23,6 +24,7 @@ export class ExtensionSelectorComponent extends Container {
|
||||
private titleText: Text;
|
||||
private baseTitle: string;
|
||||
private countdown: CountdownTimer | undefined;
|
||||
private onToggleToolsExpanded: (() => void) | undefined;
|
||||
|
||||
constructor(
|
||||
title: string,
|
||||
@@ -36,6 +38,7 @@ export class ExtensionSelectorComponent extends Container {
|
||||
this.options = options;
|
||||
this.onSelectCallback = onSelect;
|
||||
this.onCancelCallback = onCancel;
|
||||
this.onToggleToolsExpanded = opts?.onToggleToolsExpanded;
|
||||
this.baseTitle = title;
|
||||
|
||||
this.addChild(new DynamicBorder());
|
||||
@@ -87,7 +90,9 @@ export class ExtensionSelectorComponent extends Container {
|
||||
|
||||
handleInput(keyData: string): void {
|
||||
const kb = getKeybindings();
|
||||
if (kb.matches(keyData, "tui.select.up") || keyData === "k") {
|
||||
if (kb.matches(keyData, "app.tools.expand")) {
|
||||
this.onToggleToolsExpanded?.();
|
||||
} else if (kb.matches(keyData, "tui.select.up") || keyData === "k") {
|
||||
this.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
||||
this.updateList();
|
||||
} else if (kb.matches(keyData, "tui.select.down") || keyData === "j") {
|
||||
|
||||
Reference in New Issue
Block a user