Commit 821e1934 authored by John Wang's avatar John Wang

Merge branch 'fix/resort-sengment-in-dataset-retrieve' into deploy/dev

parents cee92d9d 1c380da1
......@@ -109,7 +109,11 @@ class DatasetRetrieverTool(BaseTool):
).all()
if segments:
for segment in segments:
index_node_id_to_position = {id: position for position, id in enumerate(index_node_ids)}
sorted_segments = sorted(segments,
key=lambda segment: index_node_id_to_position.get(segment.index_node_id,
float('inf')))
for segment in sorted_segments:
if segment.answer:
document_context_list.append(f'question:{segment.content} \nanswer:{segment.answer}')
else:
......
......@@ -193,7 +193,7 @@ const Chat: FC<IChatProps> = ({
)}
{
isShowSuggestion && (
<div className='pt-2 mb-2 '>
<div className='pt-2'>
<div className='flex items-center justify-center mb-2.5'>
<div className='grow h-[1px]'
style={{
......
.answerIcon {
position: relative;
background: url(./icons/robot.svg);
background: url(./icons/robot.svg) 100%/100%;
}
.typeingIcon {
......
......@@ -13,29 +13,6 @@
z-index: 10;
}
.fixed {
padding-top: 12px;
font-size: 12px;
line-height: 18px;
background: rgba(255, 255, 255, 0.9);
border-bottom: 0.5px solid #EAECF0;
backdrop-filter: blur(4px);
animation: fix 0.5s;
}
@keyframes fix {
from {
padding-top: 42px;
font-size: 18px;
line-height: 28px;
}
to {
padding-top: 12px;
font-size: 12px;
line-height: 18px;
}
}
.form {
@apply px-16 pb-8;
}
......@@ -416,3 +393,28 @@
color: #101828;
z-index: 10;
}
/*
* `fixed` must under `previewHeader` because of style override would not work
*/
.fixed {
padding-top: 12px;
font-size: 12px;
line-height: 18px;
background: rgba(255, 255, 255, 0.9);
border-bottom: 0.5px solid #EAECF0;
backdrop-filter: blur(4px);
animation: fix 0.5s;
}
@keyframes fix {
from {
padding-top: 42px;
font-size: 18px;
line-height: 28px;
}
to {
padding-top: 12px;
font-size: 12px;
line-height: 18px;
}
}
......@@ -95,7 +95,7 @@ const Apps: FC = () => {
onChange={setCurrCategory}
/>
<div
className='flex mt-6 flex-col overflow-auto bg-gray-100 shrink-0 grow'
className='flex mt-6 pb-6 flex-col overflow-auto bg-gray-100 shrink-0 grow'
style={{
maxHeight: 'calc(100vh - 243px)',
}}
......
......@@ -45,7 +45,7 @@ const CreateAppModal = ({
<>
<Modal
isShow={show}
onClose={onHide}
onClose={() => {}}
className={cn(s.modal, '!max-w-[480px]', 'px-8')}
>
<span className={s.close} onClick={onHide}/>
......
......@@ -27,10 +27,11 @@ const WorkplaceSelector = () => {
const { t } = useTranslation()
const { notify } = useContext(ToastContext)
const { workspaces } = useWorkspacesContext()
const currentWrokspace = workspaces.filter(item => item.current)?.[0]
const currentWorkspace = workspaces.find(v => v.current)
const handleSwitchWorkspace = async (tenant_id: string) => {
try {
if (currentWorkspace?.id === tenant_id) return
await switchWorkspace({ url: '/workspaces/switch', body: { tenant_id } })
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
location.assign(`${location.origin}`)
......@@ -51,8 +52,8 @@ const WorkplaceSelector = () => {
group hover:bg-gray-50 cursor-pointer ${open && 'bg-gray-50'} rounded-lg
`,
)}>
<div className={itemIconClassName}>{currentWrokspace?.name[0].toLocaleUpperCase()}</div>
<div className={`${itemNameClassName} truncate`}>{currentWrokspace?.name}</div>
<div className={itemIconClassName}>{currentWorkspace?.name[0].toLocaleUpperCase()}</div>
<div className={`${itemNameClassName} truncate`}>{currentWorkspace?.name}</div>
<ChevronRight className='shrink-0 w-[14px] h-[14px] text-gray-500' />
</Menu.Button>
<Transition
......
......@@ -8,11 +8,6 @@ function useCopyToClipboard(): [CopiedValue, CopyFn] {
const [copiedText, setCopiedText] = useState<CopiedValue>(null)
const copy: CopyFn = useCallback(async (text: string) => {
if (!navigator?.clipboard) {
console.warn('Clipboard not supported')
return false
}
try {
writeText(text)
setCopiedText(text)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment