diff --git a/web/src/pages/agents/name-form-field.tsx b/web/src/pages/agents/name-form-field.tsx
index 9789746a86..5b3260e327 100644
--- a/web/src/pages/agents/name-form-field.tsx
+++ b/web/src/pages/agents/name-form-field.tsx
@@ -17,7 +17,11 @@ export function NameFormField() {
const { t } = useTranslation();
return (
-
+
);
}
diff --git a/web/src/pages/agents/upload-agent-dialog/index.tsx b/web/src/pages/agents/upload-agent-dialog/index.tsx
index 0144ef4da0..61123bb019 100644
--- a/web/src/pages/agents/upload-agent-dialog/index.tsx
+++ b/web/src/pages/agents/upload-agent-dialog/index.tsx
@@ -26,7 +26,12 @@ export function UploadAgentDialog({
-
+
{t('common.save')}
diff --git a/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-card/index.module.less b/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-card/index.module.less
index 622e3b9e5e..fac4d99b16 100644
--- a/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-card/index.module.less
+++ b/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-card/index.module.less
@@ -21,7 +21,8 @@
}
.contentText {
- word-break: break-all !important;
+ word-break: break-word;
+ overflow-wrap: break-word;
}
.chunkCard {
diff --git a/web/src/pages/dataflow-result/components/chunk-card/index.module.less b/web/src/pages/dataflow-result/components/chunk-card/index.module.less
index aac7724af4..d6ca2ad497 100644
--- a/web/src/pages/dataflow-result/components/chunk-card/index.module.less
+++ b/web/src/pages/dataflow-result/components/chunk-card/index.module.less
@@ -19,7 +19,8 @@
}
.contentText {
- word-break: break-all !important;
+ word-break: break-word;
+ overflow-wrap: break-word;
}
.chunkCard {
diff --git a/web/src/pages/next-chats/chat/app-settings/chat-basic-settings.tsx b/web/src/pages/next-chats/chat/app-settings/chat-basic-settings.tsx
index 3f06e1818e..76212fcc72 100644
--- a/web/src/pages/next-chats/chat/app-settings/chat-basic-settings.tsx
+++ b/web/src/pages/next-chats/chat/app-settings/chat-basic-settings.tsx
@@ -16,11 +16,16 @@ import {
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
import { useTranslate } from '@/hooks/common-hooks';
+import { getDirAttribute } from '@/utils/text-direction';
import { useFormContext } from 'react-hook-form';
export default function ChatBasicSetting() {
const { t } = useTranslate('chat');
const form = useFormContext();
+ const nameValue = form.watch('name');
+ const descriptionValue = form.watch('description');
+ const emptyResponseValue = form.watch('prompt_config.empty_response');
+ const prologueValue = form.watch('prompt_config.prologue');
return (
@@ -46,7 +51,7 @@ export default function ChatBasicSetting() {
{t('assistantName')}
-
+
@@ -59,7 +64,10 @@ export default function ChatBasicSetting() {
{t('description')}
-
+
@@ -74,7 +82,10 @@ export default function ChatBasicSetting() {
{t('emptyResponse')}
-
+
@@ -89,7 +100,10 @@ export default function ChatBasicSetting() {
{t('setAnOpener')}
-
+
diff --git a/web/src/pages/next-chats/chat/app-settings/chat-prompt-engine.tsx b/web/src/pages/next-chats/chat/app-settings/chat-prompt-engine.tsx
index a7c05f7b4a..8f84f09097 100644
--- a/web/src/pages/next-chats/chat/app-settings/chat-prompt-engine.tsx
+++ b/web/src/pages/next-chats/chat/app-settings/chat-prompt-engine.tsx
@@ -15,12 +15,14 @@ import {
import { Textarea } from '@/components/ui/textarea';
import { UseKnowledgeGraphFormField } from '@/components/use-knowledge-graph-item';
import { useTranslate } from '@/hooks/common-hooks';
+import { getDirAttribute } from '@/utils/text-direction';
import { useFormContext } from 'react-hook-form';
import { DynamicVariableForm } from './dynamic-variable';
export function ChatPromptEngine() {
const { t } = useTranslate('chat');
const form = useFormContext();
+ const systemPromptValue = form.watch('prompt_config.system');
return (
@@ -36,6 +38,7 @@ export function ChatPromptEngine() {
rows={8}
placeholder={t('messagePlaceholder')}
className="overflow-y-auto"
+ dir={getDirAttribute(systemPromptValue || '')}
/>
diff --git a/web/src/pages/next-chats/chat/app-settings/dynamic-variable.tsx b/web/src/pages/next-chats/chat/app-settings/dynamic-variable.tsx
index 53a593c8a7..8dd4372c03 100644
--- a/web/src/pages/next-chats/chat/app-settings/dynamic-variable.tsx
+++ b/web/src/pages/next-chats/chat/app-settings/dynamic-variable.tsx
@@ -9,6 +9,7 @@ import {
import { BlurInput } from '@/components/ui/input';
import { Separator } from '@/components/ui/separator';
import { Switch } from '@/components/ui/switch';
+import { getDirAttribute } from '@/utils/text-direction';
import { Plus, X } from 'lucide-react';
import { useCallback } from 'react';
import { useFieldArray, useFormContext } from 'react-hook-form';
@@ -58,53 +59,58 @@ export function DynamicVariableForm() {
- {fields.map((field, index) => (
-
-
(
-
-
-
-
-
-
- )}
- />
+ {fields.map((field, index) => {
+ const typeField = `${name}.${index}.key`;
+ const keyValue = form.watch(typeField);
+ return (
+
+ (
+
+
+
+
+
+
+ )}
+ />
-
+
- (
-
-
-
-
-
-
- )}
- />
+ (
+
+
+
+
+
+
+ )}
+ />
-
-
- ))}
+
+
+ );
+ })}
diff --git a/web/src/pages/next-chats/chat/app-settings/saving-button.tsx b/web/src/pages/next-chats/chat/app-settings/saving-button.tsx
index 83cd7a6e8d..bc880f18d1 100644
--- a/web/src/pages/next-chats/chat/app-settings/saving-button.tsx
+++ b/web/src/pages/next-chats/chat/app-settings/saving-button.tsx
@@ -9,7 +9,11 @@ export function SavingButton({ loading }: SaveButtonProps) {
const { t } = useTranslation();
return (
-
+
{t('common.save')}
);
diff --git a/web/src/pages/next-search/markdown-content/index.tsx b/web/src/pages/next-search/markdown-content/index.tsx
index 118f2c2aad..fd0895a106 100644
--- a/web/src/pages/next-search/markdown-content/index.tsx
+++ b/web/src/pages/next-search/markdown-content/index.tsx
@@ -18,10 +18,13 @@ import 'katex/dist/katex.min.css'; // `rehype-katex` does not import the CSS for
import {
currentReg,
+ parseCitationIndex,
preprocessLaTeX,
replaceTextByOldReg,
replaceThinkToSection,
} from '@/utils/chat';
+import { citationMarkerReg } from '@/utils/citation-utils';
+import { getDirAttribute } from '@/utils/text-direction';
import { Button } from '@/components/ui/button';
import {
@@ -46,7 +49,7 @@ const styles = {
fileThumbnail: 'inline-block max-w-[40px]',
};
-const getChunkIndex = (match: string) => Number(match);
+const getChunkIndex = (match: string) => parseCitationIndex(match);
// TODO: The display of the table is inconsistent with the display previously placed in the MessageItem.
const MarkdownContent = ({
@@ -234,42 +237,51 @@ const MarkdownContent = ({
[getPopoverContent],
);
+ const dir = getDirAttribute(content.replace(citationMarkerReg, ''));
+
return (
-
- renderReference(children),
- code(props: any) {
- const { children, className, ...rest } = props;
- const restProps = omit(rest, 'node');
- const match = /language-(\w+)/.exec(className || '');
- return match ? (
-
- {String(children).replace(/\n$/, '')}
-
- ) : (
-
- {children}
-
- );
- },
- } as any
- }
>
- {contentWithCursor}
-
+ (
+ {children}
+ ),
+ 'custom-typography': ({ children }: { children: string }) =>
+ renderReference(children),
+ code(props: any) {
+ const { children, className, ...rest } = props;
+ const restProps = omit(rest, 'node');
+ const match = /language-(\w+)/.exec(className || '');
+ return match ? (
+
+ {String(children).replace(/\n$/, '')}
+
+ ) : (
+
+ {children}
+
+ );
+ },
+ } as any
+ }
+ >
+ {contentWithCursor}
+
+
);
};
diff --git a/web/src/pages/next-search/search-setting.tsx b/web/src/pages/next-search/search-setting.tsx
index 1608bec6f4..eb5acb6d24 100644
--- a/web/src/pages/next-search/search-setting.tsx
+++ b/web/src/pages/next-search/search-setting.tsx
@@ -586,7 +586,11 @@ const SearchSetting: React.FC