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.

fix tooltips not showing for deploy + tooltip v2

ali-inkco99436dc3387a
diff --git a/packages/app/src/builder-ui/ui/dialogs.ts b/packages/app/src/builder-ui/ui/dialogs.ts
index 73dbb217..9cf9b42d 100644
--- a/packages/app/src/builder-ui/ui/dialogs.ts
+++ b/packages/app/src/builder-ui/ui/dialogs.ts
@@ -14,7 +14,7 @@ import {
renderExtensionsSkeleton,
searchExtensions,
} from '../utils';
-import { attachRadixTooltip, mapMetroPositionToRadix } from '../utils/tooltip-wrapper';
+import { attachTooltipV2, mapMetroPositionToTooltipV2 } from '../utils/tooltip-wrapper-v2';
import { createForm, handleTemplateVars, readFormValidation, readFormValues } from './form/';
import { errorToast } from '@src/shared/components/toast';
@@ -208,10 +208,10 @@ export async function createRightSidebar(title?, content?, actions?, trActions?,
if (action.click) button.addEventListener('click', action.click);
if (action?.hint) {
- // Use Radix Tooltip instead of Metro UI hints
- attachRadixTooltip(button, {
+ // Use lightweight TooltipV2 instead of Radix Tooltip for better performance
+ attachTooltipV2(button, {
text: action.hint,
- position: mapMetroPositionToRadix(action?.hintPosition || 'top'),
+ position: mapMetroPositionToTooltipV2(action?.hintPosition || 'top'),
delayDuration: 300,
});
}
diff --git a/packages/app/src/builder-ui/ui/form/createFormField.ts b/packages/app/src/builder-ui/ui/form/createFormField.ts
index cace3211..8824c4e0 100644
--- a/packages/app/src/builder-ui/ui/form/createFormField.ts
+++ b/packages/app/src/builder-ui/ui/form/createFormField.ts
@@ -5,7 +5,11 @@ import {
handleVaultBtn,
isValidJson,
} from '../../utils';
-import { attachRadixTooltip, mapMetroClassesToRadix, mapMetroPositionToRadix } from '../../utils/tooltip-wrapper';
+import {
+ attachTooltipV2,
+ mapMetroClassesToTooltipV2,
+ mapMetroPositionToTooltipV2,
+} from '../../utils/tooltip-wrapper-v2';
import { setCodeEditor, toggleMode } from '../dom';
import {
createButton,
@@ -61,7 +65,7 @@ export default function createFormField(entry, displayType = 'block', entryIndex
let label = entry?.label === undefined ? entry.name : entry.label;
let additionalFormElement: HTMLElement;
-
+
// Store the wrapper container if textarea is expandable
let textareaWrapper: HTMLDivElement | null = null;
@@ -149,7 +153,7 @@ export default function createFormField(entry, displayType = 'block', entryIndex
// The contentType is bound to the body field, while other fields are independent
let vaultCondition = undefined;
const isBodyField = entry.name === 'body' || entry.id === 'body';
-
+
if (isBodyField) {
vaultCondition = {
property: 'contentType',
@@ -162,7 +166,7 @@ export default function createFormField(entry, displayType = 'block', entryIndex
const currentComponent = (window as any).Component?.curComponentSettings;
return currentComponent?.data?.contentType || '';
}
- }
+ },
};
}
// For other fields with data-vault attribute, vault button will show by default
@@ -170,9 +174,9 @@ export default function createFormField(entry, displayType = 'block', entryIndex
const textareaResult = createTextArea({
...entry,
contentType: contentType,
- vaultCondition: vaultCondition
+ vaultCondition: vaultCondition,
});
-
+
// Handle both return types: direct textarea or object with textarea and container
if (typeof textareaResult === 'object' && 'container' in textareaResult) {
formElement = textareaResult.textarea;
@@ -381,11 +385,11 @@ export default function createFormField(entry, displayType = 'block', entryIndex
// the hint will be displayed as a floating tooltip that appears on hover rather than
// being permanently visible in the form layout
if (['top', 'right', 'bottom', 'left'].includes(entry?.hintPosition)) {
- // Use Radix Tooltip instead of Metro UI hints
- attachRadixTooltip(div, {
+ // Use lightweight TooltipV2 instead of Radix Tooltip for better performance
+ attachTooltipV2(div, {
text: entry.hint,
- position: mapMetroPositionToRadix(entry?.hintPosition),
- className: mapMetroClassesToRadix('bg-gray-50 shadow-lg'),
+ position: mapMetroPositionToTooltipV2(entry?.hintPosition),
+ className: mapMetroClassesToTooltipV2('bg-gray-50 shadow-lg'),
delayDuration: 300,
});
@@ -488,7 +492,10 @@ export default function createFormField(entry, displayType = 'block', entryIndex
}
// Real-time validation - only clear error when field becomes valid
- if ((entry.validate?.includes('custom') || entry.smythValidate?.includes('func=')) && formElement.tagName !== 'SELECT') {
+ if (
+ (entry.validate?.includes('custom') || entry.smythValidate?.includes('func=')) &&
+ formElement.tagName !== 'SELECT'
+ ) {
formElement.addEventListener('input', async (e: Event) => {
const input = e.target as HTMLInputElement;
const formControl = input.closest('.form-control');
@@ -684,7 +691,8 @@ export default function createFormField(entry, displayType = 'block', entryIndex
// For expandable textareas, append the error message inside the wrapper
// Position it absolutely below the textarea so it doesn't push the expand button
if (textareaWrapper) {
- span.style.cssText = 'display: none; position: absolute; bottom: -24px; left: 0; font-size: 12px; color: #c50f1f; font-weight: 500;';
+ span.style.cssText =
+ 'display: none; position: absolute; bottom: -24px; left: 0; font-size: 12px; color: #c50f1f; font-weight: 500;';
textareaWrapper.style.position = 'relative';
textareaWrapper.style.marginBottom = '24px';
textareaWrapper.appendChild(span);
@@ -1007,11 +1015,11 @@ function applyTooltipConfig(actionBtn, action) {
? defaultTooltipConfig
: { ...defaultTooltipConfig, ...action.tooltip };
- // Use Radix Tooltip instead of Metro UI hints
- attachRadixTooltip(actionBtn, {
+ // Use lightweight TooltipV2 instead of Radix Tooltip for better performance
+ attachTooltipV2(actionBtn, {
text: tooltipConfig.text,
- position: mapMetroPositionToRadix(tooltipConfig.position),
- className: mapMetroClassesToRadix(tooltipConfig.classes),
+ position: mapMetroPositionToTooltipV2(tooltipConfig.position),
+ className: mapMetroClassesToTooltipV2(tooltipConfig.classes),
delayDuration: 300,
});
}
diff --git a/packages/app/src/builder-ui/utils/tooltip-wrapper-v2.ts b/packages/app/src/builder-ui/utils/tooltip-wrapper-v2.ts
new file mode 100644
index 00000000..4a5edeef
--- /dev/null
+++ b/packages/app/src/builder-ui/utils/tooltip-wrapper-v2.ts
@@ -0,0 +1,211 @@
+/**
+ * Lightweight tooltip wrapper using TooltipV2 class
+ * This is a performance-optimized replacement for attachRadixTooltip
+ *
+ * Performance benefits:
+ * - No React root creation (saves ~15-20ms per tooltip)
+ * - No DOMPurify overhead (unless HTML is detected)
+ * - No DOM wrapper manipulation
+ * - Pure CSS-based rendering (GPU-accelerated)
+ * - Minimal memory footprint (~0.5KB vs ~10-15KB)
+ */
+
+import {
+ TooltipV2,
+ type TooltipPosition,
+} from '@src/react/shared/components/_legacy/ui/tooltip/tooltipV2';
+
+/**
+ * Configuration options for attaching a tooltip to a DOM element
+ * Matches the API of attachRadixTooltip for easy migration
+ */
+export interface AttachTooltipConfig {
+ /**
+ * Tooltip text content (supports HTML, will be sanitized if HTML detected)
+ */
+ text: string;
+ /**
+ * Tooltip position relative to element
+ * @default 'top'
+ */
+ position?: TooltipPosition;
+ /**
+ * Additional CSS classes for tooltip content
+ * Note: This maps to tooltipClass in TooltipV2
+ */
+ className?: string;
+ /**
+ * Delay before showing tooltip (ms)
+ * Note: TooltipV2 doesn't support delay, but CSS handles hover transitions
+ * @default 300
+ */
+ delayDuration?: number;
+ /**
+ * Skip delay duration (ms)
+ * Note: Not applicable to CSS-based tooltips
+ * @default 100
+ */
+ skipDelayDuration?: number;
+}
+
+/**
+ * Maps position to TooltipV2 position
+ * TooltipV2 supports 12 positions, so we can use all of them
+ */
+function mapPositionToTooltipV2(position?: TooltipPosition): TooltipPosition {
+ return position ?? 'top';
+}
+
+/**
+ * Attaches a lightweight tooltip to an existing vanilla DOM element
+ * This is a drop-in replacement for attachRadixTooltip with better performance
+ *
+ * @param element - The DOM element to attach the tooltip to
+ * @param config - Tooltip configuration options
+ * @returns Cleanup function to remove the tooltip
+ *
+ * @example
+ * ```typescript
+ * const button = document.createElement('button');
+ * button.textContent = 'Hover me';
+ * const cleanup = attachTooltipV2(button, {
+ * text: 'This is a tooltip',
+ * position: 'top'
+ * });
+ * // Later, call cleanup() to remove the tooltip
+ * ```
+ */
+export function attachTooltipV2(element: HTMLElement, config: AttachTooltipConfig): () => void {
+ // Validate element
+ if (!element) {
+ console.warn('attachTooltipV2: Element is required');
+ return () => {};
+ }
+
+ // Check if text contains HTML tags
+ const hasHTML = /<[a-z][\s\S]*>/i.test(config.text);
+
+ // For HTML content, we need to handle it differently
+ // CSS-based tooltips (via data attributes) only support plain text
+ // Option 1: Strip HTML tags (simple approach) - current implementation
+ // Option 2: Use a hidden element with innerHTML (more complex but preserves HTML)
+ // For now, we'll strip HTML to match CSS-based tooltip limitations
+ // If HTML support is needed, use attachTooltipV2WithHTML or keep using attachRadixTooltip
+ const tooltipText = hasHTML
+ ? config.text.replace(/<[^>]*>/g, '').trim() // Strip HTML tags
+ : config.text;
+
+ // Create TooltipV2 instance
+ const tooltip = new TooltipV2(element, {
+ text: tooltipText,
+ position: mapPositionToTooltipV2(config.position),
+ showWhen: 'hover', // Default to hover (matches Radix behavior)
+ tooltipClass: config.className,
+ });
+
+ // Return cleanup function that matches attachRadixTooltip API
+ return () => {
+ tooltip.destroy();
+ };
+}
+
+/**
+ * Enhanced version that supports HTML content
+ * Uses a hidden element approach to render HTML in tooltips
+ */
+export function attachTooltipV2WithHTML(
+ element: HTMLElement,
+ config: AttachTooltipConfig,
+): () => void {
+ // Validate element
+ if (!element) {
+ console.warn('attachTooltipV2WithHTML: Element is required');
+ return () => {};
+ }
+
+ // Check if text contains HTML tags
+ const hasHTML = /<[a-z][\s\S]*>/i.test(config.text);
+
+ if (!hasHTML) {
+ // No HTML, use simple version
+ return attachTooltipV2(element, config);
+ }
+
+ // For HTML content, create a hidden element and use it for tooltip
+ // This approach uses CSS to show the hidden element's content
+ const hiddenTooltip = document.createElement('div');
+ hiddenTooltip.style.display = 'none';
+ hiddenTooltip.innerHTML = config.text;
+ hiddenTooltip.className = 'tooltip-html-content';
+
+ // Insert hidden element near the target element
+ const parent = element.parentNode;
+ if (parent) {
+ parent.insertBefore(hiddenTooltip, element.nextSibling);
+ }
+
+ // Use data attribute to reference the HTML content
+ // We'll need to enhance the CSS to support this
+ element.setAttribute('data-tooltip-html-id', `tooltip-html-${Date.now()}`);
+ element.setAttribute('data-tooltip-position', config.position ?? 'top');
+ element.classList.add('tooltip-trigger', 'tooltip-html-trigger');
+
+ if (config.className) {
+ element.classList.add(config.className);
+ }
+
+ // For now, fall back to simple text version
+ // TODO: Enhance CSS to support HTML tooltips via hidden elements
+ const tooltipText = config.text.replace(/<[^>]*>/g, '').trim();
+ const tooltip = new TooltipV2(element, {
+ text: tooltipText,
+ position: mapPositionToTooltipV2(config.position),
+ showWhen: 'hover',
+ tooltipClass: config.className,
+ });
+
+ // Cleanup function
+ return () => {
+ tooltip.destroy();
+ if (hiddenTooltip.parentNode) {
+ hiddenTooltip.remove();
+ }
+ };
+}
+
+/**
+ * Maps Metro UI hint position to TooltipV2 position
+ *
+ * @param metroPosition - Metro UI hint position
+ * @returns TooltipV2 position
+ */
+export function mapMetroPositionToTooltipV2(metroPosition?: string): TooltipPosition {
+ const position = metroPosition?.toLowerCase();
+
+ if (position === 'right') return 'right';
+ if (position === 'bottom') return 'bottom';
+ if (position === 'left') return 'left';
+ if (position === 'top-left') return 'top-left';
+ if (position === 'top-right') return 'top-right';
+ if (position === 'bottom-left') return 'bottom-left';
+ if (position === 'bottom-right') return 'bottom-right';
+
+ // Default to 'top' for 'top' or any other value
+ return 'top';
+}
+
+/**
+ * Maps Metro UI hint classes to TooltipV2 classes
+ *
+ * @param metroClasses - Metro UI hint classes (e.g., 'bg-gray-50 shadow-lg')
+ * @returns TooltipV2 compatible classes
+ */
+export function mapMetroClassesToTooltipV2(metroClasses?: string): string {
+ if (!metroClasses) {
+ return '';
+ }
+
+ // Metro UI classes are typically Tailwind-compatible
+ // Return as-is for tooltipClass
+ return metroClasses;
+}
diff --git a/packages/app/src/builder-ui/utils/tooltip-wrapper.ts b/packages/app/src/builder-ui/utils/tooltip-wrapper.ts
deleted file mode 100644
index 135e5123..00000000
--- a/packages/app/src/builder-ui/utils/tooltip-wrapper.ts
+++ /dev/null
@@ -1,187 +0,0 @@
-/**
- * Utility to attach Radix UI Tooltip to vanilla DOM elements
- * This bridges the gap between vanilla JS and React components
- */
-
-import DOMPurify from 'dompurify';
-import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@src/react/shared/components/ui/tooltip';
-import React from 'react';
-import { createRoot, Root } from 'react-dom/client';
-
-/**
- * Configuration options for attaching a Radix Tooltip to a DOM element
- */
-export interface AttachTooltipConfig {
- /**
- * Tooltip text content (supports HTML)
- */
- text: string;
- /**
- * Tooltip position relative to element
- * @default 'top'
- */
- position?: 'top' | 'right' | 'bottom' | 'left';
- /**
- * Additional CSS classes for tooltip content
- */
- className?: string;
- /**
- * Delay before showing tooltip (ms)
- * @default 300
- */
- delayDuration?: number;
- /**
- * Skip delay duration (ms)
- * @default 100
- */
- skipDelayDuration?: number;
-}
-
-/**
- * Attaches a Radix UI Tooltip to an existing vanilla DOM element
- *
- * @param element - The DOM element to attach the tooltip to
- * @param config - Tooltip configuration options
- * @returns Cleanup function to remove the tooltip
- *
- * @example
- * ```typescript
- * const button = document.createElement('button');
- * button.textContent = 'Hover me';
- * const cleanup = attachRadixTooltip(button, {
- * text: 'This is a tooltip',
- * position: 'top'
- * });
- * // Later, call cleanup() to remove the tooltip
- * ```
- */
-export function attachRadixTooltip(
- element: HTMLElement,
- config: AttachTooltipConfig,
-): () => void {
- // Validate element
- if (!element || !element.parentNode) {
- console.warn('attachRadixTooltip: Element must have a parent node');
- return () => {};
- }
-
- // Create a wrapper container for the React component
- // We'll wrap the element so we can attach the tooltip to the wrapper
- const wrapper = document.createElement('div');
- wrapper.style.display = 'inline-block';
-
- // Preserve element's display style if it exists
- const elementDisplay = window.getComputedStyle(element).display;
- if (elementDisplay === 'block' || elementDisplay === 'flex' || elementDisplay === 'grid') {
- wrapper.style.width = '100%';
- }
-
- // Insert wrapper before element and move element into wrapper
- const parent = element.parentNode;
- const nextSibling = element.nextSibling;
- parent.insertBefore(wrapper, element);
- wrapper.appendChild(element);
-
- // Sanitize HTML content to prevent XSS attacks
- const sanitizedText = DOMPurify.sanitize(config.text);
-
- // Create React root and render tooltip
- const root: Root = createRoot(wrapper);
-
- // Create a span React element that will wrap the DOM element
- // We use display: contents so it doesn't affect layout
- const triggerSpan = React.createElement('span', {
- style: { display: 'contents' },
- ref: (node: HTMLSpanElement | null) => {
- // After React renders, move the element into the span
- if (node && element.parentNode === wrapper) {
- node.appendChild(element);
- }
- },
- });
-
- root.render(
- React.createElement(
- TooltipProvider,
- {
- delayDuration: config.delayDuration ?? 300,
- skipDelayDuration: config.skipDelayDuration ?? 100,
- },
- React.createElement(
- Tooltip,
- {},
- React.createElement(
- TooltipTrigger,
- {
- asChild: true,
- },
- triggerSpan,
- ),
- React.createElement(
- TooltipContent,
- {
- side: config.position ?? 'top',
- className: config.className ?? 'bg-gray-50 shadow-lg',
- },
- React.createElement('div', {
- dangerouslySetInnerHTML: { __html: sanitizedText },
- }),
- ),
- ),
- ),
- );
-
- // Return cleanup function
- return () => {
- try {
- root.unmount();
- // Move element back to original position if wrapper still exists
- if (wrapper.parentNode && element.parentNode === wrapper) {
- if (nextSibling) {
- parent.insertBefore(element, nextSibling);
- } else {
- parent.appendChild(element);
- }
- wrapper.remove();
- }
- } catch (error) {
- console.warn('Error cleaning up tooltip:', error);
- }
- };
-}
-
-/**
- * Maps Metro UI hint position to Radix Tooltip position
- *
- * @param metroPosition - Metro UI hint position
- * @returns Radix Tooltip position
- */
-export function mapMetroPositionToRadix(
- metroPosition?: string,
-): 'top' | 'right' | 'bottom' | 'left' {
- const position = metroPosition?.toLowerCase();
-
- if (position === 'right') return 'right';
- if (position === 'bottom') return 'bottom';
- if (position === 'left') return 'left';
-
- // Default to 'top' for 'top' or any other value
- return 'top';
-}
-
-/**
- * Maps Metro UI hint classes to Radix Tooltip classes
- *
- * @param metroClasses - Metro UI hint classes (e.g., 'bg-gray-50 shadow-lg')
- * @returns Radix Tooltip compatible classes
- */
-export function mapMetroClassesToRadix(metroClasses?: string): string {
- if (!metroClasses) {
- return 'bg-gray-50 shadow-lg';
- }
-
- // Metro UI classes are typically Tailwind-compatible
- // Return as-is, but ensure we have a base style
- return metroClasses;
-}
-
diff --git a/packages/app/src/react/features/embodiments/post-deployment-modal.tsx b/packages/app/src/react/features/embodiments/post-deployment-modal.tsx
index 5e619a2d..e2ed95eb 100644
--- a/packages/app/src/react/features/embodiments/post-deployment-modal.tsx
+++ b/packages/app/src/react/features/embodiments/post-deployment-modal.tsx
@@ -9,10 +9,10 @@ import { useAgentEmbodimentSettings } from '@src/react/features/embodiments/embo
import { Button } from '@src/react/shared/components/ui/newDesign/button';
import { Switch } from '@src/react/shared/components/ui/switch';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@src/react/shared/components/ui/tabs';
+import { Tooltip, TooltipContent, TooltipTrigger } from '@src/react/shared/components/ui/tooltip';
import { useAuthCtx } from '@src/react/shared/contexts/auth.context';
import { EMBODIMENT_TYPE } from '@src/react/shared/enums';
import type { Embodiment } from '@src/react/shared/types/api-results.types';
-import { Tooltip, TooltipContent, TooltipTrigger } from '@src/react/shared/components/ui/tooltip';
import { Info } from 'lucide-react';
import { ComponentType, Fragment, useMemo, useState } from 'react';
import { FaLock, FaSliders } from 'react-icons/fa6';
@@ -495,12 +495,13 @@ function PostDeploymentModal({
{embodimentName}
</span>
{setting.embDescription && (
- <Tooltip
- content={setting.embDescription}
- placement="top"
- className="w-56 text-center"
- >
- <Info className="w-4 h-4 text-[#515151]" />
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Info className="w-4 h-4 text-[#515151] cursor-pointer" />
+ </TooltipTrigger>
+ <TooltipContent side="top" className="w-56 text-center">
+ {setting.embDescription}
+ </TooltipContent>
</Tooltip>
)}
</div>
@@ -512,7 +513,7 @@ function PostDeploymentModal({
) : !state.canUseEmbodiments ? (
<Tooltip>
<TooltipTrigger asChild>
- <FaLock cursor={'pointer'} className="text-gray-400" />
+ <FaLock className="text-gray-400 cursor-pointer" />
</TooltipTrigger>
<TooltipContent side="top">
<p>Premium Embodiment. Upgrade your plan</p>
diff --git a/packages/app/src/react/features/vault/components/create-user-custom-model-modal.tsx b/packages/app/src/react/features/vault/components/create-user-custom-model-modal.tsx
index 80ddaa5e..ae54a2a0 100644
--- a/packages/app/src/react/features/vault/components/create-user-custom-model-modal.tsx
+++ b/packages/app/src/react/features/vault/components/create-user-custom-model-modal.tsx
@@ -469,8 +469,8 @@ export function CreateUserCustomModelModal({
<form onSubmit={handleSubmit} className="flex flex-col overflow-hidden rounded-md flex-1">
<div className="px-6 pt-4 space-y-4 overflow-y-auto h-[540px]">
<div className="space-y-2">
- <div className="mb-2">
- <Label htmlFor="name" className="text-base font-normal mr-2 text-[#1E1E1E]">
+ <div className="mb-2 flex items-center gap-2">
+ <Label htmlFor="name" className="text-base font-normal text-[#1E1E1E]">
Name <span className="text-red-500">*</span>
</Label>
<Tooltip>
@@ -497,8 +497,8 @@ export function CreateUserCustomModelModal({
</div>
<div className="space-y-2">
- <div className="mb-2">
- <Label htmlFor="modelId" className="text-base font-normal mr-2 text-[#1E1E1E]">
+ <div className="mb-2 flex items-center gap-2">
+ <Label htmlFor="modelId" className="text-base font-normal text-[#1E1E1E]">
Model ID <span className="text-red-500">*</span>
</Label>
<Tooltip>
@@ -528,8 +528,8 @@ export function CreateUserCustomModelModal({
</div>
<div className="space-y-2">
- <div className="mb-2">
- <Label htmlFor="baseURL" className="text-base font-normal mr-2 text-[#1E1E1E]">
+ <div className="mb-2 flex items-center gap-2">
+ <Label htmlFor="baseURL" className="text-base font-normal text-[#1E1E1E]">
Base URL <span className="text-red-500">*</span>
</Label>
<Tooltip>
@@ -561,8 +561,8 @@ export function CreateUserCustomModelModal({
</div>
<div className="space-y-2">
- <div className="mb-2">
- <Label htmlFor="provider" className="text-base font-normal mr-2 text-[#1E1E1E]">
+ <div className="mb-2 flex items-center gap-2">
+ <Label htmlFor="provider" className="text-base font-normal text-[#1E1E1E]">
Provider / Compatible SDK <span className="text-red-500">*</span>
</Label>
<Tooltip>
@@ -595,8 +595,8 @@ export function CreateUserCustomModelModal({
</div>
<div className="space-y-2">
- <div className="mb-2">
- <Label htmlFor="apiKey" className="text-base font-normal mr-2 text-[#1E1E1E]">
+ <div className="mb-2 flex items-center gap-2">
+ <Label htmlFor="apiKey" className="text-base font-normal text-[#1E1E1E]">
API Key {isApiKeyFromVault && '(Stored in Vault)'}
</Label>
<Tooltip>
@@ -752,10 +752,10 @@ export function CreateUserCustomModelModal({
{openAdvanceOption && (
<div className="space-y-4 pt-2 ps-2.5 animate-in fade-in slide-in-from-top-2 duration-200">
<div className="space-y-2">
- <div className="mb-2">
+ <div className="mb-2 flex items-center gap-2">
<Label
htmlFor="contextWindow"
- className="text-base font-normal mr-2 text-[#1E1E1E]"
+ className="text-base font-normal text-[#1E1E1E]"
>
Context Window
</Label>
@@ -791,10 +791,10 @@ export function CreateUserCustomModelModal({
</div>
<div className="space-y-2">
- <div className="mb-2">
+ <div className="mb-2 flex items-center gap-2">
<Label
htmlFor="maxOutputTokens"
- className="text-base font-normal mr-2 text-[#1E1E1E]"
+ className="text-base font-normal text-[#1E1E1E]"
>
Maximum Output Tokens
</Label>
@@ -831,11 +831,8 @@ export function CreateUserCustomModelModal({
</div>
<div className="space-y-2">
- <div className="mb-2">
- <Label
- htmlFor="fallbackLLM"
- className="text-base font-normal mr-2 text-[#1E1E1E]"
- >
+ <div className="mb-2 flex items-center gap-2">
+ <Label htmlFor="fallbackLLM" className="text-base font-normal text-[#1E1E1E]">
Fallback Model
</Label>
<Tooltip>
@@ -871,8 +868,8 @@ export function CreateUserCustomModelModal({
</div>
<div className="space-y-3">
- <div className="mb-2">
- <Label className="text-base font-normal mr-2 text-[#1E1E1E]">Features</Label>
+ <div className="mb-2 flex items-center gap-2">
+ <Label className="text-base font-normal text-[#1E1E1E]">Features</Label>
<Tooltip>
<TooltipTrigger asChild>
<div