Skip to content

A local-first personal finance app

[AI] Fix Balance Forecast chart colors with custom themes (#8031)

Sebastián Malukb80128094f96
diff --git a/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-balance-forecast-report-with-monthly-granularity-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-balance-forecast-report-with-monthly-granularity-1-chromium-linux.png
index 78cc60ee3e..dcfed8eabd 100644
Binary files a/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-balance-forecast-report-with-monthly-granularity-1-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-balance-forecast-report-with-monthly-granularity-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-balance-forecast-report-with-monthly-granularity-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-balance-forecast-report-with-monthly-granularity-2-chromium-linux.png
index 59b86aca24..98690d8c84 100644
Binary files a/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-balance-forecast-report-with-monthly-granularity-2-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-balance-forecast-report-with-monthly-granularity-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-balance-forecast-report-with-monthly-granularity-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-balance-forecast-report-with-monthly-granularity-3-chromium-linux.png
index 3ff7a9e549..28bd85fc5e 100644
Binary files a/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-balance-forecast-report-with-monthly-granularity-3-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-balance-forecast-report-with-monthly-granularity-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-switches-to-daily-granularity-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-switches-to-daily-granularity-1-chromium-linux.png
index fd93794070..80664bf460 100644
Binary files a/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-switches-to-daily-granularity-1-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-switches-to-daily-granularity-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-switches-to-daily-granularity-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-switches-to-daily-granularity-2-chromium-linux.png
index 9860d5fdef..3b640bd0f2 100644
Binary files a/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-switches-to-daily-granularity-2-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-switches-to-daily-granularity-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-switches-to-daily-granularity-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-switches-to-daily-granularity-3-chromium-linux.png
index a855a8d64a..0666df3bcc 100644
Binary files a/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-switches-to-daily-granularity-3-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-switches-to-daily-granularity-3-chromium-linux.png differ
diff --git a/packages/desktop-client/src/components/reports/reports/BalanceForecast.tsx b/packages/desktop-client/src/components/reports/reports/BalanceForecast.tsx
index 8c166af09e..578b5becb1 100644
--- a/packages/desktop-client/src/components/reports/reports/BalanceForecast.tsx
+++ b/packages/desktop-client/src/components/reports/reports/BalanceForecast.tsx
@@ -413,19 +413,19 @@ function BalanceForecastInner({ widget }: BalanceForecastInnerProps) {
offset="0%"
stopColor={
hasNegativeBalance
- ? theme.errorText
- : theme.noticeText
+ ? theme.reportsNumberNegative
+ : theme.reportsChartFill
}
/>
) : (
<>
<stop
offset={`${zeroCrossingGradientOffset}%`}
- stopColor={theme.noticeText}
+ stopColor={theme.reportsChartFill}
/>
<stop
offset={`${zeroCrossingGradientOffset}%`}
- stopColor={theme.errorText}
+ stopColor={theme.reportsNumberNegative}
/>
</>
)}
@@ -497,11 +497,11 @@ function BalanceForecastInner({ widget }: BalanceForecastInnerProps) {
{showsTodayReferenceLine && (
<ReferenceLine
x={todayReferenceDate}
- stroke={theme.noticeText}
+ stroke={theme.reportsBlue}
strokeDasharray="4 4"
label={{
value: t('Today'),
- fill: theme.noticeText,
+ fill: theme.reportsBlue,
fontSize: 12,
position: 'insideTop',
offset: 8,
diff --git a/packages/desktop-client/src/components/reports/reports/BalanceForecastCard.tsx b/packages/desktop-client/src/components/reports/reports/BalanceForecastCard.tsx
index 1e41fa1ab3..93ecf646d3 100644
--- a/packages/desktop-client/src/components/reports/reports/BalanceForecastCard.tsx
+++ b/packages/desktop-client/src/components/reports/reports/BalanceForecastCard.tsx
@@ -268,19 +268,19 @@ export function BalanceForecastCard({
offset="0%"
stopColor={
hasNegativeBalance
- ? theme.errorText
- : theme.noticeText
+ ? theme.reportsNumberNegative
+ : theme.reportsChartFill
}
/>
) : (
<>
<stop
offset={`${zeroCrossingGradientOffset}%`}
- stopColor={theme.noticeText}
+ stopColor={theme.reportsChartFill}
/>
<stop
offset={`${zeroCrossingGradientOffset}%`}
- stopColor={theme.errorText}
+ stopColor={theme.reportsNumberNegative}
/>
</>
)}
@@ -320,7 +320,7 @@ export function BalanceForecastCard({
{showsTodayReferenceLine && (
<ReferenceLine
x={todayReferenceDate}
- stroke={theme.noticeText}
+ stroke={theme.reportsBlue}
strokeDasharray="4 4"
/>
)}
diff --git a/upcoming-release-notes/8031.md b/upcoming-release-notes/8031.md
new file mode 100644
index 0000000000..0cbeb0cd2f
--- /dev/null
+++ b/upcoming-release-notes/8031.md
@@ -0,0 +1,6 @@
+---
+category: Bugfixes
+authors: [samaluk]
+---
+
+Fix Balance Forecast chart line colors with custom themes by using report color tokens instead of notice/error text colors.