Skip to content

Dark Mode: Workflow darkmode style #11695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 17, 2024
4 changes: 2 additions & 2 deletions web/app/components/tools/add-tool-modal/empty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const Empty = () => {
return (
<div className='flex flex-col items-center'>
<div className="shrink-0 w-[163px] h-[149px] bg-cover bg-no-repeat bg-[url('~@/app/components/tools/add-tool-modal/empty.png')]"></div>
<div className='mb-1 text-[13px] font-medium text-gray-700 leading-[18px]'>{t('tools.addToolModal.emptyTitle')}</div>
<div className='text-[13px] text-gray-500 leading-[18px]'>{t('tools.addToolModal.emptyTip')}</div>
<div className='mb-1 text-[13px] font-medium text-text-primary leading-[18px]'>{t('tools.addToolModal.emptyTitle')}</div>
<div className='text-[13px] text-text-tertiary leading-[18px]'>{t('tools.addToolModal.emptyTip')}</div>
</div>
)
}
Expand Down
16 changes: 8 additions & 8 deletions web/app/components/workflow/block-selector/all-tools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ const AllTools = ({

return mergedTools.filter((toolWithProvider) => {
return isMatchingKeywords(toolWithProvider.name, searchText)
|| toolWithProvider.tools.some((tool) => {
return Object.values(tool.label).some((label) => {
return isMatchingKeywords(label, searchText)
|| toolWithProvider.tools.some((tool) => {
return Object.values(tool.label).some((label) => {
return isMatchingKeywords(label, searchText)
})
})
})
})
}, [activeTab, buildInTools, customTools, workflowTools, searchText])
return (
<div>
<div className='flex items-center px-3 h-8 space-x-1 bg-gray-25 border-b-[0.5px] border-black/[0.08] shadow-xs'>
<div className='flex items-center px-3 h-8 space-x-1 bg-background-default-hover border-b-[0.5px] border-divider-subtle shadow-xs'>
{
tabs.map(tab => (
<div
className={cn(
'flex items-center px-2 h-6 rounded-md hover:bg-gray-100 cursor-pointer',
'text-xs font-medium text-gray-700',
activeTab === tab.key && 'bg-gray-200',
'flex items-center px-2 h-6 rounded-md hover:bg-state-base-hover-alt cursor-pointer',
'system-xs-medium text-text-tertiary',
activeTab === tab.key && 'system-xs-semibold bg-state-base-hover-alt text-text-primary',
)}
key={tab.key}
onClick={() => setActiveTab(tab.key)}
Expand Down
14 changes: 7 additions & 7 deletions web/app/components/workflow/block-selector/blocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const Blocks = ({
>
{
classification !== '-' && !!list.length && (
<div className='flex items-start px-3 h-[22px] text-xs font-medium text-gray-500'>
<div className='flex items-start px-3 h-[22px] text-xs font-medium text-text-tertiary'>
{t(`workflow.tabs.${classification}`)}
</div>
)
Expand All @@ -68,29 +68,29 @@ const Blocks = ({
<Tooltip
key={block.type}
position='right'
popupClassName='!p-0 !px-3 !py-2.5 !w-[200px] !leading-[18px] !text-xs !text-gray-700 !border-[0.5px] !border-black/5 !rounded-xl !shadow-lg'
popupClassName='w-[200px]'
popupContent={(
<div>
<BlockIcon
size='md'
className='mb-2'
type={block.type}
/>
<div className='mb-1 text-sm leading-5 text-gray-900'>{block.title}</div>
<div className='text-xs text-gray-700 leading-[18px]'>{nodesExtraData[block.type].about}</div>
<div className='mb-1 system-md-medium text-text-primary'>{block.title}</div>
<div className='text-text-tertiary system-xs-regular'>{nodesExtraData[block.type].about}</div>
</div>
)}
>
<div
key={block.type}
className='flex items-center px-3 w-full h-8 rounded-lg hover:bg-gray-50 cursor-pointer'
className='flex items-center px-3 w-full h-8 rounded-lg hover:bg-state-base-hover cursor-pointer'
onClick={() => onSelect(block.type)}
>
<BlockIcon
className='mr-2 shrink-0'
type={block.type}
/>
<div className='text-sm text-gray-900'>{block.title}</div>
<div className='text-sm text-text-secondary'>{block.title}</div>
</div>
</Tooltip>
))
Expand All @@ -103,7 +103,7 @@ const Blocks = ({
<div className='p-1'>
{
isEmpty && (
<div className='flex items-center px-3 h-[22px] text-xs font-medium text-gray-500'>{t('workflow.tabs.noResult')}</div>
<div className='flex items-center px-3 h-[22px] text-xs font-medium text-text-tertiary'>{t('workflow.tabs.noResult')}</div>
)
}
{
Expand Down
4 changes: 2 additions & 2 deletions web/app/components/workflow/block-selector/index-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ const IndexBar: FC<IndexBarProps> = ({ letters, itemRefs }) => {
element.scrollIntoView({ behavior: 'smooth' })
}
return (
<div className="index-bar fixed right-4 top-36 flex flex-col items-center text-xs font-medium text-gray-500">
<div className="index-bar fixed right-4 top-36 flex flex-col items-center text-xs font-medium text-text-quaternary">
{letters.map(letter => (
<div className="hover:text-gray-900 cursor-pointer" key={letter} onClick={() => handleIndexClick(letter)}>
<div className="hover:text-text-secondary cursor-pointer" key={letter} onClick={() => handleIndexClick(letter)}>
{letter}
</div>
))}
Expand Down
11 changes: 7 additions & 4 deletions web/app/components/workflow/block-selector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import Input from '@/app/components/base/input'
import {
Plus02,
} from '@/app/components/base/icons/src/vender/line/general'
import classNames from '@/utils/classnames'

type NodeSelectorProps = {
open?: boolean
Expand Down Expand Up @@ -114,19 +115,21 @@ const NodeSelector: FC<NodeSelectorProps> = ({
<div
className={`
flex items-center justify-center
w-4 h-4 rounded-full bg-primary-600 cursor-pointer z-10
w-4 h-4 rounded-full bg-components-button-primary-bg text-text-primary-on-surface hover:bg-components-button-primary-bg-hover cursor-pointer z-10
${triggerClassName?.(open)}
`}
style={triggerStyle}
>
<Plus02 className='w-2.5 h-2.5 text-white' />
<Plus02 className='w-2.5 h-2.5' />
</div>
)
}
</PortalToFollowElemTrigger>
<PortalToFollowElemContent className='z-[1000]'>
<div className={`rounded-lg border-[0.5px] border-gray-200 bg-white shadow-lg ${popupClassName}`}>
<div className='px-2 pt-2' onClick={e => e.stopPropagation()}>
<div className={
classNames(`rounded-lg border-[0.5px] backdrop-blur-[5px]
border-components-panel-border bg-components-panel-bg-blur shadow-lg`, popupClassName)}>
<div className='p-2 pb-1' onClick={e => e.stopPropagation()}>
<Input
showLeftIcon
showClearIcon
Expand Down
8 changes: 4 additions & 4 deletions web/app/components/workflow/block-selector/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ const Tabs: FC<TabsProps> = ({
<div onClick={e => e.stopPropagation()}>
{
!noBlocks && (
<div className='flex items-center px-3 border-b-[0.5px] border-b-black/5'>
<div className='flex items-center px-3 border-b-[0.5px] border-divider-subtle'>
{
tabs.map(tab => (
<div
key={tab.key}
className={cn(
'relative mr-4 h-[34px] text-[13px] leading-[34px] font-medium cursor-pointer',
'relative mr-4 pt-1 pb-2 system-sm-medium cursor-pointer',
activeTab === tab.key
? 'text-gray-700 after:absolute after:bottom-0 after:left-0 after:h-0.5 after:w-full after:bg-primary-600'
: 'text-gray-500',
? 'text-text-primary after:absolute after:bottom-0 after:left-0 after:h-0.5 after:w-full after:bg-util-colors-blue-brand-blue-brand-600'
: 'text-text-tertiary',
)}
onClick={() => onActiveTabChange(tab.key)}
>
Expand Down
12 changes: 6 additions & 6 deletions web/app/components/workflow/block-selector/tools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Blocks = ({
<Tooltip
key={tool.name}
position='right'
popupClassName='!p-0 !px-3 !py-2.5 !w-[200px] !leading-[18px] !text-xs !text-gray-700 !border-[0.5px] !border-black/5 !rounded-xl !shadow-lg'
popupClassName='w-[200px]'
popupContent={(
<div>
<BlockIcon
Expand All @@ -54,13 +54,13 @@ const Blocks = ({
type={BlockEnum.Tool}
toolIcon={toolWithProvider.icon}
/>
<div className='mb-1 text-sm leading-5 text-gray-900'>{tool.label[language]}</div>
<div className='text-xs text-gray-700 leading-[18px]'>{tool.description[language]}</div>
<div className='mb-1 system-md-medium text-text-primary'>{tool.label[language]}</div>
<div className='system-xs-regular text-text-tertiary'>{tool.description[language]}</div>
</div>
)}
>
<div
className='flex items-center px-3 w-full h-8 rounded-lg hover:bg-gray-50 cursor-pointer'
className='flex items-center px-3 w-full h-8 rounded-lg hover:bg-state-base-hover cursor-pointer'
onClick={() => onSelect(BlockEnum.Tool, {
provider_id: toolWithProvider.id,
provider_type: toolWithProvider.type,
Expand All @@ -75,7 +75,7 @@ const Blocks = ({
type={BlockEnum.Tool}
toolIcon={toolWithProvider.icon}
/>
<div className='text-sm text-gray-900 flex-1 min-w-0 truncate'>{tool.label[language]}</div>
<div className='text-sm text-text-secondary flex-1 min-w-0 truncate'>{tool.label[language]}</div>
</div>
</Tooltip>
))
Expand All @@ -100,7 +100,7 @@ const Blocks = ({
<div className='p-1 max-w-[320px] max-h-[464px] overflow-y-auto'>
{
!tools.length && !showWorkflowEmpty && (
<div className='flex items-center px-3 h-[22px] text-xs font-medium text-gray-500'>{t('workflow.tabs.noResult')}</div>
<div className='flex items-center px-3 h-[22px] text-xs font-medium text-text-tertiary'>{t('workflow.tabs.noResult')}</div>
)
}
{!tools.length && showWorkflowEmpty && (
Expand Down
2 changes: 1 addition & 1 deletion web/app/components/workflow/header/editing-title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const EditingTitle = () => {
const isSyncingWorkflowDraft = useStore(s => s.isSyncingWorkflowDraft)

return (
<div className='flex items-center h-[18px] text-xs text-gray-500'>
<div className='flex items-center h-[18px] system-xs-regular text-text-tertiary'>
{
!!draftUpdatedAt && (
<>
Expand Down
20 changes: 8 additions & 12 deletions web/app/components/workflow/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
} from '../hooks'
import AppPublisher from '../../app/app-publisher'
import { ToastContext } from '../../base/toast'
import Divider from '../../base/divider'
import RunAndHistory from './run-and-history'
import EditingTitle from './editing-title'
import RunningTitle from './running-title'
Expand Down Expand Up @@ -144,15 +145,12 @@ const Header: FC = () => {

return (
<div
className='absolute top-0 left-0 z-10 flex items-center justify-between w-full px-3 h-14'
style={{
background: 'linear-gradient(180deg, #F9FAFB 0%, rgba(249, 250, 251, 0.00) 100%)',
}}
className='absolute top-0 left-0 z-10 flex items-center justify-between w-full px-3 h-14 bg-mask-top2bottom-gray-50-to-transparent'
>
<div>
{
appSidebarExpand === 'collapse' && (
<div className='text-xs font-medium text-gray-700'>{appDetail?.name}</div>
<div className='system-xs-regular text-text-tertiary'>{appDetail?.name}</div>
)
}
{
Expand All @@ -171,7 +169,7 @@ const Header: FC = () => {
{/* <GlobalVariableButton disabled={nodesReadOnly} /> */}
{isChatMode && <ChatVariableButton disabled={nodesReadOnly} />}
<EnvButton disabled={nodesReadOnly} />
<div className='w-[1px] h-3.5 bg-gray-200'></div>
<Divider type='vertical' className='h-3.5 mx-auto' />
<RunAndHistory />
<Button className='text-components-button-secondary-text' onClick={handleShowFeatures}>
<RiApps2AddLine className='w-4 h-4 mr-1 text-components-button-secondary-text' />
Expand All @@ -196,12 +194,11 @@ const Header: FC = () => {
}
{
viewHistory && (
<div className='flex items-center'>
<div className='flex items-center space-x-2'>
<ViewHistory withText />
<div className='mx-2 w-[1px] h-3.5 bg-gray-200'></div>
<Divider type='vertical' className='h-3.5 mx-auto' />
<Button
variant='primary'
className='mr-2'
onClick={handleGoBackToEdit}
>
<ArrowNarrowLeft className='w-4 h-4 mr-1' />
Expand All @@ -212,14 +209,13 @@ const Header: FC = () => {
}
{
restoring && (
<div className='flex items-center'>
<div className='flex items-center space-x-2'>
<Button className='text-components-button-secondary-text' onClick={handleShowFeatures}>
<RiApps2AddLine className='w-4 h-4 mr-1 text-components-button-secondary-text' />
{t('workflow.common.features')}
</Button>
<div className='mx-2 w-[1px] h-3.5 bg-gray-200'></div>
<Divider type='vertical' className='h-3.5 mx-auto' />
<Button
className='mr-2'
onClick={handleCancelRestore}
>
{t('common.operation.cancel')}
Expand Down
29 changes: 15 additions & 14 deletions web/app/components/workflow/header/undo-redo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import {
} from '@remixicon/react'
import TipPopup from '../operator/tip-popup'
import { useWorkflowHistoryStore } from '../workflow-history-store'
import Divider from '../../base/divider'
import { useNodesReadOnly } from '@/app/components/workflow/hooks'
import ViewWorkflowHistory from '@/app/components/workflow/header/view-workflow-history'
import classNames from '@/utils/classnames'

export type UndoRedoProps = { handleUndo: () => void; handleRedo: () => void }
const UndoRedo: FC<UndoRedoProps> = ({ handleUndo, handleRedo }) => {
Expand All @@ -29,36 +31,35 @@ const UndoRedo: FC<UndoRedoProps> = ({ handleUndo, handleRedo }) => {
const { nodesReadOnly } = useNodesReadOnly()

return (
<div className='flex items-center p-0.5 rounded-lg border-[0.5px] border-gray-100 bg-white shadow-lg text-gray-500'>
<div className='flex items-center space-x-0.5 p-0.5 backdrop-blur-[5px] rounded-lg border-[0.5px] border-components-actionbar-border bg-components-actionbar-bg shadow-lg'>
<TipPopup title={t('workflow.common.undo')!} shortcuts={['ctrl', 'z']}>
<div
data-tooltip-id='workflow.undo'
className={`
flex items-center px-1.5 w-8 h-8 rounded-md text-[13px] font-medium
hover:bg-black/5 hover:text-gray-700 cursor-pointer select-none
${(nodesReadOnly || buttonsDisabled.undo) && 'hover:bg-transparent opacity-50 !cursor-not-allowed'}
`}
className={
classNames('flex items-center px-1.5 w-8 h-8 rounded-md system-sm-medium text-text-tertiary hover:bg-state-base-hover hover:text-text-secondary cursor-pointer select-none',
(nodesReadOnly || buttonsDisabled.undo)
&& 'hover:bg-transparent text-text-disabled hover:text-text-disabled cursor-not-allowed')}
onClick={() => !nodesReadOnly && !buttonsDisabled.undo && handleUndo()}
>
<RiArrowGoBackLine className='h-4 w-4' />
</div>
</TipPopup>
</TipPopup >
<TipPopup title={t('workflow.common.redo')!} shortcuts={['ctrl', 'y']}>
<div
data-tooltip-id='workflow.redo'
className={`
flex items-center px-1.5 w-8 h-8 rounded-md text-[13px] font-medium
hover:bg-black/5 hover:text-gray-700 cursor-pointer select-none
${(nodesReadOnly || buttonsDisabled.redo) && 'hover:bg-transparent opacity-50 !cursor-not-allowed'}
`}
className={
classNames('flex items-center px-1.5 w-8 h-8 rounded-md system-sm-medium text-text-tertiary hover:bg-state-base-hover hover:text-text-secondary cursor-pointer select-none',
(nodesReadOnly || buttonsDisabled.redo)
&& 'hover:bg-transparent text-text-disabled hover:text-text-disabled cursor-not-allowed',
)}
onClick={() => !nodesReadOnly && !buttonsDisabled.redo && handleRedo()}
>
<RiArrowGoForwardFill className='h-4 w-4' />
</div>
</TipPopup>
<div className="mx-[3px] w-[1px] h-3.5 bg-gray-200"></div>
<Divider type='vertical' className="h-3.5 mx-0.5" />
<ViewWorkflowHistory />
</div>
</div >
)
}

Expand Down
Loading
Loading