Skip to content

Commit 4d7da43

Browse files
WTW0313chinnsenn
authored and
chinnsenn
committed
fix: add collapse icon for fullscreen toggle in segment detail compon… (langgenius#14530)
1 parent 77f92d6 commit 4d7da43

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

web/app/components/datasets/documents/detail/completed/child-segment-detail.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { type FC, useMemo, useState } from 'react'
22
import { useTranslation } from 'react-i18next'
33
import {
44
RiCloseLine,
5+
RiCollapseDiagonalLine,
56
RiExpandDiagonalLine,
67
} from '@remixicon/react'
78
import ActionButtons from './common/action-buttons'
@@ -99,7 +100,7 @@ const ChildSegmentDetail: FC<IChildSegmentDetailProps> = ({
99100
</>
100101
)}
101102
<div className='w-8 h-8 flex justify-center items-center p-1.5 cursor-pointer mr-1' onClick={toggleFullScreen}>
102-
<RiExpandDiagonalLine className='w-4 h-4 text-text-tertiary' />
103+
{fullScreen ? <RiCollapseDiagonalLine className='w-4 h-4 text-text-tertiary' /> : <RiExpandDiagonalLine className='w-4 h-4 text-text-tertiary' />}
103104
</div>
104105
<div className='w-8 h-8 flex justify-center items-center p-1.5 cursor-pointer' onClick={onCancel}>
105106
<RiCloseLine className='w-4 h-4 text-text-tertiary' />

web/app/components/datasets/documents/detail/completed/segment-detail.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { type FC, useMemo, useState } from 'react'
22
import { useTranslation } from 'react-i18next'
33
import {
44
RiCloseLine,
5+
RiCollapseDiagonalLine,
56
RiExpandDiagonalLine,
67
} from '@remixicon/react'
78
import { useDocumentContext } from '../index'
@@ -37,7 +38,7 @@ const SegmentDetail: FC<ISegmentDetailProps> = ({
3738
docForm,
3839
}) => {
3940
const { t } = useTranslation()
40-
const [question, setQuestion] = useState(segInfo?.content || '')
41+
const [question, setQuestion] = useState(isEditMode ? segInfo?.content || '' : segInfo?.sign_content || '')
4142
const [answer, setAnswer] = useState(segInfo?.answer || '')
4243
const [keywords, setKeywords] = useState<string[]>(segInfo?.keywords || [])
4344
const { eventEmitter } = useEventEmitterContextContext()
@@ -129,7 +130,7 @@ const SegmentDetail: FC<ISegmentDetailProps> = ({
129130
</>
130131
)}
131132
<div className='w-8 h-8 flex justify-center items-center p-1.5 cursor-pointer mr-1' onClick={toggleFullScreen}>
132-
<RiExpandDiagonalLine className='w-4 h-4 text-text-tertiary' />
133+
{fullScreen ? <RiCollapseDiagonalLine className='w-4 h-4 text-text-tertiary' /> : <RiExpandDiagonalLine className='w-4 h-4 text-text-tertiary' />}
133134
</div>
134135
<div className='w-8 h-8 flex justify-center items-center p-1.5 cursor-pointer' onClick={onCancel}>
135136
<RiCloseLine className='w-4 h-4 text-text-tertiary' />

0 commit comments

Comments
 (0)