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>;
|
||||
|
||||
Reference in new issue
Block a user