Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

1. repaint skills on name change. 2. add css to break agent name on agent card so it does not shifts avatar around

ali-inkco432adb26f6c1
diff --git a/packages/app/src/builder-ui/components/AgentCard.class.ts b/packages/app/src/builder-ui/components/AgentCard.class.ts
index ce260987..2829b54b 100644
--- a/packages/app/src/builder-ui/components/AgentCard.class.ts
+++ b/packages/app/src/builder-ui/components/AgentCard.class.ts
@@ -165,6 +165,37 @@ export class AgentCard extends EventEmitter {
return Promise.resolve();
}
+ /**
+ * Refresh skill connections for the agent card
+ * This method updates only the connections between the agent card and skills
+ * without redrawing the entire card - useful when agent properties change
+ */
+ public async repaintSkillConnections(): Promise<void> {
+ if (!this.workspace.agent?.data?.components) return;
+
+ // Get skills once to avoid duplicate filtering
+ const skills = this.workspace.agent.data.components.filter((c) => c.name === 'APIEndpoint');
+ if (skills.length === 0) return;
+
+ // Handle connections for all skills
+ for (const skill of skills) {
+ await this.handleCompConn(skill.id);
+ }
+
+ // Single repaint operation for all affected elements
+ // This is more efficient than multiple individual repaints
+ const elementsToRepaint = [
+ this.domElement, // Agent card
+ ...skills.map(skill => document.querySelector(`#${skill.id}`)).filter(Boolean)
+ ];
+
+ elementsToRepaint.forEach(element => {
+ if (element) {
+ this.workspace.jsPlumbInstance.repaint(element);
+ }
+ });
+ }
+
/**
* Redraw the agent card
*/
@@ -638,10 +669,12 @@ export class AgentCard extends EventEmitter {
e.stopPropagation();
});
- this.workspace.addEventListener('AgentSaved', () => {
+ this.workspace.addEventListener('AgentSaved', async () => {
if (agentNameElement && this.workspace.agent?.data?.name != agentNameElement.textContent) {
agentNameElement.textContent = this.workspace.agent?.data?.name || '';
+ await this.repaintSkillConnections();
}
+
// const topBarAgentAvatarElm: HTMLImageElement | null = document.querySelector('#agent-avatar');
diff --git a/packages/app/static/css/smyth-builder.css b/packages/app/static/css/smyth-builder.css
index 0de3e919..b324a67e 100644
--- a/packages/app/static/css/smyth-builder.css
+++ b/packages/app/static/css/smyth-builder.css
@@ -2289,6 +2289,7 @@ input[data-vault-exclusive='true']:disabled {
margin: 0;
color: #333;
cursor: text;
+ word-break: break-all;
}
.menu-button {