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.

Remove unused attribute for modal textarea and clean up vault dropdown handling in the vault utilities.

Muhammad Hamza Khaneb28d2d9ed53
diff --git a/packages/app/src/builder-ui/ui/form/fields.bak.ts b/packages/app/src/builder-ui/ui/form/fields.bak.ts
index d0d45361..b132a3e0 100644
--- a/packages/app/src/builder-ui/ui/form/fields.bak.ts
+++ b/packages/app/src/builder-ui/ui/form/fields.bak.ts
@@ -1045,10 +1045,6 @@ async function handleExpandTextarea(
// Copy vault attribute to modal textarea
modalTextarea.setAttribute('data-vault', hasVaultAttribute);
- // Mark this textarea as coming from expanded/modal view
- // This is used to hide the "Add Key" option in the vault dropdown
- modalTextarea.setAttribute('data-vault-from-modal', 'true');
-
// Create vault button for modal
const modalVaultButton = createVaultButton();
textareaWrapper.appendChild(modalVaultButton);
diff --git a/packages/app/src/builder-ui/ui/form/fields/index.ts b/packages/app/src/builder-ui/ui/form/fields/index.ts
index 31ecc4d4..daa13a64 100644
--- a/packages/app/src/builder-ui/ui/form/fields/index.ts
+++ b/packages/app/src/builder-ui/ui/form/fields/index.ts
@@ -1048,10 +1048,6 @@ async function handleExpandTextarea(
// Copy vault attribute to modal textarea
modalTextarea.setAttribute('data-vault', hasVaultAttribute);
- // Mark this textarea as coming from expanded/modal view
- // This is used to hide the "Add Key" option in the vault dropdown
- modalTextarea.setAttribute('data-vault-from-modal', 'true');
-
// Create vault button for modal
const modalVaultButton = createVaultButton();
textareaWrapper.appendChild(modalVaultButton);
diff --git a/packages/app/src/builder-ui/utils/vault.utils.ts b/packages/app/src/builder-ui/utils/vault.utils.ts
index 9dc5c698..06967677 100644
--- a/packages/app/src/builder-ui/utils/vault.utils.ts
+++ b/packages/app/src/builder-ui/utils/vault.utils.ts
@@ -340,6 +340,11 @@ const _innerLink = (targetField: HTMLInputElement, message: string = '', keyName
actionBtn.appendChild(spinner);
actionBtn.disabled = true;
+ const existingDropdown = document.getElementById('vault-keys-dropdown-menu');
+ if (existingDropdown) {
+ existingDropdown.remove();
+ }
+
try {
let selectedText = '';
@@ -393,14 +398,10 @@ export const renderVaultKeyBtnItems = ({
const keyNames = keyBtns.map((item) => item.textContent);
const keyNameToAdd = keyNamesInTheTargetField.find((name) => !keyNames.includes(name));
- // Check if vault is opened from expanded textarea modal
- const isFromModal = targetField.getAttribute('data-vault-from-modal') === 'true';
-
// Show the link to add a new key only if:
// 1. The scope is not global
- // 2. The vault is NOT opened from an expanded textarea modal
const scope = targetField.getAttribute('data-vault') || 'All';
- if (scope !== 'global' && !isFromModal) {
+ if (scope !== 'global') {
const msgElm = _innerLink(targetField, !!keyBtns?.length ? '' : 'No Keys found ', keyNameToAdd);
dropdownContent.appendChild(msgElm);