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 tooltip for search location field in GenAI LLM component

Forhad Hosain0db5117d5be9
diff --git a/packages/app/src/builder-ui/components/GenAILLM.class.ts b/packages/app/src/builder-ui/components/GenAILLM.class.ts
index 5ed6cef0..1c54b424 100644
--- a/packages/app/src/builder-ui/components/GenAILLM.class.ts
+++ b/packages/app/src/builder-ui/components/GenAILLM.class.ts
@@ -946,11 +946,11 @@ export class GenAILLM extends Component {
},
locationTitle: {
type: 'div',
- html: `<h3 class="font-bold text-md __fields_group_title">User Location</h3>`,
+ html: `<h3 class="font-bold text-md m-0 __fields_group_title">User Location</h3>
+ <p class="text-sm text-gray-500">To refine search results based on geography, you can specify an approximate user location using country, city, region, and/or timezone.</p>`,
value: '',
attributes: openAIAttributes,
class: 'mb-0 hidden',
- help: 'To refine search results based on geography, you can specify an approximate user location using country, city, region, and/or timezone.',
section: 'Advanced',
fieldsGroup: 'Location',
},
@@ -977,12 +977,12 @@ export class GenAILLM extends Component {
datalistId: 'country-datalist',
attributes: {
...openAIAttributes,
- placeholder: 'Type country name or code (e.g., United States or US)',
+ placeholder: 'US',
'data-template-vars': '{"enabled": true, "singleOnly": true}',
'data-template-excluded-vars': 'Attachment',
},
class: 'hidden',
- help: "Country: type the full country name or two-letter ISO code, like 'United States' or 'US'. Select from the dropdown to confirm.",
+ help: `Two-letter <a href="https://en.wikipedia.org/wiki/ISO_3166-1" target="_blank" rel="noopener noreferrer" class="text-underline">ISO country code</a>, like US. <br/>Type to search.`,
section: 'Advanced',
fieldsGroup: 'Location',
},
@@ -1009,12 +1009,12 @@ export class GenAILLM extends Component {
datalistId: 'timezone-datalist',
attributes: {
...openAIAttributes,
- placeholder: 'Type to search timezones (e.g., America/Chicago)',
+ placeholder: 'America/Chicago.',
'data-template-vars': '{"enabled": true, "singleOnly": true}',
'data-template-excluded-vars': 'Attachment',
},
class: 'hidden',
- help: 'Timezone: an IANA timezone like America/Chicago. Type to search.',
+ help: `An <a href="https://timeapi.io/documentation/iana-timezones" target="_blank" rel="noopener noreferrer" class="text-underline">IANA timezone</a> like America/Chicago. <br/>Type to search.`,
section: 'Advanced',
fieldsGroup: 'Location',
},
@@ -1171,12 +1171,12 @@ export class GenAILLM extends Component {
datalistId: 'country-datalist',
attributes: {
...xAIAttributes,
- placeholder: 'Type country name or code (e.g., United States or US)',
+ placeholder: 'US',
'data-template-vars': '{"enabled": true, "singleOnly": true}',
'data-template-excluded-vars': 'Attachment',
},
class: 'hidden',
- help: 'Country: type the full country name or two-letter ISO code to limit search results. Select from the dropdown to confirm.',
+ help: `Two-letter <a href="https://en.wikipedia.org/wiki/ISO_3166-1" target="_blank" rel="noopener noreferrer" class="text-underline">ISO country code</a>, like US. <br/>Type to search.`,
section: 'Advanced',
fieldsGroup: 'Data Sources',
},
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 2a357929..22de924b 100644
--- a/packages/app/src/builder-ui/ui/form/fields/index.ts
+++ b/packages/app/src/builder-ui/ui/form/fields/index.ts
@@ -1395,7 +1395,9 @@ export function createInfoButton(
// Sanitize the HTML content to prevent XSS attacks
// DOMPurify's default configuration already allows all safe HTML tags
// and blocks dangerous elements like <script>, event handlers, etc.
- const sanitizedText = DOMPurify.sanitize(text);
+ const sanitizedText = DOMPurify.sanitize(text, {
+ ADD_ATTR: ['target'], // We need to allow target attribute for external links
+ });
// Render the Tooltip component wrapped in TooltipProvider
const root = createRoot(tooltipContainer);