fix(coding-agent): allow tool expansion during extension confirms
closes #4429
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed tool output expansion while extension confirmation dialogs are focused ([#4429](https://github.com/earendil-works/pi/issues/4429)).
|
||||||
- Fixed auto-retry for Anthropic streams that end before `message_stop` ([#4433](https://github.com/earendil-works/pi/issues/4433)).
|
- Fixed auto-retry for Anthropic streams that end before `message_stop` ([#4433](https://github.com/earendil-works/pi/issues/4433)).
|
||||||
- Fixed theme sharing across package scopes so extensions do not crash with `Theme not initialized` ([#4333](https://github.com/earendil-works/pi/issues/4333)).
|
- Fixed theme sharing across package scopes so extensions do not crash with `Theme not initialized` ([#4333](https://github.com/earendil-works/pi/issues/4333)).
|
||||||
- Fixed keybinding hints to show Option instead of Alt on macOS ([#4289](https://github.com/earendil-works/pi/issues/4289)).
|
- Fixed keybinding hints to show Option instead of Alt on macOS ([#4289](https://github.com/earendil-works/pi/issues/4289)).
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { keyHint, rawKeyHint } from "./keybinding-hints.js";
|
|||||||
export interface ExtensionSelectorOptions {
|
export interface ExtensionSelectorOptions {
|
||||||
tui?: TUI;
|
tui?: TUI;
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
|
onToggleToolsExpanded?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ExtensionSelectorComponent extends Container {
|
export class ExtensionSelectorComponent extends Container {
|
||||||
@@ -23,6 +24,7 @@ export class ExtensionSelectorComponent extends Container {
|
|||||||
private titleText: Text;
|
private titleText: Text;
|
||||||
private baseTitle: string;
|
private baseTitle: string;
|
||||||
private countdown: CountdownTimer | undefined;
|
private countdown: CountdownTimer | undefined;
|
||||||
|
private onToggleToolsExpanded: (() => void) | undefined;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
title: string,
|
title: string,
|
||||||
@@ -36,6 +38,7 @@ export class ExtensionSelectorComponent extends Container {
|
|||||||
this.options = options;
|
this.options = options;
|
||||||
this.onSelectCallback = onSelect;
|
this.onSelectCallback = onSelect;
|
||||||
this.onCancelCallback = onCancel;
|
this.onCancelCallback = onCancel;
|
||||||
|
this.onToggleToolsExpanded = opts?.onToggleToolsExpanded;
|
||||||
this.baseTitle = title;
|
this.baseTitle = title;
|
||||||
|
|
||||||
this.addChild(new DynamicBorder());
|
this.addChild(new DynamicBorder());
|
||||||
@@ -87,7 +90,9 @@ export class ExtensionSelectorComponent extends Container {
|
|||||||
|
|
||||||
handleInput(keyData: string): void {
|
handleInput(keyData: string): void {
|
||||||
const kb = getKeybindings();
|
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.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
||||||
this.updateList();
|
this.updateList();
|
||||||
} else if (kb.matches(keyData, "tui.select.down") || keyData === "j") {
|
} else if (kb.matches(keyData, "tui.select.down") || keyData === "j") {
|
||||||
|
|||||||
@@ -2024,7 +2024,7 @@ export class InteractiveMode {
|
|||||||
this.hideExtensionSelector();
|
this.hideExtensionSelector();
|
||||||
resolve(undefined);
|
resolve(undefined);
|
||||||
},
|
},
|
||||||
{ tui: this.ui, timeout: opts?.timeout },
|
{ tui: this.ui, timeout: opts?.timeout, onToggleToolsExpanded: () => this.toggleToolOutputExpansion() },
|
||||||
);
|
);
|
||||||
|
|
||||||
this.editorContainer.clear();
|
this.editorContainer.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user