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.

fix: reopen switch to 'workflow orchestrate' menu in app detail page (#19274)

NFish838812640e1d
diff --git a/web/app/components/app-sidebar/app-info.tsx b/web/app/components/app-sidebar/app-info.tsx
index 18a9ac8bc86..5ec0e318a02 100644
--- a/web/app/components/app-sidebar/app-info.tsx
+++ b/web/app/components/app-sidebar/app-info.tsx
@@ -6,9 +6,11 @@ import {
RiDeleteBinLine,
RiEditLine,
RiEqualizer2Line,
+ RiExchange2Line,
RiFileCopy2Line,
RiFileDownloadLine,
RiFileUploadLine,
+ RiMoreLine,
} from '@remixicon/react'
import AppIcon from '../base/app-icon'
import SwitchAppModal from '../app/switch-app-modal'
@@ -32,6 +34,7 @@ import { fetchWorkflowDraft } from '@/service/workflow'
import ContentDialog from '@/app/components/base/content-dialog'
import Button from '@/app/components/base/button'
import CardView from '@/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/cardView'
+import { PortalToFollowElem, PortalToFollowElemContent, PortalToFollowElemTrigger } from '../base/portal-to-follow-elem'
export type IAppInfoProps = {
expand: boolean
@@ -179,6 +182,11 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
const { isCurrentWorkspaceEditor } = useAppContext()
+ const [showMore, setShowMore] = useState(false)
+ const handleTriggerMore = useCallback(() => {
+ setShowMore(true)
+ }, [setShowMore])
+
if (!appDetail)
return null
@@ -276,22 +284,50 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
<RiFileDownloadLine className='h-3.5 w-3.5 text-components-button-secondary-text' />
<span className='system-xs-medium text-components-button-secondary-text'>{t('app.export')}</span>
</Button>
- {
- (appDetail.mode === 'advanced-chat' || appDetail.mode === 'workflow') && (
+ {appDetail.mode !== 'agent-chat' && <PortalToFollowElem
+ open={showMore}
+ onOpenChange={setShowMore}
+ placement='bottom-end'
+ offset={{
+ mainAxis: 4,
+ }}>
+ <PortalToFollowElemTrigger onClick={handleTriggerMore}>
<Button
size={'small'}
variant={'secondary'}
className='gap-[1px]'
- onClick={() => {
- setOpen(false)
- setShowImportDSLModal(true)
- }}
>
- <RiFileUploadLine className='h-3.5 w-3.5 text-components-button-secondary-text' />
- <span className='system-xs-medium text-components-button-secondary-text'>{t('workflow.common.importDSL')}</span>
+ <RiMoreLine className='h-3.5 w-3.5 text-components-button-secondary-text' />
+ <span className='system-xs-medium text-components-button-secondary-text'>{t('common.operation.more')}</span>
</Button>
- )
- }
+ </PortalToFollowElemTrigger>
+ <PortalToFollowElemContent className='z-[21]'>
+ <div className='flex w-[264px] flex-col rounded-[12px] border-[0.5px] border-components-panel-border bg-components-panel-bg-blur p-1 shadow-lg backdrop-blur-[5px]'>
+ {
+ (appDetail.mode === 'advanced-chat' || appDetail.mode === 'workflow')
+ && <div className='flex h-8 cursor-pointer items-center gap-x-1 rounded-lg p-1.5 hover:bg-state-base-hover'
+ onClick={() => {
+ setOpen(false)
+ setShowImportDSLModal(true)
+ }}>
+ <RiFileUploadLine className='h-4 w-4 text-text-tertiary' />
+ <span className='system-md-regular text-text-secondary'>{t('workflow.common.importDSL')}</span>
+ </div>
+ }
+ {
+ (appDetail.mode === 'completion' || appDetail.mode === 'chat')
+ && <div className='flex h-8 cursor-pointer items-center gap-x-1 rounded-lg p-1.5 hover:bg-state-base-hover'
+ onClick={() => {
+ setOpen(false)
+ setShowSwitchModal(true)
+ }}>
+ <RiExchange2Line className='h-4 w-4 text-text-tertiary' />
+ <span className='system-md-regular text-text-secondary'>{t('app.switch')}</span>
+ </div>
+ }
+ </div>
+ </PortalToFollowElemContent>
+ </PortalToFollowElem>}
</div>
</div>
<div className='flex flex-1'>
diff --git a/web/i18n/en-US/common.ts b/web/i18n/en-US/common.ts
index 0491ff57a89..8756095075f 100644
--- a/web/i18n/en-US/common.ts
+++ b/web/i18n/en-US/common.ts
@@ -57,6 +57,7 @@ const translation = {
submit: 'Submit',
skip: 'Skip',
format: 'Format',
+ more: 'More',
},
errorMsg: {
fieldRequired: '{{field}} is required',
diff --git a/web/i18n/ja-JP/common.ts b/web/i18n/ja-JP/common.ts
index c6163ec5cda..f2d7e0b4f0d 100644
--- a/web/i18n/ja-JP/common.ts
+++ b/web/i18n/ja-JP/common.ts
@@ -57,6 +57,7 @@ const translation = {
copied: 'コピーしました',
in: '中',
format: 'フォーマット',
+ more: 'もっと',
},
errorMsg: {
fieldRequired: '{{field}}は必要です',
diff --git a/web/i18n/zh-Hans/common.ts b/web/i18n/zh-Hans/common.ts
index 327f41ea05f..22211a92aab 100644
--- a/web/i18n/zh-Hans/common.ts
+++ b/web/i18n/zh-Hans/common.ts
@@ -57,6 +57,7 @@ const translation = {
submit: '提交',
skip: '跳过',
format: '格式化',
+ more: '更多',
},
errorMsg: {
fieldRequired: '{{field}} 为必填项',