Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

refactor(ui): align Infotip hints and enforce content styling contracts (#42682)

yyhbefb18a86f45
diff --git a/lint.config.ts b/lint.config.ts
index fa176439c73..0976f698f44 100644
--- a/lint.config.ts
+++ b/lint.config.ts
@@ -7,11 +7,11 @@ const rootDir = import.meta.dirname
const difyUiPackageJson = path.resolve(rootDir, 'packages/dify-ui/package.json')
const enableTailwindCanonicalClasses = process.env.TAILWIND_CANONICAL_CLASSES === 'true'
-export const tooltipContentRules = {
+export const hintContentRules = {
'shadcn/no-restyle': [
'error',
{
- componentImports: ['^@langgenius/dify-ui/tooltip$'],
+ componentImports: ['^@langgenius/dify-ui/(tooltip|infotip)$'],
allow: ['*'],
contracts: [
{
@@ -22,6 +22,12 @@ export const tooltipContentRules = {
message:
'"{{className}}" is outside the TooltipContent styling contract. Use the default surface, spacing, and typography from packages/dify-ui/src/tooltip/index.tsx; callers may compose a label/shortcut row or constrain width.',
},
+ {
+ pattern: '^InfotipContent$',
+ allow: ['w-*', 'max-w-*', 'whitespace-pre-wrap'],
+ message:
+ '"{{className}}" is outside the InfotipContent styling contract. Use the default hint surface, spacing, typography, and wrapping from packages/dify-ui/src/infotip/index.tsx; callers may constrain width or preserve content line breaks.',
+ },
],
},
],
@@ -832,7 +838,7 @@ export const lintConfig = {
},
{
files: ['web/**/*.{jsx,tsx}'],
- rules: tooltipContentRules,
+ rules: hintContentRules,
},
{
files: ['web/**/*.stories.{js,cjs,mjs,jsx,ts,tsx}', 'web/**/*.story.{js,cjs,mjs,jsx,ts,tsx}'],
diff --git a/packages/dify-ui/src/infotip/index.stories.tsx b/packages/dify-ui/src/infotip/index.stories.tsx
index 21512303eb7..da7311fc2e5 100644
--- a/packages/dify-ui/src/infotip/index.stories.tsx
+++ b/packages/dify-ui/src/infotip/index.stories.tsx
@@ -103,3 +103,16 @@ export const Controlled: Story = {
await waitFor(() => expect(body.queryByRole('dialog')).not.toBeInTheDocument())
},
}
+
+export const LongText: Story = {
+ render: () => (
+ <Infotip>
+ <InfotipTrigger aria-label="Indexing error" iconVariant="warning" />
+ <InfotipContent aria-label="Indexing error" className="w-60 whitespace-pre-wrap">
+ {
+ 'Unable to index the document.\nSource: https://example.com/documents/0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz'
+ }
+ </InfotipContent>
+ </Infotip>
+ ),
+}
diff --git a/packages/dify-ui/src/infotip/index.tsx b/packages/dify-ui/src/infotip/index.tsx
index cfe90ede469..5222104ad94 100644
--- a/packages/dify-ui/src/infotip/index.tsx
+++ b/packages/dify-ui/src/infotip/index.tsx
@@ -6,7 +6,7 @@ import { Popover as BasePopover } from '@base-ui/react/popover'
import { cn } from '../cn'
import { iconButtonVariants } from '../icon-button'
import { resolveClassName } from '../internals/resolve-class-name'
-import { floatingPopupAnimationClassName } from '../overlay-shared'
+import { hintPopupClassName } from '../overlay-shared'
import { parsePlacement } from '../placement'
const iconClassNames = {
@@ -95,12 +95,7 @@ function InfotipContent({
<BasePopover.Popup
{...props}
className={(state) =>
- cn(
- 'outline-hidden focus:outline-hidden focus-visible:outline-hidden',
- floatingPopupAnimationClassName,
- 'max-w-75 rounded-lg border-[0.5px] border-components-panel-border bg-components-tooltip-bg px-3 py-2 system-xs-regular text-text-secondary shadow-[0px_12px_16px_-4px_var(--color-shadow-shadow-5),0px_4px_6px_-2px_var(--color-shadow-shadow-1)] backdrop-blur-[5px]',
- resolveClassName(className, state),
- )
+ cn(hintPopupClassName, 'outline-hidden', resolveClassName(className, state))
}
/>
</BasePopover.Positioner>
diff --git a/packages/dify-ui/src/overlay-shared.ts b/packages/dify-ui/src/overlay-shared.ts
index acad5112345..c87e20ff678 100644
--- a/packages/dify-ui/src/overlay-shared.ts
+++ b/packages/dify-ui/src/overlay-shared.ts
@@ -15,6 +15,8 @@ export const menuPopupSurfaceClassName =
export const menuPopupClassName = `${menuPopupBaseClassName} ${menuPopupSurfaceClassName}`
export const floatingPopupAnimationClassName =
'origin-(--transform-origin) transition-[transform,scale,opacity] data-ending-style:scale-95 data-starting-style:scale-95 data-ending-style:opacity-0 data-starting-style:opacity-0 data-instant:transition-none motion-reduce:transition-none'
+export const hintPopupClassName =
+ 'max-w-75 rounded-lg border-[0.5px] border-components-panel-border bg-components-tooltip-bg p-1.5 text-start system-xs-medium wrap-break-word text-text-secondary shadow-[0px_12px_16px_-4px_var(--color-shadow-shadow-5),0px_4px_6px_-2px_var(--color-shadow-shadow-1)] backdrop-blur-[5px] origin-(--transform-origin) transition-opacity data-ending-style:opacity-0 data-instant:transition-none data-starting-style:opacity-0 motion-reduce:transition-none'
export const modalBackdropClassName =
'absolute inset-0 z-50 bg-background-overlay transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 motion-reduce:transition-none'
export const modalPopupAnimationClassName =
diff --git a/packages/dify-ui/src/tooltip/index.tsx b/packages/dify-ui/src/tooltip/index.tsx
index fa3ec08e867..711818d1578 100644
--- a/packages/dify-ui/src/tooltip/index.tsx
+++ b/packages/dify-ui/src/tooltip/index.tsx
@@ -5,6 +5,7 @@ import type { Placement } from '../placement'
import { Tooltip as BaseTooltip } from '@base-ui/react/tooltip'
import { cn } from '../cn'
import { resolveClassName } from '../internals/resolve-class-name'
+import { hintPopupClassName } from '../overlay-shared'
import { parsePlacement } from '../placement'
/**
@@ -60,13 +61,7 @@ function TooltipContent({
className="z-50 outline-hidden"
>
<BaseTooltip.Popup
- className={(state) =>
- cn(
- 'max-w-75 overflow-clip rounded-lg border-[0.5px] border-components-panel-border bg-components-tooltip-bg p-1.5 text-start system-xs-medium wrap-break-word text-text-secondary shadow-[0px_12px_16px_-4px_var(--color-shadow-shadow-5),0px_4px_6px_-2px_var(--color-shadow-shadow-1)] backdrop-blur-[5px]',
- 'origin-(--transform-origin) transition-opacity data-ending-style:opacity-0 data-instant:transition-none data-starting-style:opacity-0 motion-reduce:transition-none',
- resolveClassName(className, state),
- )
- }
+ className={(state) => cn(hintPopupClassName, resolveClassName(className, state))}
{...props}
>
{children}
diff --git a/web/app/components/app/configuration/config-prompt/advanced-prompt-input.tsx b/web/app/components/app/configuration/config-prompt/advanced-prompt-input.tsx
index b730c897ca8..efaeeb08409 100644
--- a/web/app/components/app/configuration/config-prompt/advanced-prompt-input.tsx
+++ b/web/app/components/app/configuration/config-prompt/advanced-prompt-input.tsx
@@ -196,7 +196,7 @@ const AdvancedPromptInput: FC<Props> = ({
/>
<InfotipContent
aria-label={t(($) => $.promptTip, { ns: 'appDebug' })}
- className="w-[180px]"
+ className="w-45"
>
{t(($) => $.promptTip, { ns: 'appDebug' })}
</InfotipContent>
diff --git a/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx b/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx
index d2329f1e29c..a058493c3a5 100644
--- a/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx
+++ b/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx
@@ -213,7 +213,7 @@ const Prompt: FC<ISimplePromptInput> = ({
/>
<InfotipContent
aria-label={t(($) => $.promptTip, { ns: 'appDebug' })}
- className="w-[180px]"
+ className="w-45"
>
{t(($) => $.promptTip, { ns: 'appDebug' })}
</InfotipContent>
diff --git a/web/app/components/app/configuration/config-var/index.tsx b/web/app/components/app/configuration/config-var/index.tsx
index 56fbf5e4c02..85bef7ede12 100644
--- a/web/app/components/app/configuration/config-var/index.tsx
+++ b/web/app/components/app/configuration/config-var/index.tsx
@@ -319,7 +319,7 @@ const ConfigVar: FC<IConfigVarProps> = ({ promptVariables, readonly, onPromptVar
<InfotipTrigger aria-label={t(($) => $.variableTip, { ns: 'appDebug' })} />
<InfotipContent
aria-label={t(($) => $.variableTip, { ns: 'appDebug' })}
- className="w-[180px]"
+ className="w-45"
>
{t(($) => $.variableTip, { ns: 'appDebug' })}
</InfotipContent>
diff --git a/web/app/components/app/configuration/config-vision/index.tsx b/web/app/components/app/configuration/config-vision/index.tsx
index ce199d3ecac..06462db608a 100644
--- a/web/app/components/app/configuration/config-vision/index.tsx
+++ b/web/app/components/app/configuration/config-vision/index.tsx
@@ -79,7 +79,7 @@ const ConfigVision: FC = () => {
<InfotipTrigger aria-label={t(($) => $['vision.description'], { ns: 'appDebug' })} />
<InfotipContent
aria-label={t(($) => $['vision.description'], { ns: 'appDebug' })}
- className="w-[180px]"
+ className="w-45"
>
{t(($) => $['vision.description'], { ns: 'appDebug' })}
</InfotipContent>
@@ -102,13 +102,9 @@ const ConfigVision: FC = () => {
aria-label={t(($) => $['vision.visionSettings.resolutionTooltip'], {
ns: 'appDebug',
})}
- className="w-[180px]"
+ className="w-45 whitespace-pre-wrap"
>
- {t(($) => $['vision.visionSettings.resolutionTooltip'], { ns: 'appDebug' })
- .split('\n')
- .map((item) => (
- <div key={item}>{item}</div>
- ))}
+ {t(($) => $['vision.visionSettings.resolutionTooltip'], { ns: 'appDebug' })}
</InfotipContent>
</Infotip>
</div>
diff --git a/web/app/components/app/configuration/config-vision/param-config-content.tsx b/web/app/components/app/configuration/config-vision/param-config-content.tsx
index 894803e5dee..cdf30e81056 100644
--- a/web/app/components/app/configuration/config-vision/param-config-content.tsx
+++ b/web/app/components/app/configuration/config-vision/param-config-content.tsx
@@ -80,13 +80,9 @@ const ParamConfigContent: FC = () => {
aria-label={t(($) => $['vision.visionSettings.resolutionTooltip'], {
ns: 'appDebug',
})}
- className="w-[180px]"
+ className="w-45 whitespace-pre-wrap"
>
- {t(($) => $['vision.visionSettings.resolutionTooltip'], { ns: 'appDebug' })
- .split('\n')
- .map((item) => (
- <div key={item}>{item}</div>
- ))}
+ {t(($) => $['vision.visionSettings.resolutionTooltip'], { ns: 'appDebug' })}
</InfotipContent>
</Infotip>
</div>
diff --git a/web/app/components/app/configuration/config/agent/agent-setting/item-panel.tsx b/web/app/components/app/configuration/config/agent/agent-setting/item-panel.tsx
index f898ccb870a..b770335789f 100644
--- a/web/app/components/app/configuration/config/agent/agent-setting/item-panel.tsx
+++ b/web/app/components/app/configuration/config/agent/agent-setting/item-panel.tsx
@@ -25,7 +25,7 @@ const ItemPanel: FC<Props> = ({ className, icon, name, description, children })
<div className="mr-1 ml-3 text-sm/6 font-semibold text-text-secondary">{name}</div>
<Infotip>
<InfotipTrigger aria-label={description} />
- <InfotipContent aria-label={description} className="w-[180px]">
+ <InfotipContent aria-label={description} className="w-45">
{description}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/app/configuration/config/agent/agent-tools/index.tsx b/web/app/components/app/configuration/config/agent/agent-tools/index.tsx
index 7f0e4cd2ef6..ee657ca2a73 100644
--- a/web/app/components/app/configuration/config/agent/agent-tools/index.tsx
+++ b/web/app/components/app/configuration/config/agent/agent-tools/index.tsx
@@ -251,20 +251,18 @@ const AgentTools: FC = () => {
aria-label={item.tool_name}
className="ml-0.5 opacity-0 group-hover:opacity-100 focus-visible:opacity-100"
/>
- <InfotipContent aria-label={item.tool_name} className="w-[220px]">
- <div>
- <div className="mb-1.5 text-text-secondary">{item.tool_name}</div>
- <div className="mb-1.5 text-text-tertiary">
- {t(($) => $.toolNameUsageTip, { ns: 'tools' })}
- </div>
- <button
- type="button"
- className="cursor-pointer rounded-sm border-none bg-transparent p-0 text-left text-text-accent outline-hidden hover:underline focus-visible:ring-1 focus-visible:ring-components-input-border-hover"
- onClick={() => void writeTextToClipboard(item.tool_name)}
- >
- {t(($) => $.copyToolName, { ns: 'tools' })}
- </button>
+ <InfotipContent aria-label={item.tool_name} className="w-55">
+ <div className="mb-1.5">{item.tool_name}</div>
+ <div className="mb-1.5 text-text-tertiary">
+ {t(($) => $.toolNameUsageTip, { ns: 'tools' })}
</div>
+ <button
+ type="button"
+ className="cursor-pointer rounded-sm border-none bg-transparent p-0 text-left text-text-accent outline-hidden hover:underline focus-visible:ring-1 focus-visible:ring-components-input-border-hover"
+ onClick={() => void writeTextToClipboard(item.tool_name)}
+ >
+ {t(($) => $.copyToolName, { ns: 'tools' })}
+ </button>
</InfotipContent>
</Infotip>
)}
diff --git a/web/app/components/app/configuration/config/config-audio.tsx b/web/app/components/app/configuration/config/config-audio.tsx
index ca671abc21b..3e0ee2fdb55 100644
--- a/web/app/components/app/configuration/config/config-audio.tsx
+++ b/web/app/components/app/configuration/config/config-audio.tsx
@@ -60,7 +60,7 @@ const ConfigAudio: FC = () => {
/>
<InfotipContent
aria-label={t(($) => $['feature.audioUpload.description'], { ns: 'appDebug' })}
- className="w-[180px]"
+ className="w-45"
>
{t(($) => $['feature.audioUpload.description'], { ns: 'appDebug' })}
</InfotipContent>
diff --git a/web/app/components/app/configuration/config/config-document.tsx b/web/app/components/app/configuration/config/config-document.tsx
index 381e7081c63..5e1f72436a1 100644
--- a/web/app/components/app/configuration/config/config-document.tsx
+++ b/web/app/components/app/configuration/config/config-document.tsx
@@ -61,7 +61,7 @@ const ConfigDocument: FC = () => {
/>
<InfotipContent
aria-label={t(($) => $['feature.documentUpload.description'], { ns: 'appDebug' })}
- className="w-[180px]"
+ className="w-45"
>
{t(($) => $['feature.documentUpload.description'], { ns: 'appDebug' })}
</InfotipContent>
diff --git a/web/app/components/app/configuration/dataset-config/context-var/index.tsx b/web/app/components/app/configuration/dataset-config/context-var/index.tsx
index 8bb5926953c..cf9d6f4bbda 100644
--- a/web/app/components/app/configuration/dataset-config/context-var/index.tsx
+++ b/web/app/components/app/configuration/dataset-config/context-var/index.tsx
@@ -35,7 +35,7 @@ const ContextVar: FC<Props> = (props) => {
/>
<InfotipContent
aria-label={t(($) => $['feature.dataSet.queryVariable.tip'], { ns: 'appDebug' })}
- className="w-[180px]"
+ className="w-45"
>
{t(($) => $['feature.dataSet.queryVariable.tip'], { ns: 'appDebug' })}
</InfotipContent>
diff --git a/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx b/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx
index beae8668451..da7b45590dc 100644
--- a/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx
+++ b/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx
@@ -246,7 +246,7 @@ const ConfigContent: FC<Props> = ({
<div className="truncate">{option.label}</div>
<Infotip>
<InfotipTrigger aria-label={option.tips} className="ml-0.5 size-3.5" />
- <InfotipContent aria-label={option.tips} className="w-[200px]">
+ <InfotipContent aria-label={option.tips} className="w-50">
{option.tips}
</InfotipContent>
</Infotip>
@@ -274,7 +274,7 @@ const ConfigContent: FC<Props> = ({
/>
<InfotipContent
aria-label={t(($) => $['modelProvider.rerankModel.tip'], { ns: 'common' })}
- className="w-[200px]"
+ className="w-50"
>
{t(($) => $['modelProvider.rerankModel.tip'], { ns: 'common' })}
</InfotipContent>
diff --git a/web/app/components/app/overview/app-chart.tsx b/web/app/components/app/overview/app-chart.tsx
index 66b05d72e45..eb5af4659ea 100644
--- a/web/app/components/app/overview/app-chart.tsx
+++ b/web/app/components/app/overview/app-chart.tsx
@@ -104,7 +104,7 @@ const Chart: React.FC<IChartProps> = ({
{explanation && (
<Infotip>
<InfotipTrigger aria-label={explanation} className="ml-1" />
- <InfotipContent aria-label={explanation} className="w-[240px]">
+ <InfotipContent aria-label={explanation} className="w-60">
{explanation}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/base/chat/chat/chat-input-area/index.tsx b/web/app/components/base/chat/chat/chat-input-area/index.tsx
index f0758ea7817..62314df5db5 100644
--- a/web/app/components/base/chat/chat/chat-input-area/index.tsx
+++ b/web/app/components/base/chat/chat/chat-input-area/index.tsx
@@ -385,10 +385,7 @@ const ChatInputArea = ({
className="ml-auto size-5 rounded-md text-text-accent hover:bg-state-base-hover hover:text-text-accent"
iconVariant="information"
/>
- <InfotipContent
- aria-label={footerNoticeAriaLabel}
- className="max-w-80 text-start wrap-break-word"
- >
+ <InfotipContent aria-label={footerNoticeAriaLabel} className="max-w-80">
{footerNoticeTooltip}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/base/features/new-feature-panel/annotation-reply/config-param.tsx b/web/app/components/base/features/new-feature-panel/annotation-reply/config-param.tsx
index e55173791f1..06dfaea9dad 100644
--- a/web/app/components/base/features/new-feature-panel/annotation-reply/config-param.tsx
+++ b/web/app/components/base/features/new-feature-panel/annotation-reply/config-param.tsx
@@ -14,7 +14,7 @@ export const Item: FC<{ title: string; tooltip: string; children: React.JSX.Elem
<div className="py-1 system-sm-semibold text-text-secondary">{title}</div>
<Infotip>
<InfotipTrigger aria-label={tooltip} />
- <InfotipContent aria-label={tooltip} className="max-w-[200px] system-sm-regular">
+ <InfotipContent aria-label={tooltip} className="max-w-50">
{tooltip}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/base/features/new-feature-panel/conversation-opener/modal.tsx b/web/app/components/base/features/new-feature-panel/conversation-opener/modal.tsx
index 2860dcc139f..c2b0beccff6 100644
--- a/web/app/components/base/features/new-feature-panel/conversation-opener/modal.tsx
+++ b/web/app/components/base/features/new-feature-panel/conversation-opener/modal.tsx
@@ -158,7 +158,7 @@ const OpeningSettingModal = ({
aria-label={t(($) => $['openingStatement.openingQuestionDescription'], {
ns: 'appDebug',
})}
- className="max-w-[220px] system-sm-regular"
+ className="max-w-55"
>
{t(($) => $['openingStatement.openingQuestionDescription'], { ns: 'appDebug' })}
</InfotipContent>
diff --git a/web/app/components/base/features/new-feature-panel/text-to-speech/param-config-content.tsx b/web/app/components/base/features/new-feature-panel/text-to-speech/param-config-content.tsx
index d74fc5e4d8a..2284ccf7e71 100644
--- a/web/app/components/base/features/new-feature-panel/text-to-speech/param-config-content.tsx
+++ b/web/app/components/base/features/new-feature-panel/text-to-speech/param-config-content.tsx
@@ -113,13 +113,9 @@ const VoiceParamConfig = ({ onClose, onChange }: VoiceParamConfigProps) => {
/>
<InfotipContent
aria-label={t(($) => $['voice.voiceSettings.resolutionTooltip'], { ns: 'appDebug' })}
- className="w-[180px]"
+ className="w-45 whitespace-pre-wrap"
>
- {t(($) => $['voice.voiceSettings.resolutionTooltip'], { ns: 'appDebug' })
- .split('\n')
- .map((item) => (
- <div key={item}>{item}</div>
- ))}
+ {t(($) => $['voice.voiceSettings.resolutionTooltip'], { ns: 'appDebug' })}
</InfotipContent>
</Infotip>
</div>
diff --git a/web/app/components/base/form/components/base/base-field.tsx b/web/app/components/base/form/components/base/base-field.tsx
index b1abf1f2595..fe0496d0375 100644
--- a/web/app/components/base/form/components/base/base-field.tsx
+++ b/web/app/components/base/form/components/base/base-field.tsx
@@ -313,7 +313,7 @@ const BaseField = ({
{translatedTooltip && (
<Infotip>
<InfotipTrigger aria-label={translatedTooltip} className="ml-0.5" />
- <InfotipContent aria-label={translatedTooltip} className="w-[200px]">
+ <InfotipContent aria-label={translatedTooltip} className="w-50">
{translatedTooltip}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/base/form/components/field/upload-method.tsx b/web/app/components/base/form/components/field/upload-method.tsx
index 86c9303f190..6556c4ed99c 100644
--- a/web/app/components/base/form/components/field/upload-method.tsx
+++ b/web/app/components/base/form/components/field/upload-method.tsx
@@ -73,8 +73,8 @@ const UploadMethodField = ({ label, labelOptions, className }: UploadMethodField
)}
{labelOptions?.tooltip && (
<Infotip>
- <InfotipTrigger aria-label={labelOptions.tooltip} className="ml-0.5 size-4" />
- <InfotipContent aria-label={labelOptions.tooltip} className="w-[200px]">
+ <InfotipTrigger aria-label={labelOptions.tooltip} className="ml-0.5" />
+ <InfotipContent aria-label={labelOptions.tooltip} className="w-50">
{labelOptions.tooltip}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/base/form/components/label.tsx b/web/app/components/base/form/components/label.tsx
index 1b9dc4863c7..8ddbe0d5248 100644
--- a/web/app/components/base/form/components/label.tsx
+++ b/web/app/components/base/form/components/label.tsx
@@ -29,8 +29,8 @@ const Label = ({ htmlFor, label, isRequired, showOptional, tooltip, className }:
)}
{tooltip && (
<Infotip>
- <InfotipTrigger aria-label={tooltip} className="ml-0.5 size-4" />
- <InfotipContent aria-label={tooltip} className="w-[200px]">
+ <InfotipTrigger aria-label={tooltip} className="ml-0.5" />
+ <InfotipContent aria-label={tooltip} className="w-50">
{tooltip}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/base/param-item/index.tsx b/web/app/components/base/param-item/index.tsx
index 2d4bb0ba583..d0e31830ba8 100644
--- a/web/app/components/base/param-item/index.tsx
+++ b/web/app/components/base/param-item/index.tsx
@@ -73,7 +73,7 @@ const ParamItem: FC<Props> = ({
{!noTooltip && tip && (
<Infotip>
<InfotipTrigger aria-label={tip} />
- <InfotipContent aria-label={tip} className="w-[200px]">
+ <InfotipContent aria-label={tip} className="w-50">
{tip}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/billing/usage-info/index.tsx b/web/app/components/billing/usage-info/index.tsx
index b218c759f34..2d8b987d626 100644
--- a/web/app/components/billing/usage-info/index.tsx
+++ b/web/app/components/billing/usage-info/index.tsx
@@ -169,7 +169,7 @@ const UsageInfo: FC<Props> = ({
{tooltip && (
<Infotip>
<InfotipTrigger aria-label={tooltip} />
- <InfotipContent aria-label={tooltip} className="w-[180px] max-w-[180px]">
+ <InfotipContent aria-label={tooltip} className="w-45">
{tooltip}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/datasets/common/retrieval-param-config/index.tsx b/web/app/components/datasets/common/retrieval-param-config/index.tsx
index bfb79e78d97..bc6ee39d87d 100644
--- a/web/app/components/datasets/common/retrieval-param-config/index.tsx
+++ b/web/app/components/datasets/common/retrieval-param-config/index.tsx
@@ -134,7 +134,7 @@ const RetrievalParamConfig: FC<Props> = ({
/>
<InfotipContent
aria-label={t(($) => $['modelProvider.rerankModel.tip'], { ns: 'common' })}
- className="w-[200px]"
+ className="w-50"
>
{t(($) => $['modelProvider.rerankModel.tip'], { ns: 'common' })}
</InfotipContent>
diff --git a/web/app/components/datasets/create-from-pipeline/list/template-card/details/index.tsx b/web/app/components/datasets/create-from-pipeline/list/template-card/details/index.tsx
index 86c8348e0e8..029a0a6a38b 100644
--- a/web/app/components/datasets/create-from-pipeline/list/template-card/details/index.tsx
+++ b/web/app/components/datasets/create-from-pipeline/list/template-card/details/index.tsx
@@ -105,7 +105,7 @@ const Details = ({ id, type, onApplyTemplate, onClose }: DetailsProps) => {
/>
<InfotipContent
aria-label={t(($) => $['details.structureTooltip'], { ns: 'datasetPipeline' })}
- className="max-w-[240px]"
+ className="max-w-60"
>
{t(($) => $['details.structureTooltip'], { ns: 'datasetPipeline' })}
</InfotipContent>
diff --git a/web/app/components/datasets/create/embedding-process/indexing-progress-item.tsx b/web/app/components/datasets/create/embedding-process/indexing-progress-item.tsx
index a44c49f49df..1fa2fda4923 100644
--- a/web/app/components/datasets/create/embedding-process/indexing-progress-item.tsx
+++ b/web/app/components/datasets/create/embedding-process/indexing-progress-item.tsx
@@ -37,7 +37,7 @@ const StatusIcon: FC<{ status: string; error?: string }> = ({ status, error }) =
/>
<InfotipContent
aria-label={t(($) => $.error, { ns: 'common' })}
- className="wrap-anywhere whitespace-pre-wrap"
+ className="whitespace-pre-wrap"
sideOffset={4}
>
{errorLabel}
diff --git a/web/app/components/datasets/create/step-two/components/inputs.tsx b/web/app/components/datasets/create/step-two/components/inputs.tsx
index 6e540da8a7c..5111b7b2872 100644
--- a/web/app/components/datasets/create/step-two/components/inputs.tsx
+++ b/web/app/components/datasets/create/step-two/components/inputs.tsx
@@ -60,7 +60,7 @@ export const DelimiterInput: FC<
/>
<InfotipContent
aria-label={tooltip || t(($) => $['stepTwo.separatorTip'], { ns: 'datasetCreation' })}
- className="max-w-[200px]"
+ className="max-w-50"
>
{tooltip || t(($) => $['stepTwo.separatorTip'], { ns: 'datasetCreation' })}
</InfotipContent>
@@ -196,7 +196,7 @@ export const OverlapInput: FC<LabeledCompoundNumberInputProps> = (props) => {
/>
<InfotipContent
aria-label={t(($) => $['stepTwo.overlapTip'], { ns: 'datasetCreation' })}
- className="max-w-[200px]"
+ className="max-w-50"
>
{t(($) => $['stepTwo.overlapTip'], { ns: 'datasetCreation' })}
</InfotipContent>
diff --git a/web/app/components/datasets/create/website/base/checkbox-with-label.tsx b/web/app/components/datasets/create/website/base/checkbox-with-label.tsx
index d657c1dc4f4..84ec84beecf 100644
--- a/web/app/components/datasets/create/website/base/checkbox-with-label.tsx
+++ b/web/app/components/datasets/create/website/base/checkbox-with-label.tsx
@@ -37,7 +37,7 @@ export default function CheckboxWithLabel({
{tooltip && (
<Infotip>
<InfotipTrigger aria-label={tooltip} />
- <InfotipContent aria-label={tooltip} className="w-[200px]">
+ <InfotipContent aria-label={tooltip} className="w-50">
{tooltip}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/datasets/create/website/base/field.tsx b/web/app/components/datasets/create/website/base/field.tsx
index 817ec0e00a3..e7af17eaedc 100644
--- a/web/app/components/datasets/create/website/base/field.tsx
+++ b/web/app/components/datasets/create/website/base/field.tsx
@@ -45,7 +45,7 @@ const Field: FC<Props> = ({
{tooltip && (
<Infotip>
<InfotipTrigger aria-label={tooltip} className="ml-0.5" />
- <InfotipContent aria-label={tooltip} className="w-[200px]">
+ <InfotipContent aria-label={tooltip} className="w-50">
{tooltip}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/base/checkbox-with-label.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/base/checkbox-with-label.tsx
index c92ad55a703..bca2ac268d6 100644
--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/base/checkbox-with-label.tsx
+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/base/checkbox-with-label.tsx
@@ -37,7 +37,7 @@ export default function CheckboxWithLabel({
{tooltip && (
<Infotip>
<InfotipTrigger aria-label={tooltip} />
- <InfotipContent aria-label={tooltip} className="w-[200px]">
+ <InfotipContent aria-label={tooltip} className="w-50">
{tooltip}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/datasets/documents/status-item/index.tsx b/web/app/components/datasets/documents/status-item/index.tsx
index ef304ba00aa..555bbc90285 100644
--- a/web/app/components/datasets/documents/status-item/index.tsx
+++ b/web/app/components/datasets/documents/status-item/index.tsx
@@ -111,7 +111,7 @@ const StatusItem = ({
{errorMessage && (
<Infotip>
<InfotipTrigger aria-label={errorMessage} className="ml-1" />
- <InfotipContent aria-label={errorMessage} className="max-w-[260px] break-all">
+ <InfotipContent aria-label={errorMessage} className="max-w-65">
{errorMessage}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/datasets/metadata/edit-metadata-batch/modal.tsx b/web/app/components/datasets/metadata/edit-metadata-batch/modal.tsx
index 406dbac2ced..fc63eb547a5 100644
--- a/web/app/components/datasets/metadata/edit-metadata-batch/modal.tsx
+++ b/web/app/components/datasets/metadata/edit-metadata-batch/modal.tsx
@@ -215,7 +215,7 @@ const EditMetadataBatchModal: FC<Props> = ({
aria-label={t(($) => $[`${i18nPrefix}.applyToAllSelectDocumentTip`], {
ns: 'dataset',
})}
- className="max-w-[240px]"
+ className="max-w-60"
>
{t(($) => $[`${i18nPrefix}.applyToAllSelectDocumentTip`], { ns: 'dataset' })}
</InfotipContent>
diff --git a/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-drawer.tsx b/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-drawer.tsx
index 71892727050..72e5d366d42 100644
--- a/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-drawer.tsx
+++ b/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-drawer.tsx
@@ -275,7 +275,7 @@ const DatasetMetadataDrawer: FC<Props> = ({
aria-label={t(($) => $[`${i18nPrefix}.builtInDescription`], {
ns: 'dataset',
})}
- className="max-w-[100px]"
+ className="max-w-25"
>
{t(($) => $[`${i18nPrefix}.builtInDescription`], { ns: 'dataset' })}
</InfotipContent>
diff --git a/web/app/components/datasets/metadata/metadata-document/info-group.tsx b/web/app/components/datasets/metadata/metadata-document/info-group.tsx
index 971acc619c5..a252226b322 100644
--- a/web/app/components/datasets/metadata/metadata-document/info-group.tsx
+++ b/web/app/components/datasets/metadata/metadata-document/info-group.tsx
@@ -72,7 +72,7 @@ const InfoGroup: FC<Props> = ({
{titleTooltip && (
<Infotip>
<InfotipTrigger aria-label={titleTooltip} />
- <InfotipContent aria-label={titleTooltip} className="max-w-[240px]">
+ <InfotipContent aria-label={titleTooltip} className="max-w-60">
{titleTooltip}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx b/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx
index cc60c3af34c..6296f037832 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx
@@ -160,7 +160,7 @@ function Form<
const infotipContent = infotipText && (
<Infotip>
<InfotipTrigger aria-label={infotipText} className="ml-1" />
- <InfotipContent aria-label={infotipText} className="w-[200px] max-w-[200px]">
+ <InfotipContent aria-label={infotipText} className="w-50">
{infotipText}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/parameter-item.tsx b/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/parameter-item.tsx
index 09fd7eb2695..fc81edb8299 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/parameter-item.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/parameter-item.tsx
@@ -454,7 +454,7 @@ function ParameterItem({
/>
<InfotipContent
aria-label={parameterRule.help[language] || parameterRule.help.en_US}
- className="w-[150px] whitespace-pre-wrap"
+ className="w-37.5 whitespace-pre-wrap"
>
{parameterRule.help[language] || parameterRule.help.en_US}
</InfotipContent>
diff --git a/web/app/components/header/account-setting/model-provider-page/system-model-selector/index.tsx b/web/app/components/header/account-setting/model-provider-page/system-model-selector/index.tsx
index d79abe96bcd..85af148ccaf 100644
--- a/web/app/components/header/account-setting/model-provider-page/system-model-selector/index.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/system-model-selector/index.tsx
@@ -216,7 +216,7 @@ const SystemModel: FC<SystemModelSelectorProps> = ({
{t(($) => $[labelKey], { ns: 'common' })}
<Infotip>
<InfotipTrigger aria-label={tipText} className="ml-0.5 text-text-tertiary" />
- <InfotipContent aria-label={tipText} className="w-[261px]">
+ <InfotipContent aria-label={tipText} className="w-65.25">
{tipText}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/header/account-setting/workflow-log-archives-page/index.tsx b/web/app/components/header/account-setting/workflow-log-archives-page/index.tsx
index c7165289b28..3d90af5d138 100644
--- a/web/app/components/header/account-setting/workflow-log-archives-page/index.tsx
+++ b/web/app/components/header/account-setting/workflow-log-archives-page/index.tsx
@@ -429,7 +429,7 @@ function WorkflowArchiveMonthRow({ archive }: { archive: WorkflowRunArchiveMonth
/>
<InfotipContent
aria-label={`${t(($) => $['operation.learnMore'], { ns: 'common' })}: ${archiveMonth}`}
- className="wrap-anywhere whitespace-pre-wrap"
+ className="whitespace-pre-wrap"
>
{downloadHint}
</InfotipContent>
diff --git a/web/app/components/plugins/plugin-detail-panel/tool-selector/components/reasoning-config-form.tsx b/web/app/components/plugins/plugin-detail-panel/tool-selector/components/reasoning-config-form.tsx
index 29498b87b83..64baa5b6b5d 100644
--- a/web/app/components/plugins/plugin-detail-panel/tool-selector/components/reasoning-config-form.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/tool-selector/components/reasoning-config-form.tsx
@@ -149,8 +149,8 @@ const ReasoningConfigForm: React.FC<Props> = ({
const tooltipText = tooltip?.[language] || tooltip?.en_US
const tooltipContent = tooltipText && (
<Infotip>
- <InfotipTrigger aria-label={tooltipText} className="ml-0.5 size-4" />
- <InfotipContent aria-label={tooltipText} className="w-[200px]">
+ <InfotipTrigger aria-label={tooltipText} className="ml-0.5" />
+ <InfotipContent aria-label={tooltipText} className="w-50">
{tooltipText}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/rag-pipeline/components/panel/input-field/index.tsx b/web/app/components/rag-pipeline/components/panel/input-field/index.tsx
index 89d4e25c879..22bb4ba54f5 100644
--- a/web/app/components/rag-pipeline/components/panel/input-field/index.tsx
+++ b/web/app/components/rag-pipeline/components/panel/input-field/index.tsx
@@ -143,7 +143,7 @@ const InputFieldPanel = () => {
aria-label={t(($) => $['inputFieldPanel.uniqueInputs.tooltip'], {
ns: 'datasetPipeline',
})}
- className="max-w-[240px]"
+ className="max-w-60"
>
{t(($) => $['inputFieldPanel.uniqueInputs.tooltip'], { ns: 'datasetPipeline' })}
</InfotipContent>
diff --git a/web/app/components/rag-pipeline/components/panel/input-field/label-right-content/global-inputs.tsx b/web/app/components/rag-pipeline/components/panel/input-field/label-right-content/global-inputs.tsx
index a98cf05a60c..448ecda6b82 100644
--- a/web/app/components/rag-pipeline/components/panel/input-field/label-right-content/global-inputs.tsx
+++ b/web/app/components/rag-pipeline/components/panel/input-field/label-right-content/global-inputs.tsx
@@ -20,7 +20,7 @@ const GlobalInputs = () => {
aria-label={t(($) => $['inputFieldPanel.globalInputs.tooltip'], {
ns: 'datasetPipeline',
})}
- className="w-[240px]"
+ className="w-60"
>
{t(($) => $['inputFieldPanel.globalInputs.tooltip'], { ns: 'datasetPipeline' })}
</InfotipContent>
diff --git a/web/app/components/tools/edit-custom-collection-modal/config-credentials.tsx b/web/app/components/tools/edit-custom-collection-modal/config-credentials.tsx
index 30560b84db3..8da1502b952 100644
--- a/web/app/components/tools/edit-custom-collection-modal/config-credentials.tsx
+++ b/web/app/components/tools/edit-custom-collection-modal/config-credentials.tsx
@@ -218,13 +218,13 @@ export default function ConfigCredential({ positionCenter, credential, onChange,
aria-label={t(($) => $['createTool.authMethod.keyTooltip'], {
ns: 'tools',
})}
- className="ml-0.5 size-4"
+ className="ml-0.5"
/>
<InfotipContent
aria-label={t(($) => $['createTool.authMethod.keyTooltip'], {
ns: 'tools',
})}
- className="w-[261px] text-text-tertiary"
+ className="w-65.25"
>
{t(($) => $['createTool.authMethod.keyTooltip'], { ns: 'tools' })}
</InfotipContent>
@@ -285,13 +285,13 @@ export default function ConfigCredential({ positionCenter, credential, onChange,
aria-label={t(($) => $['createTool.authMethod.queryParamTooltip'], {
ns: 'tools',
})}
- className="ml-0.5 size-4"
+ className="ml-0.5"
/>
<InfotipContent
aria-label={t(($) => $['createTool.authMethod.queryParamTooltip'], {
ns: 'tools',
})}
- className="w-[261px] text-text-tertiary"
+ className="w-65.25"
>
{t(($) => $['createTool.authMethod.queryParamTooltip'], {
ns: 'tools',
diff --git a/web/app/components/tools/workflow-tool/index.tsx b/web/app/components/tools/workflow-tool/index.tsx
index 28451887d9b..d3f41684b11 100644
--- a/web/app/components/tools/workflow-tool/index.tsx
+++ b/web/app/components/tools/workflow-tool/index.tsx
@@ -90,7 +90,7 @@ const InfoTooltip = ({ children }: { children: string }) => {
return (
<Infotip>
<InfotipTrigger aria-label={children} className="ml-1 size-3.5" />
- <InfotipContent aria-label={children} className="w-[180px]">
+ <InfotipContent aria-label={children} className="w-45">
{children}
</InfotipContent>
</Infotip>
@@ -206,7 +206,7 @@ const WorkflowToolOutputName = React.memo(
{sources.map((source) => {
const sourceTitle = getSourceNodeDisplayName(source, sources)
return (
- <li key={source.nodeId} className="wrap-break-word">
+ <li key={source.nodeId}>
{sourceNodeLabel}: <span translate="no">{sourceTitle}</span>
</li>
)
diff --git a/web/app/components/workflow/nodes/_base/components/option-card.tsx b/web/app/components/workflow/nodes/_base/components/option-card.tsx
index 9ba9a83a281..160c6ca96d0 100644
--- a/web/app/components/workflow/nodes/_base/components/option-card.tsx
+++ b/web/app/components/workflow/nodes/_base/components/option-card.tsx
@@ -65,7 +65,7 @@ const OptionCard: FC<Props> = ({
{tooltip && (
<Infotip>
<InfotipTrigger aria-label={tooltip} />
- <InfotipContent aria-label={tooltip} className="w-[240px]">
+ <InfotipContent aria-label={tooltip} className="w-60">
{tooltip}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/workflow/nodes/agent-v2/components/agent-task-field.tsx b/web/app/components/workflow/nodes/agent-v2/components/agent-task-field.tsx
index 1da8dd7af19..ee6a8369f37 100644
--- a/web/app/components/workflow/nodes/agent-v2/components/agent-task-field.tsx
+++ b/web/app/components/workflow/nodes/agent-v2/components/agent-task-field.tsx
@@ -104,7 +104,7 @@ export function AgentTaskField({
<InfotipContent
aria-label={t(($) => $[`${i18nPrefix}.task.tooltip`], { ns: 'workflow' })}
>
- <span>{t(($) => $[`${i18nPrefix}.task.tooltip`], { ns: 'workflow' })}</span>{' '}
+ {t(($) => $[`${i18nPrefix}.task.tooltip`], { ns: 'workflow' })}{' '}
<a
href={docLink('/use-dify/nodes/agent#give-it-a-task')}
target="_blank"
diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/index.tsx b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/index.tsx
index 2423c75b025..80cab1fd4ec 100644
--- a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/index.tsx
+++ b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/index.tsx
@@ -64,7 +64,7 @@ const MetadataFilter = ({
/>
<InfotipContent
aria-label={t(($) => $['nodes.knowledgeRetrieval.metadata.tip'], { ns: 'workflow' })}
- className="w-[200px]"
+ className="w-50"
>
{t(($) => $['nodes.knowledgeRetrieval.metadata.tip'], { ns: 'workflow' })}
</InfotipContent>
diff --git a/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsx b/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsx
index 693f2efe885..9820bfac36e 100644
--- a/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsx
+++ b/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsx
@@ -129,7 +129,7 @@ const ConfigPromptItem: FC<Props> = ({
{roleDescription && (
<Infotip>
<InfotipTrigger aria-label={roleDescription} />
- <InfotipContent aria-label={roleDescription} className="w-[180px]">
+ <InfotipContent aria-label={roleDescription} className="w-45">
{roleDescription}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/workflow/nodes/llm/components/panel-memory-section.tsx b/web/app/components/workflow/nodes/llm/components/panel-memory-section.tsx
index ccd1149e402..9706b135664 100644
--- a/web/app/components/workflow/nodes/llm/components/panel-memory-section.tsx
+++ b/web/app/components/workflow/nodes/llm/components/panel-memory-section.tsx
@@ -97,7 +97,7 @@ const PanelMemorySection: FC<Props> = ({
/>
<InfotipContent
aria-label={t(($) => $['nodes.llm.roleDescription.user'], { ns: 'workflow' })}
- className="w-[180px]"
+ className="w-45"
>
{t(($) => $['nodes.llm.roleDescription.user'], { ns: 'workflow' })}
</InfotipContent>
diff --git a/web/app/components/workflow/nodes/llm/components/panel-output-section.tsx b/web/app/components/workflow/nodes/llm/components/panel-output-section.tsx
index dee0d2a75aa..d9716f198e1 100644
--- a/web/app/components/workflow/nodes/llm/components/panel-output-section.tsx
+++ b/web/app/components/workflow/nodes/llm/components/panel-output-section.tsx
@@ -67,7 +67,7 @@ const PanelOutputSection: FC<Props> = ({
/>
<InfotipContent
aria-label={t(($) => $['structOutput.structuredTip'], { ns: 'app' })}
- className="w-[150px]"
+ className="w-37.5"
>
{t(($) => $['structOutput.structuredTip'], { ns: 'app' })}
</InfotipContent>
diff --git a/web/app/components/workflow/nodes/parameter-extractor/panel.tsx b/web/app/components/workflow/nodes/parameter-extractor/panel.tsx
index 43027049a69..d76225dae05 100644
--- a/web/app/components/workflow/nodes/parameter-extractor/panel.tsx
+++ b/web/app/components/workflow/nodes/parameter-extractor/panel.tsx
@@ -127,7 +127,7 @@ const Panel: FC<NodePanelProps<ParameterExtractorNodeType>> = ({ id, data }) =>
/>
<InfotipContent
aria-label={t(($) => $[`${i18nPrefix}.instructionTip`], { ns: 'workflow' })}
- className="w-[120px]"
+ className="w-30"
>
{t(($) => $[`${i18nPrefix}.instructionTip`], { ns: 'workflow' })}
</InfotipContent>
diff --git a/web/app/components/workflow/nodes/question-classifier/components/advanced-setting.tsx b/web/app/components/workflow/nodes/question-classifier/components/advanced-setting.tsx
index c965d39c13c..f815e5f0a1d 100644
--- a/web/app/components/workflow/nodes/question-classifier/components/advanced-setting.tsx
+++ b/web/app/components/workflow/nodes/question-classifier/components/advanced-setting.tsx
@@ -57,7 +57,7 @@ const AdvancedSetting: FC<Props> = ({
/>
<InfotipContent
aria-label={t(($) => $[`${i18nPrefix}.instructionTip`], { ns: 'workflow' })}
- className="w-[120px]"
+ className="w-30"
>
{t(($) => $[`${i18nPrefix}.instructionTip`], { ns: 'workflow' })}
</InfotipContent>
diff --git a/web/app/components/workflow/nodes/tool/components/tool-form/item.tsx b/web/app/components/workflow/nodes/tool/components/tool-form/item.tsx
index 43ec99c773f..2d69c73fa67 100644
--- a/web/app/components/workflow/nodes/tool/components/tool-form/item.tsx
+++ b/web/app/components/workflow/nodes/tool/components/tool-form/item.tsx
@@ -104,7 +104,7 @@ const ToolFormItem: FC<Props> = ({
{!showDescription && tooltip && (
<Infotip>
<InfotipTrigger aria-label={tooltip[language] || tooltip.en_US} className="ml-1" />
- <InfotipContent aria-label={tooltip[language] || tooltip.en_US} className="w-[200px]">
+ <InfotipContent aria-label={tooltip[language] || tooltip.en_US} className="w-50">
{tooltip[language] || tooltip.en_US}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/workflow/nodes/trigger-plugin/components/trigger-form/item.tsx b/web/app/components/workflow/nodes/trigger-plugin/components/trigger-form/item.tsx
index e136cb86fb0..e175e6498da 100644
--- a/web/app/components/workflow/nodes/trigger-plugin/components/trigger-form/item.tsx
+++ b/web/app/components/workflow/nodes/trigger-plugin/components/trigger-form/item.tsx
@@ -60,11 +60,8 @@ const TriggerFormItem: FC<Props> = ({
)}
{!showDescription && tooltip && (
<Infotip>
- <InfotipTrigger
- aria-label={tooltip[language] || tooltip.en_US}
- className="ml-1 size-4"
- />
- <InfotipContent aria-label={tooltip[language] || tooltip.en_US} className="w-[200px]">
+ <InfotipTrigger aria-label={tooltip[language] || tooltip.en_US} className="ml-1" />
+ <InfotipContent aria-label={tooltip[language] || tooltip.en_US} className="w-50">
{tooltip[language] || tooltip.en_US}
</InfotipContent>
</Infotip>
diff --git a/web/app/components/workflow/panel/env-panel/variable-modal.tsx b/web/app/components/workflow/panel/env-panel/variable-modal.tsx
index abbd5d96d1c..fb1a64a298a 100644
--- a/web/app/components/workflow/panel/env-panel/variable-modal.tsx
+++ b/web/app/components/workflow/panel/env-panel/variable-modal.tsx
@@ -206,7 +206,7 @@ const VariableModal = ({ env, onClose, onSave }: ModalPropsType) => {
/>
<InfotipContent
aria-label={t(($) => $['env.modal.secretTip'], { ns: 'workflow' })}
- className="w-[240px]"
+ className="w-60"
>
{t(($) => $['env.modal.secretTip'], { ns: 'workflow' })}
</InfotipContent>
diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/files/index.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/files/index.tsx
index 2a91c90946e..431f24330bc 100644
--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/files/index.tsx
+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/files/index.tsx
@@ -366,24 +366,20 @@ function AgentBuildNoteInfotip() {
<Infotip>
<InfotipTrigger
aria-label={t(($) => $['agentDetail.configure.files.buildNote.tooltip'])}
- className="size-5 text-text-quaternary hover:text-text-quaternary"
+ className="size-5 hover:text-text-quaternary"
iconSize="large"
/>
<InfotipContent
aria-label={t(($) => $['agentDetail.configure.files.buildNote.tooltip'])}
- className="w-[230px] rounded-xl px-4 py-3.5"
+ className="w-57.5"
>
- <p className="body-xs-regular text-text-secondary">
- <Trans
- i18nKey={($) => $['agentDetail.configure.files.buildNote.richTooltip']}
- ns="agentV2"
- components={{
- docLink: (
- <DocsLink href={docLink('/use-dify/build/new-agent/build#the-build-note')} />
- ),
- }}
- />
- </p>
+ <Trans
+ i18nKey={($) => $['agentDetail.configure.files.buildNote.richTooltip']}
+ ns="agentV2"
+ components={{
+ docLink: <DocsLink href={docLink('/use-dify/build/new-agent/build#the-build-note')} />,
+ }}
+ />
</InfotipContent>
</Infotip>
)
diff --git a/web/plugins/eslint/tooltip-content.test.ts b/web/plugins/eslint/hint-content.test.ts
similarity index 63%
rename from web/plugins/eslint/tooltip-content.test.ts
rename to web/plugins/eslint/hint-content.test.ts
index 358591a05ba..70fb34dc563 100644
--- a/web/plugins/eslint/tooltip-content.test.ts
+++ b/web/plugins/eslint/hint-content.test.ts
@@ -4,20 +4,20 @@ import { createRequire } from 'node:module'
import { tmpdir } from 'node:os'
import { dirname, join } from 'node:path'
import { expect, it } from 'vite-plus/test'
-import { tooltipContentRules } from '../../../lint.config'
+import { hintContentRules } from '../../../lint.config'
function lintFixture(source: string) {
const require = createRequire(import.meta.url)
const viteRequire = createRequire(require.resolve('vite-plus/package.json'))
const oxlintBin = join(dirname(dirname(viteRequire.resolve('oxlint'))), 'bin', 'oxlint')
- const directory = mkdtempSync(join(tmpdir(), 'dify-tooltip-contract-'))
+ const directory = mkdtempSync(join(tmpdir(), 'dify-hint-contract-'))
try {
writeFileSync(
join(directory, '.oxlintrc.json'),
JSON.stringify({
categories: { correctness: 'off' },
jsPlugins: [require.resolve('@shadcn/lint')],
- rules: tooltipContentRules,
+ rules: hintContentRules,
}),
)
writeFileSync(join(directory, 'fixture.tsx'), source)
@@ -38,7 +38,7 @@ it('allows shortcut row composition and width constraints without restricting ot
const diagnostics = lintFixture(`
import { TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'
import { PopoverContent } from '@langgenius/dify-ui/popover'
- import { InfotipContent } from '@langgenius/dify-ui/infotip'
+ import { InfotipContent, InfotipTrigger } from '@langgenius/dify-ui/infotip'
const examples = <>
<TooltipContent className="flex items-center gap-1 max-w-60" />
<TooltipContent className="w-58 max-w-65" />
@@ -46,7 +46,8 @@ it('allows shortcut row composition and width constraints without restricting ot
<TooltipContent />
<TooltipTrigger className="border-0 bg-transparent" />
<PopoverContent className="shadow-none" />
- <InfotipContent className="shadow-none" />
+ <InfotipContent className="w-60 whitespace-pre-wrap" />
+ <InfotipTrigger className="ml-1 text-text-warning" />
<div className="shadow-none" />
</>
`)
@@ -125,3 +126,70 @@ it('checks readable class helpers, local values, and props spreads', () => {
expect(diagnostics.some(({ message }) => message.includes('"shadow-none"'))).toBe(true)
expect(diagnostics.some(({ message }) => message.includes('"border-0"'))).toBe(true)
})
+
+it('allows Infotip widths and content line breaks while retaining its own content contract', () => {
+ const diagnostics = lintFixture(`
+ import { InfotipContent as Explanation } from '@langgenius/dify-ui/infotip'
+ const examples = <>
+ <Explanation />
+ <Explanation className="w-60 max-w-75 whitespace-pre-wrap" />
+ <Explanation className="max-w-[261px] sm:w-60" />
+ <Explanation className={expanded ? 'w-60' : 'w-45'} />
+ </>
+ `)
+ expect(diagnostics).toEqual([])
+})
+
+it('rejects Infotip surface restyling and repeated defaults, including Tooltip-only layouts', () => {
+ const classes = [
+ 'p-1.5',
+ 'px-3',
+ 'py-2',
+ 'rounded-lg',
+ 'border-[0.5px]',
+ 'border-components-panel-border',
+ 'bg-components-tooltip-bg',
+ 'text-text-secondary',
+ 'system-xs-medium',
+ 'text-start',
+ 'wrap-break-word',
+ 'dark:shadow-none!',
+ 'backdrop-blur-[5px]',
+ 'transition-opacity',
+ 'data-ending-style:opacity-0',
+ '[box-shadow:none]',
+ '[&>p]:text-red-500',
+ 'flex',
+ 'flex-1',
+ 'items-center',
+ 'gap-1',
+ 'truncate',
+ 'whitespace-nowrap',
+ 'break-all',
+ ]
+ const diagnostics = lintFixture(`
+ import { InfotipContent as Explanation } from '@langgenius/dify-ui/infotip'
+ const example = <Explanation className="${classes.join(' ')}" />
+ `)
+ expect(diagnostics).toHaveLength(classes.length)
+ for (const className of classes)
+ expect(diagnostics.some(({ message }) => message.includes(`"${className}"`))).toBe(true)
+})
+
+it('checks Infotip class helpers and same-file props without restricting unrelated imports', () => {
+ const diagnostics = lintFixture(`
+ import { InfotipContent } from '@langgenius/dify-ui/infotip'
+ import { InfotipContent as Unrelated } from './feature'
+ import { cn } from '@langgenius/dify-ui/cn'
+ const surface = 'shadow-none'
+ const popup = { className: 'p-2' }
+ const examples = <>
+ <InfotipContent className={cn('w-60', surface)} />
+ <InfotipContent {...popup} />
+ <Unrelated className="p-2 shadow-none" />
+ </>
+ `)
+ expect(diagnostics).toHaveLength(2)
+ expect(diagnostics.some(({ message }) => message.includes('"shadow-none"'))).toBe(true)
+ expect(diagnostics.some(({ message }) => message.includes('"p-2"'))).toBe(true)
+})