chore:conversation svg

pull/18563/head
keting lu 1 year ago
parent cb61ead939
commit 28795000ab

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"
width="512" height="512" x="0" y="0" viewBox="0 0 32 32"
style="enable-background:new 0 0 512 512" xml:space="preserve"><g><linearGradient id="a" x1="10.37" x2="23.778" y1="30.252" y2="7.029" data-name="New Gradient Swatch 1" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#605faa"></stop><stop offset="1" stop-color="#80d2e7"></stop></linearGradient><path fill="url(#a)" d="M19 6a3 3 0 0 1-2 2.82c-.31.12-.65.18-1 .18s-.69-.06-1-.18A3 3 0 0 1 13 6c0-1.65 1.35-3 3-3s3 1.35 3 3zm7 9v11c0 1.65-1.35 3-3 3H9c-1.65 0-3-1.35-3-3V15c0-1.65 1.35-3 3-3h6v-1.1c.32.07.66.1 1 .1s.68-.03 1-.1V12h6c1.65 0 3 1.35 3 3zm-14 4.5c.83 0 1.5-.67 1.5-1.5s-.67-1.5-1.5-1.5-1.5.67-1.5 1.5.67 1.5 1.5 1.5zm7.8 2.9c-.33-.44-.96-.53-1.4-.2-.93.7-1.9.8-2.4.8-1.16 0-2-.5-2.4-.8-.44-.33-1.07-.24-1.4.2s-.24 1.07.2 1.4c.6.45 1.86 1.2 3.6 1.2.75 0 2.21-.16 3.6-1.2.44-.33.53-.96.2-1.4zm1.7-4.4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5.67 1.5 1.5 1.5 1.5-.67 1.5-1.5zM4 16c-1.103 0-2 .897-2 2v5c0 1.103.897 2 2 2zm24 0v9c1.103 0 2-.897 2-2v-5c0-1.103-.897-2-2-2z" opacity="1" data-original="url(#a)"></path></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"
width="512" height="512" x="0" y="0" viewBox="0 0 512 512"
style="enable-background:new 0 0 512 512" xml:space="preserve" class=""><g><linearGradient id="a"><stop offset="0" stop-color="#0039a6"></stop><stop offset="1" stop-color="#318ce7"></stop></linearGradient><linearGradient xlink:href="#a" id="b" x1="380.473" x2="130.789" y1="124.842" y2="124.842" gradientUnits="userSpaceOnUse"></linearGradient><linearGradient xlink:href="#a" id="c" x1="505.954" x2="5.305" y1="403.135" y2="403.135" gradientUnits="userSpaceOnUse"></linearGradient><g fill-rule="evenodd" clip-rule="evenodd"><path fill="url(#b)" d="M380.473 124.842c0 68.948-55.894 124.842-124.842 124.842S130.789 193.79 130.789 124.842C130.789 55.894 186.683 0 255.631 0s124.842 55.894 124.842 124.842z" opacity="1" data-original="url(#b)"></path><path fill="url(#c)" d="M461.258 512c27.614 0 50.62-22.769 43.333-49.405-10.744-39.275-34.185-75.577-68.205-104.553-47.94-40.833-112.96-63.772-180.757-63.772-67.796 0-132.817 22.939-180.756 63.772-34.02 28.976-57.46 65.278-68.205 104.553C-.62 489.231 22.387 512 50 512z" opacity="1" data-original="url(#c)"></path></g></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -361,17 +361,15 @@ const Result: FC<IResultProps> = ({
const handleScroll = throttle(() => { const handleScroll = throttle(() => {
const distanceToBottom = el.scrollHeight - el.scrollTop - el.clientHeight const distanceToBottom = el.scrollHeight - el.scrollTop - el.clientHeight
console.log('1', el.scrollHeight, el.scrollTop, el.clientHeight)
console.log('renderRef', renderRef.current?.scrollHeight, renderRef.current?.scrollTop, renderRef.current?.clientHeight)
const atBottom = distanceToBottom <= 200 // 缓冲 20px 容错 const atBottom = distanceToBottom <= 200
setIsAtBottom(atBottom) setIsAtBottom(atBottom)
}, 1000) }, 200)
const delay = setTimeout(() => { const delay = setTimeout(() => {
isInitialMount.current = false isInitialMount.current = false
el.addEventListener('scroll', handleScroll) el.addEventListener('scroll', handleScroll)
}, 300) // 避免内容撑开误判 }, 300)
return () => { return () => {
clearTimeout(delay) clearTimeout(delay)
@ -383,9 +381,9 @@ const Result: FC<IResultProps> = ({
if (!el || !isAtBottom) return if (!el || !isAtBottom) return
let attempts = 0 let attempts = 0
const maxAttempts = 30 // 最多尝试 30 次,避免死循环 const maxAttempts = 30
const delayMs = 16 // 每帧尝试(≈ 60fps const delayMs = 16
const threshold = 10 // 容忍范围内算到底了 const threshold = 10
const tryScroll = () => { const tryScroll = () => {
if (!el) return if (!el) return
@ -399,7 +397,6 @@ const Result: FC<IResultProps> = ({
requestAnimationFrame(tryScroll) requestAnimationFrame(tryScroll)
} }
else { else {
// 最后再确保锚点视图内
bottomRef.current?.scrollIntoView({ behavior: 'smooth' }) bottomRef.current?.scrollIntoView({ behavior: 'smooth' })
} }
} }
@ -428,13 +425,17 @@ const Result: FC<IResultProps> = ({
/> />
</div> </div>
)} )}
</div></div> </div>
<div className="shrink-0 w-5 h-5 m-2 bg-cover bg-no-repeat bg-[url('~@/app/components/runOnce/text-generation/result/human.svg')]" />
</div>
<div className=' text-sm flex w-full justify-start'> <div className=' text-sm flex w-full justify-start'>
<div className="shrink-0 w-6 h-6 m-2 bg-cover bg-no-repeat bg-[url('~@/app/components/runOnce/text-generation/result/ai.svg')]" />
<div className='bg-background-section-burn py-2 my-2 rounded-lg p-2 max-w-[80%] ' > <div className='bg-background-section-burn py-2 my-2 rounded-lg p-2 max-w-[80%] ' >
{t('run.aiAnalysis')} {t('run.aiAnalysis')}
</div></div> </div>
</div>
<TracingPanel <TracingPanel
className='bg-background-section-burn' className='bg-background-section-burn mx-10'
list={workflowProcessData?.tracing || []} list={workflowProcessData?.tracing || []}
isForRun={true} isForRun={true}
/> />

Loading…
Cancel
Save