Skip to content

A local-first personal finance app

[AI] Show schedule name in mobile notes in upcoming schedules (#8609)

youngcw4e5c0d5f87f1
diff --git a/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-1-chromium-linux.png b/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-1-chromium-linux.png
index 6d1e414763..ac1ed90da6 100644
Binary files a/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-1-chromium-linux.png and b/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-2-chromium-linux.png b/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-2-chromium-linux.png
index 3ce14e202e..5f52450ded 100644
Binary files a/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-2-chromium-linux.png and b/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-3-chromium-linux.png b/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-3-chromium-linux.png
index 124da3c86b..159e3961df 100644
Binary files a/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-3-chromium-linux.png and b/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-individual-account-page-and-checks-that-filtering-is-working-3-chromium-linux.png differ
diff --git a/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx b/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx
index 9f9d81fa22..43caf7dd6b 100644
--- a/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx
+++ b/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx
@@ -95,6 +95,7 @@ export function TransactionListItem({
const account = useAccount(transaction?.account || '');
const transferAccount = useAccount(payee?.transfer_acct || '');
const isPreview = isPreviewId(transaction?.id || '');
+ const { schedules = [] } = useCachedSchedules();
const newTransactions = useSelector(
state => state.transactions.newTransactions,
@@ -131,8 +132,14 @@ export function TransactionListItem({
is_child: isChild,
notes,
forceUpcoming,
+ schedule: scheduleId,
} = transaction;
+ const schedule = scheduleId
+ ? schedules.find(s => s.id === scheduleId)
+ : undefined;
+ const displayedNotes = notes || (isPreview ? schedule?.name : undefined);
+
const previewStatus = forceUpcoming ? 'upcoming' : categoryId;
const isAdded = newTransactions.includes(id);
@@ -285,7 +292,7 @@ export function TransactionListItem({
</TextOneLine>
</View>
)}
- {notes && (
+ {displayedNotes && (
<TextOneLine
style={{
fontSize: 11,
@@ -296,7 +303,7 @@ export function TransactionListItem({
opacity: 0.85,
}}
>
- <NotesTagFormatter notes={notes} />
+ <NotesTagFormatter notes={displayedNotes} />
</TextOneLine>
)}
</View>
diff --git a/upcoming-release-notes/fix-mobile-schedule-notes-fallback.md b/upcoming-release-notes/fix-mobile-schedule-notes-fallback.md
new file mode 100644
index 0000000000..a480df328a
--- /dev/null
+++ b/upcoming-release-notes/fix-mobile-schedule-notes-fallback.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [youngcw]
+---
+
+Show the schedule name in place of notes for upcoming scheduled transactions with no notes on mobile