refactor: hide workflow features button in workflow mode, keep it visible in chatflow mode

This commit is contained in:
lyzno1 2025-09-30 17:51:01 +08:00
parent 8547032a87
commit bea11b08d7
1 changed files with 15 additions and 10 deletions

View File

@ -36,10 +36,12 @@ import { fetchAppDetail } from '@/service/apps'
import { useStore as useAppStore } from '@/app/components/app/store'
import useTheme from '@/hooks/use-theme'
import cn from '@/utils/classnames'
import { useIsChatMode } from '../../hooks'
const FeaturesTrigger = () => {
const { t } = useTranslation()
const { theme } = useTheme()
const isChatMode = useIsChatMode()
const workflowStore = useWorkflowStore()
const appDetail = useAppStore(s => s.appDetail)
const appID = appDetail?.id
@ -147,16 +149,19 @@ const FeaturesTrigger = () => {
return (
<>
<Button
className={cn(
'text-components-button-secondary-text',
theme === 'dark' && 'rounded-lg border border-black/5 bg-white/10 backdrop-blur-sm',
)}
onClick={handleShowFeatures}
>
<RiApps2AddLine className='mr-1 h-4 w-4 text-components-button-secondary-text' />
{t('workflow.common.features')}
</Button>
{/* Feature button is only visible in chatflow mode (advanced-chat) */}
{isChatMode && (
<Button
className={cn(
'text-components-button-secondary-text',
theme === 'dark' && 'rounded-lg border border-black/5 bg-white/10 backdrop-blur-sm',
)}
onClick={handleShowFeatures}
>
<RiApps2AddLine className='mr-1 h-4 w-4 text-components-button-secondary-text' />
{t('workflow.common.features')}
</Button>
)}
<AppPublisher
{...{
publishedAt,