From 4da2bd7b32af692a4408a3d80904b9bb95ae17b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Po=C5=99=C3=ADzek?=
<33246262+Rhiz3K@users.noreply.github.com>
Date: Thu, 22 Oct 2026 16:27:03 +0200
Subject: [PATCH 1/3] fix: render markdown in the Thinking block
---
src/frontend/AiThinking.tsx | 13 ++++++--
tests/frontend/AiThinking.test.tsx | 53 ++++++++++++++++++++++++++++++
2 files changed, 64 insertions(+), 2 deletions(-)
create mode 100644 tests/frontend/AiThinking.test.tsx
diff --git a/src/frontend/AiThinking.tsx b/src/frontend/AiThinking.tsx
index cc6a164..cca42f0 100644
--- a/src/frontend/AiThinking.tsx
+++ b/src/frontend/AiThinking.tsx
@@ -1,6 +1,8 @@
import { useState } from "react";
import { useTranslation } from "@termix-ssh/plugin-sdk/frontend";
import { Brain, ChevronDown, ChevronRight, Loader2 } from "lucide-react";
+import ReactMarkdown from "react-markdown";
+import remarkGfm from "remark-gfm";
/**
* What the model thought before the text that follows it. Collapsed, so it
@@ -34,8 +36,15 @@ export function AiThinking({
{t(active ? "assistant.thinkingActive" : "assistant.thinking")}
{open && (
-
- {content}
+
+
+ {content}
+
)}
diff --git a/tests/frontend/AiThinking.test.tsx b/tests/frontend/AiThinking.test.tsx
new file mode 100644
index 0000000..3c13264
--- /dev/null
+++ b/tests/frontend/AiThinking.test.tsx
@@ -0,0 +1,53 @@
+import { afterEach, expect, it, vi } from "vitest";
+import { cleanup, fireEvent, render, screen } from "@testing-library/react";
+
+vi.mock("@termix-ssh/plugin-sdk/frontend", async (original) => ({
+ ...(await original