chat restart

This commit is contained in:
StyleZhang 2024-03-25 18:42:51 +08:00
parent 07091c9d33
commit a35b5e4fff
2 changed files with 9 additions and 1 deletions

View File

@ -89,7 +89,6 @@ export const NodeTargetHandle = memo(({
hidden absolute left-0 top-0 pointer-events-none hidden absolute left-0 top-0 pointer-events-none
${nodeSelectorClassName} ${nodeSelectorClassName}
group-hover:flex group-hover:flex
group-hover:scale-150
${open && '!flex'} ${open && '!flex'}
`} `}
availableBlocksTypes={availablePrevNodes} availableBlocksTypes={availablePrevNodes}

View File

@ -2,6 +2,7 @@ import {
memo, memo,
useRef, useRef,
} from 'react' } from 'react'
import { useKeyPress } from 'ahooks'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import ChatWrapper from './chat-wrapper' import ChatWrapper from './chat-wrapper'
import Button from '@/app/components/base/button' import Button from '@/app/components/base/button'
@ -14,6 +15,12 @@ const DebugAndPreview = () => {
const { t } = useTranslation() const { t } = useTranslation()
const chatRef = useRef({ handleRestart: () => {} }) const chatRef = useRef({ handleRestart: () => {} })
useKeyPress('shift.r', () => {
chatRef.current.handleRestart()
}, {
exactMatch: true,
})
return ( return (
<div <div
className={` className={`
@ -31,6 +38,8 @@ const DebugAndPreview = () => {
> >
<RefreshCcw01 className='mr-1 w-3.5 h-3.5' /> <RefreshCcw01 className='mr-1 w-3.5 h-3.5' />
{t('common.operation.refresh')} {t('common.operation.refresh')}
<div className='ml-2 px-1 leading-[18px] rounded-md border border-gray-200 bg-gray-50 text-[11px] text-gray-500 font-medium'>Shift</div>
<div className='ml-0.5 px-1 leading-[18px] rounded-md border border-gray-200 bg-gray-50 text-[11px] text-gray-500 font-medium'>R</div>
</Button> </Button>
</div> </div>
<div className='grow rounded-b-2xl overflow-y-auto'> <div className='grow rounded-b-2xl overflow-y-auto'>