fix(webui): remove Mermaid preparation status text (#6380)
* fix(webui): remove Mermaid preparation status text * fix(webui): remove remaining Mermaid preparation copy and locales
This commit is contained in:
1 parent
67fc220c8a
commit
df63526ddf
13 files changed
+2
-14
No files matched your search
@@ -17,9 +17,7 @@ export function MarkdownCodeBlock({ code, language }: { code: string; language?:
|
||||
const { streaming, highlight } = useContext(MarkdownCodeContext);
|
||||
const source = <CodeBlock language={language || "text"} code={code} className="my-3" highlight={highlight} showLineNumbers={code.includes("\n")} />;
|
||||
if (language?.toLowerCase() !== "mermaid") return source;
|
||||
const preparing = <div aria-busy={streaming}>
|
||||
<p className="my-1 text-xs text-muted-foreground" role="status">{t("diagram.preparing")}</p>{source}
|
||||
</div>;
|
||||
const preparing = <div aria-busy={streaming}>{source}</div>;
|
||||
if (streaming) return preparing;
|
||||
return <DiagramBoundary key={code} fallback={<><p className="text-xs text-muted-foreground" role="status">{t("diagram.errors.load")}</p>{source}</>}>
|
||||
<Suspense fallback={preparing}><MermaidBlock source={code} /></Suspense>
|
||||
|
||||
@@ -141,7 +141,6 @@ export default function MermaidBlock({ source }: { source: string }) {
|
||||
{showSource ? <CodeBlock language="mermaid" code={source} chrome="none" highlight={false} showLineNumbers={source.includes("\n")} />
|
||||
: image ? <div className="flex justify-center p-3"><img src={image.url} alt={image.label || t("diagram.title")} width={image.width} height={image.height} className="max-h-[28rem] max-w-full object-contain" /></div>
|
||||
: <div className="px-3 py-2" style={{ minHeight: height.current || undefined }}>
|
||||
<p className="m-0 py-1 text-xs text-muted-foreground" role="status">{t("diagram.preparing")}</p>
|
||||
{!height.current && <CodeBlock language="mermaid" code={source} chrome="none" highlight={false} />}
|
||||
</div>}
|
||||
</div>;
|
||||
|
||||
@@ -2561,7 +2561,6 @@
|
||||
"copy": "Copy source",
|
||||
"enlarge": "Enlarge diagram",
|
||||
"title": "Mermaid diagram",
|
||||
"preparing": "Preparing diagram…",
|
||||
"errors": {
|
||||
"syntax": "Check the diagram syntax in the source.",
|
||||
"unsupported": "This diagram type is not supported. View the source.",
|
||||
|
||||
@@ -2362,7 +2362,6 @@
|
||||
"copy": "Copiar código fuente",
|
||||
"enlarge": "Ampliar diagrama",
|
||||
"title": "Diagrama Mermaid",
|
||||
"preparing": "Preparando diagrama…",
|
||||
"errors": {
|
||||
"syntax": "Comprueba la sintaxis del diagrama en el código fuente.",
|
||||
"unsupported": "Este tipo de diagrama no es compatible. Consulta el código fuente.",
|
||||
|
||||
@@ -2361,7 +2361,6 @@
|
||||
"copy": "Copier la source",
|
||||
"enlarge": "Agrandir le diagramme",
|
||||
"title": "Diagramme Mermaid",
|
||||
"preparing": "Préparation du diagramme…",
|
||||
"errors": {
|
||||
"syntax": "Vérifiez la syntaxe du diagramme dans la source.",
|
||||
"unsupported": "Ce type de diagramme n'est pas pris en charge. Consultez la source.",
|
||||
|
||||
@@ -2361,7 +2361,6 @@
|
||||
"copy": "Salin sumber",
|
||||
"enlarge": "Perbesar diagram",
|
||||
"title": "Diagram Mermaid",
|
||||
"preparing": "Menyiapkan diagram…",
|
||||
"errors": {
|
||||
"syntax": "Periksa sintaks diagram pada sumber.",
|
||||
"unsupported": "Jenis diagram ini belum didukung. Lihat sumber.",
|
||||
|
||||
@@ -2361,7 +2361,6 @@
|
||||
"copy": "ソースをコピー",
|
||||
"enlarge": "図を拡大",
|
||||
"title": "Mermaid 図",
|
||||
"preparing": "図を準備中…",
|
||||
"errors": {
|
||||
"syntax": "ソースの図の構文を確認してください。",
|
||||
"unsupported": "この図の種類には対応していません。ソースを確認してください。",
|
||||
|
||||
@@ -2361,7 +2361,6 @@
|
||||
"copy": "소스 복사",
|
||||
"enlarge": "다이어그램 확대",
|
||||
"title": "Mermaid 다이어그램",
|
||||
"preparing": "다이어그램 준비 중…",
|
||||
"errors": {
|
||||
"syntax": "소스의 다이어그램 문법을 확인하세요.",
|
||||
"unsupported": "지원하지 않는 다이어그램 유형입니다. 소스를 확인하세요.",
|
||||
|
||||
@@ -2375,7 +2375,6 @@
|
||||
"copy": "Copiar código-fonte",
|
||||
"enlarge": "Ampliar diagrama",
|
||||
"title": "Diagrama Mermaid",
|
||||
"preparing": "Preparando diagrama…",
|
||||
"errors": {
|
||||
"syntax": "Confira a sintaxe do diagrama no código-fonte.",
|
||||
"unsupported": "Este tipo de diagrama não é compatível. Consulte o código-fonte.",
|
||||
|
||||
@@ -2361,7 +2361,6 @@
|
||||
"copy": "Sao chép mã nguồn",
|
||||
"enlarge": "Phóng to sơ đồ",
|
||||
"title": "Sơ đồ Mermaid",
|
||||
"preparing": "Đang chuẩn bị sơ đồ…",
|
||||
"errors": {
|
||||
"syntax": "Hãy kiểm tra cú pháp sơ đồ trong mã nguồn.",
|
||||
"unsupported": "Chưa hỗ trợ loại sơ đồ này. Hãy xem mã nguồn.",
|
||||
|
||||
@@ -2561,7 +2561,6 @@
|
||||
"copy": "复制源码",
|
||||
"enlarge": "放大查看",
|
||||
"title": "Mermaid 图表",
|
||||
"preparing": "正在准备图表…",
|
||||
"errors": {
|
||||
"syntax": "图表语法有误,请检查源码。",
|
||||
"unsupported": "暂不支持此类图表,可查看源码。",
|
||||
|
||||
@@ -2361,7 +2361,6 @@
|
||||
"copy": "複製原始碼",
|
||||
"enlarge": "放大檢視",
|
||||
"title": "Mermaid 圖表",
|
||||
"preparing": "正在準備圖表…",
|
||||
"errors": {
|
||||
"syntax": "圖表語法有誤,請檢查原始碼。",
|
||||
"unsupported": "尚不支援此類圖表,可檢視原始碼。",
|
||||
|
||||
@@ -43,6 +43,7 @@ describe("Mermaid message fences", () => {
|
||||
const tree = view.container.querySelector(".markdown-content");
|
||||
expect(runtime.request).not.toHaveBeenCalled();
|
||||
expect(view.container).toHaveTextContent("开始 --> 完成");
|
||||
expect(screen.queryByRole("status")).not.toBeInTheDocument();
|
||||
view.rerender(<MessageBubble message={{ ...message, isStreaming: false }} />);
|
||||
await waitFor(() => expect(jobs).toHaveLength(1));
|
||||
expect(jobs[0].input.source).toBe(code);
|
||||
|
||||
Reference in new issue
Block a user