diff --git a/.github/workflows/unused-packages.yml b/.github/workflows/unused-packages.yml index 442e70e52c..dc6ce3ba56 100644 --- a/.github/workflows/unused-packages.yml +++ b/.github/workflows/unused-packages.yml @@ -98,6 +98,8 @@ jobs: cd client UNUSED=$(depcheck --json | jq -r '.dependencies | join("\n")' || echo "") UNUSED=$(comm -23 <(echo "$UNUSED" | sort) <(cat ../client_used_deps.txt ../client_used_code.txt | sort) || echo "") + # Filter out false positives + UNUSED=$(echo "$UNUSED" | grep -v "^micromark-extension-llm-math$" || echo "") echo "CLIENT_UNUSED<> $GITHUB_ENV echo "$UNUSED" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV diff --git a/client/package.json b/client/package.json index 5218ebdc6b..67cbec2820 100644 --- a/client/package.json +++ b/client/package.json @@ -75,6 +75,7 @@ "lodash": "^4.17.21", "lucide-react": "^0.394.0", "match-sorter": "^6.3.4", + "micromark-extension-llm-math": "^3.1.0", "qrcode.react": "^4.2.0", "rc-input-number": "^7.4.2", "react": "^18.2.0", diff --git a/client/src/components/Artifacts/Artifact.tsx b/client/src/components/Artifacts/Artifact.tsx index 2b06a2ccc0..902ac9191a 100644 --- a/client/src/components/Artifacts/Artifact.tsx +++ b/client/src/components/Artifacts/Artifact.tsx @@ -40,7 +40,7 @@ const defaultType = 'unknown'; const defaultIdentifier = 'lc-no-identifier'; export function Artifact({ - node, + node: _node, ...props }: Artifact & { children: React.ReactNode | { props: { children: React.ReactNode } }; @@ -95,7 +95,7 @@ export function Artifact({ setArtifacts((prevArtifacts) => { if ( prevArtifacts?.[artifactKey] != null && - prevArtifacts[artifactKey].content === content + prevArtifacts[artifactKey]?.content === content ) { return prevArtifacts; } diff --git a/client/src/components/Chat/Messages/Content/Markdown.tsx b/client/src/components/Chat/Messages/Content/Markdown.tsx index 740bf66670..7bd6511cfa 100644 --- a/client/src/components/Chat/Messages/Content/Markdown.tsx +++ b/client/src/components/Chat/Messages/Content/Markdown.tsx @@ -204,7 +204,7 @@ const Markdown = memo(({ content = '', isLatestMessage }: TContentProps) => { remarkGfm, remarkDirective, artifactPlugin, - [remarkMath, { singleDollarTextMath: true }], + [remarkMath, { singleDollarTextMath: false }], unicodeCitation, ]; diff --git a/client/src/components/Chat/Messages/Content/MarkdownLite.tsx b/client/src/components/Chat/Messages/Content/MarkdownLite.tsx index 972395c425..019783607c 100644 --- a/client/src/components/Chat/Messages/Content/MarkdownLite.tsx +++ b/client/src/components/Chat/Messages/Content/MarkdownLite.tsx @@ -32,7 +32,7 @@ const MarkdownLite = memo( /** @ts-ignore */ supersub, remarkGfm, - [remarkMath, { singleDollarTextMath: true }], + [remarkMath, { singleDollarTextMath: false }], ]} /** @ts-ignore */ rehypePlugins={rehypePlugins} diff --git a/client/src/components/Chat/Messages/Content/Parts/EditTextPart.tsx b/client/src/components/Chat/Messages/Content/Parts/EditTextPart.tsx index e6736b192e..1ce207fe1c 100644 --- a/client/src/components/Chat/Messages/Content/Parts/EditTextPart.tsx +++ b/client/src/components/Chat/Messages/Content/Parts/EditTextPart.tsx @@ -117,9 +117,9 @@ const EditTextPart = ({ messages.map((msg) => msg.messageId === messageId ? { - ...msg, - content: updatedContent, - } + ...msg, + content: updatedContent, + } : msg, ), ); diff --git a/client/src/components/Chat/Messages/HoverButtons.tsx b/client/src/components/Chat/Messages/HoverButtons.tsx index 644852c0b4..a13266f04c 100644 --- a/client/src/components/Chat/Messages/HoverButtons.tsx +++ b/client/src/components/Chat/Messages/HoverButtons.tsx @@ -25,6 +25,7 @@ type THoverButtons = { }; type HoverButtonProps = { + id?: string; onClick: (e?: React.MouseEvent) => void; title: string; icon: React.ReactNode; @@ -67,6 +68,7 @@ const extractMessageContent = (message: TMessage): string => { const HoverButton = memo( ({ + id, onClick, title, icon, @@ -89,6 +91,7 @@ const HoverButton = memo( return (