Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Render Patrol investigation replies as Markdown

rcourtman8ca8256175a4
diff --git a/frontend-modern/src/components/patrol/InvestigationMessages.tsx b/frontend-modern/src/components/patrol/InvestigationMessages.tsx
index 2252dcbcda..8305b9dc92 100644
--- a/frontend-modern/src/components/patrol/InvestigationMessages.tsx
+++ b/frontend-modern/src/components/patrol/InvestigationMessages.tsx
@@ -9,6 +9,12 @@ import { Component, createResource, Show, For } from 'solid-js';
import { getInvestigationMessages, formatTimestamp, type ChatMessage } from '@/api/patrol';
import { LoadingSpinner } from '@/components/shared/LoadingSpinner';
import { getInvestigationMessagesState } from '@/utils/patrolEmptyStatePresentation';
+import { renderMarkdown } from '@/components/AI/aiChatUtils';
+
+// Compact variant of the Assistant chat's markdown styling, scaled for the
+// investigation thread's text-xs bubbles.
+const investigationMarkdownClass =
+ 'text-xs prose prose-slate prose-sm dark:prose-invert max-w-none break-words prose-p:leading-relaxed prose-p:my-1.5 prose-pre:bg-slate-900 prose-pre:text-slate-100 prose-pre:rounded-md prose-pre:text-[10px] prose-pre:border prose-pre:border-slate-800 prose-code:text-blue-700 dark:prose-code:text-blue-300 prose-code:bg-blue-50 dark:prose-code:bg-blue-900 prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:font-mono prose-code:text-[0.9em] prose-code:before:content-none prose-code:after:content-none prose-headings:font-semibold prose-headings:my-2 prose-ul:my-1.5 prose-ol:my-1.5 prose-li:my-0.5';
interface InvestigationMessagesProps {
findingId: string;
@@ -76,9 +82,22 @@ export const InvestigationMessages: Component<InvestigationMessagesProps> = (pro
</details>
</Show>
- {/* Text content */}
+ {/* Text content: assistant turns carry markdown (same model
+ output as the Assistant chat); render it through the
+ shared sanitizing renderer instead of raw text. */}
<Show when={msg.content}>
- <div class="text-xs whitespace-pre-wrap break-words">{msg.content}</div>
+ <Show
+ when={msg.role === 'assistant'}
+ fallback={
+ <div class="text-xs whitespace-pre-wrap break-words">{msg.content}</div>
+ }
+ >
+ <div
+ class={investigationMarkdownClass}
+ // eslint-disable-next-line solid/no-innerhtml
+ innerHTML={renderMarkdown(msg.content)}
+ />
+ </Show>
</Show>
{/* Tool calls (assistant requesting tool use) */}