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.
JavaScript a2aagentic-aiai-agentsdevtoolsmcp-clientn8n-alternativeno-codeopen-sourceorchestrationsmythosvisual-builder
Enhance missing inputs feedback in debugger component
Muhammad Hamza Khanc9b4d731dde2
diff --git a/packages/app/src/builder-ui/components/Component.class/index.ts b/packages/app/src/builder-ui/components/Component.class/index.tsindex 4f002f0b..23aace6f 100644--- a/packages/app/src/builder-ui/components/Component.class/index.ts+++ b/packages/app/src/builder-ui/components/Component.class/index.ts@@ -9,6 +9,7 @@ import { Workspace, WorkspaceDefaults } from '../../workspace/Workspace.class';import { readFormValues, syncCompositeValues } from '../../ui/form';import { ComponentDocLinks } from '@src/builder-ui/enums/doc-links.enum';+import { attachTooltipV2WithHTML } from '@src/builder-ui/utils/tooltip-wrapper-v2';import { errorToast, successToast, warningToast } from '@src/shared/components/toast';import { SMYTHOS_DOCS_URL } from '@src/shared/constants/general';import { Observability } from '@src/shared/observability';@@ -1895,27 +1896,39 @@ export class Component extends EventEmitter {this.domElement.querySelector('.messages-container').innerHTML = '';}/**- * Adds a message to the component's message container- * @param message - The message content to display- * @param type - The type/style of message (default: 'info')- * @param onClick - Optional click handler for the message- * @returns The created message element+ * Adds a message to the component's message container.+ *+ * @param message - The message content to display (string or object with id and text).+ * @param type - The type/style of message (default: 'info').+ * @param onClick - Optional click handler for the message.+ * @param classes - Optional additional CSS classes to apply to the message element.+ * @param tooltipText - Optional tooltip text describing the message in more detail.+ * @returns The created message element.*/public addComponentMessage(message: string | { id: string; text: string },type = 'info',onClick?: (event: MouseEvent) => void,classes?: string,+ tooltipText?: string,): HTMLDivElement {const msg = document.createElement('div');- msg.className = `message ${type} ${classes}`;+ msg.className = `message ${type} ${classes || ''}`;msg.innerHTML = typeof message === 'string' ? message : message.text;+ msg.style.borderRadius = '0px 0px 5px 5px';if (onClick) {msg.style.cursor = 'pointer';msg.addEventListener('click', onClick);}+ attachTooltipV2WithHTML(msg, {+ text: tooltipText || '',+ position: 'bottom',+ delayDuration: 300,+ className: 'text-left text-xs',+ });+this.domElement.querySelector('.messages-container').appendChild(msg);return msg;}diff --git a/packages/app/src/builder-ui/debugger.ts b/packages/app/src/builder-ui/debugger.tsindex 02407725..5bf17915 100644--- a/packages/app/src/builder-ui/debugger.ts+++ b/packages/app/src/builder-ui/debugger.ts@@ -1658,7 +1658,23 @@ export async function processDebugStep(debugInfo, agentID, sessionID?, IDFilter?if (!hasNonButtonMessages) {const component = componentElement['_control'] as Component;if (component) {- component.addComponentMessage('Missing Required Inputs', 'missing-input');+ // Build a tooltip listing the names of required inputs that are currently empty.+ const missingRequiredInputNames = inputEndpoints+ .filter((endpoint) => endpoint.isEmpty && !endpoint.isOptional)+ .map((endpoint) => endpoint.name);++ const tooltipText =+ missingRequiredInputNames.length > 0+ ? `Missing input(s):<br>${missingRequiredInputNames.map((input) => `<span class="font-bold">- ${input}</span>`).join('<br>')}`+ : undefined;++ component.addComponentMessage(+ 'Missing Required Inputs',+ 'missing-input',+ undefined,+ undefined,+ tooltipText,+ );}}// Add icons to all input endpoints@@ -1686,7 +1702,7 @@ export async function processDebugStep(debugInfo, agentID, sessionID?, IDFilter?endpoint.element.appendChild(icon);}}-+// Add icons to all input endpoints regardless of component warning status// for (let endpoint of inputEndpoints) {// // Create the icon@@ -2830,7 +2846,20 @@ export function createDebugInjectDialog().some((message) => message.id !== 'component-button');if (!hasNonButtonMessages) {- component.addComponentMessage(`Missing Required Inputs`, 'missing-input');+ // When all inputs are empty, collect the names so we can expose them in a tooltip.+ const missingInputNames = Object.keys(input);+ const tooltipText =+ missingInputNames.length > 0+ ? `Missing input(s):<br>${missingInputNames.map((input) => `<span class="font-bold">- ${input}</span>`).join('<br>')}`+ : undefined;++ component.addComponentMessage(+ `Missing Required Inputs`,+ 'missing-input',+ undefined,+ undefined,+ tooltipText,+ );}warningToast('Cannot run with empty inputs', 'Please provide input values.');component.domElement.classList.add('has-empty-inputs');diff --git a/packages/app/static/css/smyth-builder.css b/packages/app/static/css/smyth-builder.cssindex d22f816a..b9860fe4 100644--- a/packages/app/static/css/smyth-builder.css+++ b/packages/app/static/css/smyth-builder.css@@ -1109,13 +1109,13 @@ body.locked #agent-sidebar-root .restore-button {.component .button-container {width: 100%;line-height: 25px;- overflow: hidden;+ border-radius: 0px 0px 5px 5px;}.component .messages-container {width: 100%;line-height: 25px;- overflow: hidden;+ border-radius: 0px 0px 5px 5px;}.component .messages-container .message {@@ -1975,7 +1975,6 @@ ul.agents-list-dlg .btn-delete {overflow: visible !important;}-/* css for tooltip in ace editor, to show error, warning, info */.ace_tooltip {font: