Fix empty self-rendered tool rows

closes #5299
This commit is contained in:
Mario Zechner
2026-06-02 15:25:27 +02:00
parent 6e269edfd0
commit 0d38e17b68
3 changed files with 57 additions and 0 deletions

View File

@@ -222,6 +222,31 @@ export class ToolExecutionComponent extends Container {
if (this.hideComponent) {
return [];
}
if (this.hasRendererDefinition() && this.getRenderShell() === "self") {
const contentLines = this.selfRenderContainer.render(width);
if (contentLines.length === 0 && this.imageComponents.length === 0) {
return [];
}
const lines: string[] = [];
if (contentLines.length > 0) {
lines.push("");
lines.push(...contentLines);
}
for (let i = 0; i < this.imageComponents.length; i++) {
const spacer = this.imageSpacers[i];
if (spacer) {
lines.push(...spacer.render(width));
}
const imageComponent = this.imageComponents[i];
if (imageComponent) {
lines.push(...imageComponent.render(width));
}
}
return lines;
}
return super.render(width);
}