Merge branch 'main' into feat/rag-2

This commit is contained in:
twwu
2025-08-22 17:40:34 +08:00
113 changed files with 1945 additions and 269 deletions

View File

@ -24,7 +24,7 @@ export const EditTitle: FC<{ className?: string; title: string }> = ({ className
<RiEditFill className='mr-1 h-3.5 w-3.5' />
<div>{title}</div>
<div
className='ml-2 h-[1px] grow'
className='ml-2 h-px grow'
style={{
background: 'linear-gradient(90deg, rgba(0, 0, 0, 0.05) -1.65%, rgba(0, 0, 0, 0.00) 100%)',
}}

View File

@ -12,7 +12,7 @@ const GroupName: FC<IGroupNameProps> = ({
return (
<div className='mb-1 flex items-center'>
<div className='mr-3 text-xs font-semibold uppercase leading-[18px] text-text-tertiary'>{name}</div>
<div className='h-[1px] grow'
<div className='h-px grow'
style={{
background: 'linear-gradient(270deg, rgba(243, 244, 246, 0) 0%, #F3F4F6 100%)',

View File

@ -66,7 +66,7 @@ const SelectVarType: FC<Props> = ({
<SelectItem type={InputVarType.select} value='select' text={t('appDebug.variableConfig.select')} onClick={handleChange}></SelectItem>
<SelectItem type={InputVarType.number} value='number' text={t('appDebug.variableConfig.number')} onClick={handleChange}></SelectItem>
</div>
<div className='h-[1px] border-t border-components-panel-border'></div>
<div className='h-px border-t border-components-panel-border'></div>
<div className='p-1'>
<SelectItem Icon={ApiConnection} value='api' text={t('appDebug.variableConfig.apiBasedVar')} onClick={handleChange}></SelectItem>
</div>

View File

@ -81,7 +81,7 @@ const AssistantTypePicker: FC<Props> = ({
const agentConfigUI = (
<>
<div className='my-4 h-[1px] bg-gray-100'></div>
<div className='my-4 h-px bg-gray-100'></div>
<div
className={cn(isAgent ? 'group cursor-pointer hover:bg-primary-50' : 'opacity-30', 'rounded-xl bg-gray-50 p-3 pr-4 ')}
onClick={() => {

View File

@ -678,7 +678,7 @@ function DetailPanel({ detail, onFeedback }: IDetailPanel) {
? <div className="px-6 py-4">
<div className='flex h-[18px] items-center space-x-3'>
<div className='system-xs-semibold-uppercase text-text-tertiary'>{t('appLog.table.header.output')}</div>
<div className='h-[1px] grow' style={{
<div className='h-px grow' style={{
background: 'linear-gradient(270deg, rgba(243, 244, 246, 0) 0%, rgb(243, 244, 246) 100%)',
}}></div>
</div>

View File

@ -112,7 +112,7 @@ const WorkflowAppLogList: FC<ILogs> = ({ logs, appDetail, onRefresh }) => {
</div>
)}
</td>
<td className='w-[160px] p-3 pr-2'>{formatTime(log.created_at, t('appLog.dateTimeFormat') as string)}</td>
<td className='w-[180px] p-3 pr-2'>{formatTime(log.created_at, t('appLog.dateTimeFormat') as string)}</td>
<td className='p-3 pr-2'>{statusTdRender(log.workflow_run.status)}</td>
<td className='p-3 pr-2'>
<div className={cn(

View File

@ -24,7 +24,7 @@ const Iteration: FC<Props> = ({ iterationInfo, isFinal, index }) => {
{!isFinal && (
<div className='mr-3 shrink-0 text-xs font-semibold leading-[18px] text-text-tertiary'>{`${t('appLog.agentLogDetail.iteration').toUpperCase()} ${index}`}</div>
)}
<Divider bgStyle='gradient' className='mx-0 h-[1px] grow'/>
<Divider bgStyle='gradient' className='mx-0 h-px grow'/>
</div>
<ToolCall
isLLM

View File

@ -79,7 +79,7 @@ const Citation: FC<CitationProps> = ({
<div className='-mb-1 mt-3'>
<div className='system-xs-medium mb-2 flex items-center text-text-tertiary'>
{t('common.chat.citation.title')}
<div className='ml-2 h-[1px] grow bg-divider-regular' />
<div className='ml-2 h-px grow bg-divider-regular' />
</div>
<div className='relative flex flex-wrap'>
{

View File

@ -114,7 +114,7 @@ const Popup: FC<PopupProps> = ({
</div>
{
index !== data.sources.length - 1 && (
<div className='my-1 h-[1px] bg-divider-regular' />
<div className='my-1 h-px bg-divider-regular' />
)
}
</Fragment>

View File

@ -90,7 +90,7 @@ const Dropdown: FC<DropdownProps> = ({
}
{
(!!items.length && !!secondItems?.length) && (
<div className='h-[1px] bg-divider-regular' />
<div className='h-px bg-divider-regular' />
)
}
{

View File

@ -19,7 +19,7 @@ const ScoreSlider: FC<Props> = ({
return (
<div className={className}>
<div className='mt-[14px] h-[1px]'>
<div className='mt-[14px] h-px'>
<Slider
max={100}
min={80}

View File

@ -101,9 +101,9 @@ const FileFromLinkOrLocal = ({
{
showFromLink && showFromLocal && (
<div className='system-2xs-medium-uppercase flex h-7 items-center p-2 text-text-quaternary'>
<div className='mr-2 h-[1px] w-[93px] bg-gradient-to-l from-[rgba(16,24,40,0.08)]' />
<div className='mr-2 h-px w-[93px] bg-gradient-to-l from-[rgba(16,24,40,0.08)]' />
OR
<div className='ml-2 h-[1px] w-[93px] bg-gradient-to-r from-[rgba(16,24,40,0.08)]' />
<div className='ml-2 h-px w-[93px] bg-gradient-to-r from-[rgba(16,24,40,0.08)]' />
</div>
)
}

View File

@ -93,9 +93,9 @@ const UploaderButton: FC<UploaderButtonProps> = ({
{hasUploadFromLocal && (
<>
<div className="mt-2 flex items-center px-2 text-xs font-medium text-gray-400">
<div className="mr-3 h-[1px] w-[93px] bg-gradient-to-l from-[#F3F4F6]" />
<div className="mr-3 h-px w-[93px] bg-gradient-to-l from-[#F3F4F6]" />
OR
<div className="ml-3 h-[1px] w-[93px] bg-gradient-to-r from-[#F3F4F6]" />
<div className="ml-3 h-px w-[93px] bg-gradient-to-r from-[#F3F4F6]" />
</div>
<Uploader
onUpload={handleUpload}

View File

@ -0,0 +1,16 @@
class TooltipManager {
private activeCloser: (() => void) | null = null
register(closeFn: () => void) {
if (this.activeCloser)
this.activeCloser()
this.activeCloser = closeFn
}
clear(closeFn: () => void) {
if (this.activeCloser === closeFn)
this.activeCloser = null
}
}
export const tooltipManager = new TooltipManager()

View File

@ -6,6 +6,8 @@ import type { OffsetOptions, Placement } from '@floating-ui/react'
import { RiQuestionLine } from '@remixicon/react'
import cn from '@/utils/classnames'
import { PortalToFollowElem, PortalToFollowElemContent, PortalToFollowElemTrigger } from '@/app/components/base/portal-to-follow-elem'
import { tooltipManager } from './TooltipManager'
export type TooltipProps = {
position?: Placement
triggerMethod?: 'hover' | 'click'
@ -56,22 +58,26 @@ const Tooltip: FC<TooltipProps> = ({
isHoverTriggerRef.current = isHoverTrigger
}, [isHoverTrigger])
const close = () => setOpen(false)
const handleLeave = (isTrigger: boolean) => {
if (isTrigger)
setNotHoverTrigger()
else
setNotHoverPopup()
// give time to move to the popup
if (needsDelay) {
setTimeout(() => {
if (!isHoverPopupRef.current && !isHoverTriggerRef.current)
if (!isHoverPopupRef.current && !isHoverTriggerRef.current) {
setOpen(false)
tooltipManager.clear(close)
}
}, 300)
}
else {
setOpen(false)
tooltipManager.clear(close)
}
}
@ -87,6 +93,7 @@ const Tooltip: FC<TooltipProps> = ({
onMouseEnter={() => {
if (triggerMethod === 'hover') {
setHoverTrigger()
tooltipManager.register(close)
setOpen(true)
}
}}

View File

@ -93,7 +93,7 @@ const ChildSegmentList: FC<IChildSegmentCardProps> = ({
isParagraphMode ? 'pb-2 pt-1' : 'grow px-3',
(isFullDocMode && isLoading) && 'overflow-y-hidden',
)}>
{isFullDocMode ? <Divider type='horizontal' className='my-1 h-[1px] bg-divider-subtle' /> : null}
{isFullDocMode ? <Divider type='horizontal' className='my-1 h-px bg-divider-subtle' /> : null}
<div className={cn('flex items-center justify-between', isFullDocMode ? 'sticky -top-2 left-0 bg-background-default pb-3 pt-2' : '')}>
<div className={cn(
'flex h-7 items-center rounded-lg pl-1 pr-3',

View File

@ -650,7 +650,7 @@ const Completed: FC<ICompletedProps> = ({
/>
}
{/* Pagination */}
<Divider type='horizontal' className='mx-6 my-0 h-[1px] w-auto bg-divider-subtle' />
<Divider type='horizontal' className='mx-6 my-0 h-px w-auto bg-divider-subtle' />
<Pagination
current={currentPage - 1}
onChange={cur => setCurrentPage(cur + 1)}

View File

@ -105,7 +105,7 @@ const ApiBasedExtensionSelector: FC<ApiBasedExtensionSelectorProps> = ({
}
</div>
</div>
<div className='h-[1px] bg-divider-regular' />
<div className='h-px bg-divider-regular' />
<div className='p-1'>
<div
className='flex h-8 cursor-pointer items-center px-3 text-sm text-text-accent'

View File

@ -206,7 +206,7 @@ const ModelParameterModal: FC<ModelParameterModalProps> = ({
</div>
{
!!parameterRules.length && (
<div className='my-3 h-[1px] bg-divider-subtle' />
<div className='my-3 h-px bg-divider-subtle' />
)
}
{

View File

@ -14,7 +14,7 @@ const IntersectionLine = ({
useScrollIntersection(ref, intersectionContainerId)
return (
<div ref={ref} className='mb-4 h-[1px] shrink-0 bg-transparent'></div>
<div ref={ref} className='mb-4 h-px shrink-0 bg-transparent'></div>
)
}

View File

@ -294,7 +294,7 @@ const Authorized = ({
)
}
</div>
<div className='h-[1px] bg-divider-subtle'></div>
<div className='h-px bg-divider-subtle'></div>
<div className='p-2'>
<Authorize
pluginPayload={pluginPayload}

View File

@ -248,7 +248,7 @@ const ModelParameterModal: FC<ModelParameterModalProps> = ({
/>
</div>
{(currentModel?.model_type === ModelTypeEnum.textGeneration || currentModel?.model_type === ModelTypeEnum.tts) && (
<div className='my-3 h-[1px] bg-divider-subtle' />
<div className='my-3 h-px bg-divider-subtle' />
)}
{currentModel?.model_type === ModelTypeEnum.textGeneration && (
<LLMParamsPanel

View File

@ -73,7 +73,7 @@ const PluginsPanel = () => {
{!isPluginListLoading && (
<>
{(filteredList?.length ?? 0) > 0 ? (
<div className='flex grow flex-wrap content-start items-start justify-center gap-2 self-stretch px-12'>
<div className='flex grow flex-wrap content-start items-start justify-center gap-2 self-stretch overflow-y-auto px-12'>
<div className='w-full'>
<List pluginList={filteredList || []} />
</div>

View File

@ -175,7 +175,7 @@ const WorkflowToolConfigureButton = ({
return (
<>
<Divider type='horizontal' className='h-[1px] bg-divider-subtle' />
<Divider type='horizontal' className='h-px bg-divider-subtle' />
{(!published || !isLoading) && (
<div className={cn(
'group rounded-lg bg-background-section-burn transition-colors',

View File

@ -15,7 +15,7 @@ const HelpLineHorizontal = memo(({
return (
<div
className='absolute z-[9] h-[1px] bg-primary-300'
className='absolute z-[9] h-px bg-primary-300'
style={{
top: top * zoom + y,
left: left * zoom + x,

View File

@ -80,7 +80,7 @@ const PanelOperatorPopup = ({
)
}
</div>
<div className='h-[1px] bg-divider-regular'></div>
<div className='h-px bg-divider-regular'></div>
</>
)
}
@ -109,7 +109,7 @@ const PanelOperatorPopup = ({
<ShortcutsName keys={['ctrl', 'd']} />
</div>
</div>
<div className='h-[1px] bg-divider-regular'></div>
<div className='h-px bg-divider-regular'></div>
{
!nodeMetaData.isUndeletable && (
<>
@ -125,7 +125,7 @@ const PanelOperatorPopup = ({
<ShortcutsName keys={['del']} />
</div>
</div>
<div className='h-[1px] bg-divider-regular'></div>
<div className='h-px bg-divider-regular'></div>
</>
)
}
@ -144,7 +144,7 @@ const PanelOperatorPopup = ({
{t('workflow.panel.helpLink')}
</a>
</div>
<div className='h-[1px] bg-divider-regular'></div>
<div className='h-px bg-divider-regular'></div>
</>
)
}

View File

@ -204,7 +204,7 @@ const ConditionWrap: FC<Props> = ({
</div>
</div>
{!isSubVariable && (
<div className='mx-3 my-2 h-[1px] bg-divider-subtle'></div>
<div className='mx-3 my-2 h-px bg-divider-subtle'></div>
)}
</div>
))

View File

@ -73,7 +73,7 @@ const Panel: FC<NodePanelProps<IfElseNodeType>> = ({
ELIF
</Button>
</div>
<div className='mx-3 my-2 h-[1px] bg-divider-subtle'></div>
<div className='mx-3 my-2 h-px bg-divider-subtle'></div>
<Field
title={t(`${i18nPrefix}.else`)}
className='px-4 py-2'

View File

@ -71,7 +71,7 @@ const Operator = ({
<ShortcutsName keys={['ctrl', 'd']} />
</div>
</div>
<div className='h-[1px] bg-divider-subtle'></div>
<div className='h-px bg-divider-subtle'></div>
<div className='p-1'>
<div
className='flex h-8 cursor-pointer items-center justify-between rounded-md px-3 text-sm text-text-secondary hover:bg-state-base-hover'
@ -85,7 +85,7 @@ const Operator = ({
/>
</div>
</div>
<div className='h-[1px] bg-divider-subtle'></div>
<div className='h-px bg-divider-subtle'></div>
<div className='p-1'>
<div
className='flex h-8 cursor-pointer items-center justify-between rounded-md px-3 text-sm text-text-secondary hover:bg-state-destructive-hover hover:text-text-destructive'

View File

@ -107,7 +107,7 @@ const ConversationVariableModal = ({
<div className='flex h-0 grow flex-col p-4 pt-2'>
<div className='mb-2 flex shrink-0 items-center gap-2'>
<div className='system-xs-medium-uppercase shrink-0 text-text-tertiary'>{t('workflow.chatVariable.storedContent').toLocaleUpperCase()}</div>
<div className='h-[1px] grow' style={{
<div className='h-px grow' style={{
background: 'linear-gradient(to right, rgba(16, 24, 40, 0.08) 0%, rgba(255, 255, 255) 100%)',
}}></div>
{latestValueTimestampMap[currentVar.id] && (

View File

@ -64,7 +64,7 @@ const ContextMenu: FC<ContextMenuProps> = (props: ContextMenuProps) => {
{
isShowDelete && (
<>
<Divider type='horizontal' className='my-0 h-[1px] bg-divider-subtle' />
<Divider type='horizontal' className='my-0 h-px bg-divider-subtle' />
<div className='p-1'>
<MenuItem
item={deleteOperation}

View File

@ -70,7 +70,7 @@ const Filter: FC<FilterProps> = ({
})
}
</div>
<Divider type='horizontal' className='my-0 h-[1px] bg-divider-subtle' />
<Divider type='horizontal' className='my-0 h-px bg-divider-subtle' />
<FilterSwitch enabled={isOnlyShowNamedVersions} handleSwitch={handleSwitch} />
</div>
</PortalToFollowElemContent>

View File

@ -414,7 +414,7 @@ const SelectionContextmenu = () => {
{t('workflow.operator.distributeVertical')}
</div>
</div>
<div className='h-[1px] bg-divider-regular'></div>
<div className='h-px bg-divider-regular'></div>
<div className='p-1'>
<div className='system-xs-medium px-2 py-2 text-text-tertiary'>
{t('workflow.operator.horizontal')}

View File

@ -154,7 +154,7 @@ const EducationApplyAge = () => {
>
{t('education.submit')}
</Button>
<div className='mb-4 mt-5 h-[1px] bg-gradient-to-r from-[rgba(16,24,40,0.08)]'></div>
<div className='mb-4 mt-5 h-px bg-gradient-to-r from-[rgba(16,24,40,0.08)]'></div>
<a
className='system-xs-regular flex items-center text-text-accent'
href={docLink('/getting-started/dify-for-education')}