Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(chat): theme-aware markdown code block colors (readable in light mode)

Louis Beaumont5a5c919a1c98
diff --git a/apps/screenpipe-app-tauri/components/chat/markdown-block.tsx b/apps/screenpipe-app-tauri/components/chat/markdown-block.tsx
index b932869b8..08679ba1b 100644
--- a/apps/screenpipe-app-tauri/components/chat/markdown-block.tsx
+++ b/apps/screenpipe-app-tauri/components/chat/markdown-block.tsx
@@ -165,7 +165,7 @@ export function MarkdownBlock({
pre({ children, ...props }) {
return (
<pre
- className="overflow-x-auto rounded-lg bg-neutral-900 dark:bg-neutral-950 p-3 my-2 text-xs max-w-full not-prose"
+ className="overflow-x-auto rounded-lg border border-border bg-neutral-100 dark:bg-neutral-900 p-3 my-2 text-xs max-w-full not-prose"
{...props}
>
{children}
diff --git a/apps/screenpipe-app-tauri/components/ui/chat-code-block.tsx b/apps/screenpipe-app-tauri/components/ui/chat-code-block.tsx
index 61bc1ba52..886d0bdf4 100644
--- a/apps/screenpipe-app-tauri/components/ui/chat-code-block.tsx
+++ b/apps/screenpipe-app-tauri/components/ui/chat-code-block.tsx
@@ -35,11 +35,11 @@ export function ChatCodeBlock({
onClick={handleCopy}
className={cn(
"absolute right-0 top-0 z-10 inline-flex items-center gap-1 rounded-md",
- "border border-white/10 bg-neutral-900/90 px-2 py-1 text-[10px] font-mono uppercase tracking-wide",
- "!cursor-pointer text-neutral-300 shadow-sm transition-opacity [&_*]:!cursor-pointer",
+ "border border-border bg-background/90 px-2 py-1 text-[10px] font-mono uppercase tracking-wide",
+ "!cursor-pointer text-muted-foreground shadow-sm transition-opacity [&_*]:!cursor-pointer",
"pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100",
"group-focus-within:pointer-events-auto group-focus-within:opacity-100",
- "hover:text-white focus-visible:pointer-events-auto focus-visible:opacity-100"
+ "hover:text-foreground focus-visible:pointer-events-auto focus-visible:opacity-100"
)}
aria-label={copied ? "Copied code" : "Copy code"}
title={copied ? "Copied" : "Copy"}
@@ -49,7 +49,7 @@ export function ChatCodeBlock({
</button>
<code
- className="font-mono text-xs block whitespace-pre-wrap break-all text-neutral-200"
+ className="font-mono text-xs block whitespace-pre-wrap break-all text-neutral-800 dark:text-neutral-200"
data-language={language || undefined}
>
{value}