From a949490f29a2476da49d781ff2625384c0a5897d Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Tue, 24 Mar 2026 21:27:19 +0100 Subject: [PATCH] fix(coding-agent): respect export theme backgrounds closes #2565 --- packages/coding-agent/CHANGELOG.md | 1 + packages/coding-agent/src/core/export-html/index.ts | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 508800dd..c91aa45b 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -4,6 +4,7 @@ ### Fixed +- Fixed `/export` HTML backgrounds to honor `theme.export.pageBg`, `cardBg`, and `infoBg` instead of always deriving them from `userMessageBg` ([#2565](https://github.com/badlogic/pi-mono/issues/2565)) - Fixed interactive bash execution collapsed previews to recompute visual line wrapping at render time, so previews respect the current terminal width after resizes and split-pane width changes ([#2569](https://github.com/badlogic/pi-mono/issues/2569)) - Fixed RPC `get_session_stats` to expose `contextUsage`, so headless clients can read actual current context-window usage instead of deriving it from token totals ([#2550](https://github.com/badlogic/pi-mono/issues/2550)) - Fixed `pi update` for git packages to fetch only the tracked target branch with `--no-tags`, reducing unrelated branch and tag noise while preserving force-push-safe updates ([#2548](https://github.com/badlogic/pi-mono/issues/2548)) diff --git a/packages/coding-agent/src/core/export-html/index.ts b/packages/coding-agent/src/core/export-html/index.ts index 94af061b..c7b86e60 100644 --- a/packages/coding-agent/src/core/export-html/index.ts +++ b/packages/coding-agent/src/core/export-html/index.ts @@ -149,10 +149,11 @@ function generateHtml(sessionData: SessionData, themeName?: string): string { const themeVars = generateThemeVars(themeName); const colors = getResolvedThemeColors(themeName); - const exportColors = deriveExportColors(colors.userMessageBg || "#343541"); - const bodyBg = exportColors.pageBg; - const containerBg = exportColors.cardBg; - const infoBg = exportColors.infoBg; + const themeExport = getThemeExportColors(themeName); + const derivedExportColors = deriveExportColors(colors.userMessageBg || "#343541"); + const bodyBg = themeExport.pageBg ?? derivedExportColors.pageBg; + const containerBg = themeExport.cardBg ?? derivedExportColors.cardBg; + const infoBg = themeExport.infoBg ?? derivedExportColors.infoBg; // Base64 encode session data to avoid escaping issues const sessionDataBase64 = Buffer.from(JSON.stringify(sessionData)).toString("base64");