From 449267e124598dcac9860897399ea015b3e0e476 Mon Sep 17 00:00:00 2001
From: pascalpace23 <110259136+pascalpace23@users.noreply.github.com>
Date: Sat, 1 Nov 2025 05:04:14 +0100
Subject: [PATCH 01/19] Update sidebar.tsx
---
app/components/sidebar.tsx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/components/sidebar.tsx b/app/components/sidebar.tsx
index 56bc5bb4327..b8c434ec92b 100644
--- a/app/components/sidebar.tsx
+++ b/app/components/sidebar.tsx
@@ -250,9 +250,9 @@ export function SideBar(props: { className?: string }) {
{...props}
>
-- -{this.state.error?.toString()}-{this.state.info?.componentStack}-
{mdText}
-
- {
- if (ref.current) {
- copyToClipboard(
- ref.current.querySelector("code")?.innerText ?? "",
- );
- }
- }}
- >
- {props.children}
-
- {mermaidCode.length > 0 && (
-
- {props.children}
-
-
- {renderShowMoreButton()}
- >
- );
-}
-
-function escapeBrackets(text: string) {
- const pattern =
- /(```[\s\S]*?```|`.*?`)|\\\[([\s\S]*?[^\\])\\\]|\\\((.*?)\\\)/g;
- return text.replace(
- pattern,
- (match, codeBlock, squareBracket, roundBracket) => {
- if (codeBlock) {
- return codeBlock;
- } else if (squareBracket) {
- return `$$${squareBracket}$$`;
- } else if (roundBracket) {
- return `$${roundBracket}$`;
- }
- return match;
- },
- );
-}
-
-function tryWrapHtmlCode(text: string) {
- // try add wrap html code (fixed: html codeblock include 2 newline)
- // ignore embed codeblock
- if (text.includes("```")) {
- return text;
- }
- return text
- .replace(
- /([`]*?)(\w*?)([\n\r]*?)()/g,
- (match, quoteStart, lang, newLine, doctype) => {
- return !quoteStart ? "\n```html\n" + doctype : match;
- },
- )
- .replace(
- /(<\/body>)([\r\n\s]*?)(<\/html>)([\n\r]*)([`]*)([\n\r]*?)/g,
- (match, bodyEnd, space, htmlEnd, newLine, quoteEnd) => {
- return !quoteEnd ? bodyEnd + space + htmlEnd + "\n```\n" : match;
- },
- );
-}
-
-function _MarkDownContent(props: { content: string }) {
- const escapedContent = useMemo(() => {
- return tryWrapHtmlCode(escapeBrackets(props.content));
- }, [props.content]);
-
- return (
-
-
-
-
-
- {Locale.Sd.Status.Name}: {s}
-
- {item.status === "error" && (
- {
- showModal({
- title: Locale.Sd.Detail,
- children: (
-
- {Locale.SdPanel.Prompt}:{" "}
- {
- showModal({
- title: Locale.Sd.Detail,
- children: (
-
- {Locale.SdPanel.AIModel}: {item.model_name} -
- {getSdTaskStatus(item)} -{item.created_at}
-