mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 21:03:19 +00:00
Merge pull request #1199 from academo/academo/implement-set-expand-tool-api
feat: add setToolsExpanded and getToolsExpanded to ExtensionsUIContext
This commit is contained in:
commit
6909f61884
4 changed files with 25 additions and 2 deletions
|
|
@ -1396,6 +1396,8 @@ export class InteractiveMode {
|
|||
}
|
||||
return result;
|
||||
},
|
||||
getToolsExpanded: () => this.toolOutputExpanded,
|
||||
setToolsExpanded: (expanded) => this.setToolsExpanded(expanded),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -2662,10 +2664,14 @@ export class InteractiveMode {
|
|||
}
|
||||
|
||||
private toggleToolOutputExpansion(): void {
|
||||
this.toolOutputExpanded = !this.toolOutputExpanded;
|
||||
this.setToolsExpanded(!this.toolOutputExpanded);
|
||||
}
|
||||
|
||||
private setToolsExpanded(expanded: boolean): void {
|
||||
this.toolOutputExpanded = expanded;
|
||||
for (const child of this.chatContainer.children) {
|
||||
if (isExpandable(child)) {
|
||||
child.setExpanded(this.toolOutputExpanded);
|
||||
child.setExpanded(expanded);
|
||||
}
|
||||
}
|
||||
this.ui.requestRender();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue