mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 03:03:44 +00:00
fix(export): use active theme instead of default for HTML export (#870)
getResolvedThemeColors and getThemeExportColors now fall back to currentThemeName before getDefaultTheme(), so exports respect the user's selected theme.
This commit is contained in:
parent
236285b390
commit
a9fbfc7955
2 changed files with 3 additions and 2 deletions
|
|
@ -9,6 +9,7 @@
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fixed `write` tool not displaying errors in the UI when execution fails ([#856](https://github.com/badlogic/pi-mono/issues/856))
|
- Fixed `write` tool not displaying errors in the UI when execution fails ([#856](https://github.com/badlogic/pi-mono/issues/856))
|
||||||
|
- Fixed HTML export using default theme instead of user's active theme
|
||||||
|
|
||||||
## [0.49.2] - 2026-01-19
|
## [0.49.2] - 2026-01-19
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -790,7 +790,7 @@ function ansi256ToHex(index: number): string {
|
||||||
* Used by HTML export to generate CSS custom properties.
|
* Used by HTML export to generate CSS custom properties.
|
||||||
*/
|
*/
|
||||||
export function getResolvedThemeColors(themeName?: string): Record<string, string> {
|
export function getResolvedThemeColors(themeName?: string): Record<string, string> {
|
||||||
const name = themeName ?? getDefaultTheme();
|
const name = themeName ?? currentThemeName ?? getDefaultTheme();
|
||||||
const isLight = name === "light";
|
const isLight = name === "light";
|
||||||
const themeJson = loadThemeJson(name);
|
const themeJson = loadThemeJson(name);
|
||||||
const resolved = resolveThemeColors(themeJson.colors, themeJson.vars);
|
const resolved = resolveThemeColors(themeJson.colors, themeJson.vars);
|
||||||
|
|
@ -829,7 +829,7 @@ export function getThemeExportColors(themeName?: string): {
|
||||||
cardBg?: string;
|
cardBg?: string;
|
||||||
infoBg?: string;
|
infoBg?: string;
|
||||||
} {
|
} {
|
||||||
const name = themeName ?? getDefaultTheme();
|
const name = themeName ?? currentThemeName ?? getDefaultTheme();
|
||||||
try {
|
try {
|
||||||
const themeJson = loadThemeJson(name);
|
const themeJson = loadThemeJson(name);
|
||||||
const exportSection = themeJson.export;
|
const exportSection = themeJson.export;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue