Skip to content

A local-first personal finance app

Fix schedule searchbar (#1729)

Shaan Khoslaabd2d424a602
diff --git a/packages/desktop-client/e2e/schedules.test.js b/packages/desktop-client/e2e/schedules.test.js
index 16b0ca222b..5935840465 100644
--- a/packages/desktop-client/e2e/schedules.test.js
+++ b/packages/desktop-client/e2e/schedules.test.js
@@ -78,5 +78,15 @@ test.describe('Schedules', () => {
'Show completed schedules',
);
await expect(page).toHaveScreenshot(screenshotConfig(page));
+
+ // Schedules search shouldn't shrink with many schedules
+ for (let i = 0; i < 15; i++) {
+ await schedulesPage.addNewSchedule({
+ payee: 'Home Depot',
+ account: 'HSBC',
+ amount: 0,
+ });
+ }
+ await expect(page).toHaveScreenshot(screenshotConfig(page));
});
});
diff --git a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-checks-the-page-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-checks-the-page-visuals-1-chromium-linux.png
index 3964156531..8c164597f0 100644
Binary files a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-checks-the-page-visuals-1-chromium-linux.png and b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-checks-the-page-visuals-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-1-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-1-chromium-linux.png
index 42ed28b1b7..62dd961669 100644
Binary files a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-1-chromium-linux.png and b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-2-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-2-chromium-linux.png
index c061ae744b..00d49fff88 100644
Binary files a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-2-chromium-linux.png and b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-3-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-3-chromium-linux.png
index 7aa1665337..ec25977ca3 100644
Binary files a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-3-chromium-linux.png and b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-4-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-4-chromium-linux.png
new file mode 100644
index 0000000000..6d48f2320f
Binary files /dev/null and b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-4-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-split-test-transaction-1-chromium-linux.png b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-split-test-transaction-1-chromium-linux.png
index a82cb3c9d4..be618d9e5a 100644
Binary files a/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-split-test-transaction-1-chromium-linux.png and b/packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-split-test-transaction-1-chromium-linux.png differ
diff --git a/packages/desktop-client/src/components/schedules/index.tsx b/packages/desktop-client/src/components/schedules/index.tsx
index 02f0be80e0..a4fb235e77 100644
--- a/packages/desktop-client/src/components/schedules/index.tsx
+++ b/packages/desktop-client/src/components/schedules/index.tsx
@@ -11,11 +11,7 @@ import Search from '../common/Search';
import View from '../common/View';
import { Page } from '../Page';
-import {
- SchedulesTable,
- ROW_HEIGHT,
- type ScheduleItemAction,
-} from './SchedulesTable';
+import { SchedulesTable, type ScheduleItemAction } from './SchedulesTable';
export default function Schedules() {
const { pushModal } = useActions();
@@ -69,31 +65,38 @@ export default function Schedules() {
return (
<Page title="Schedules">
- <View style={{ alignItems: 'flex-end' }}>
- <Search
- placeholder="Filter schedules…"
- value={filter}
- onChange={setFilter}
- />
- </View>
-
<View
style={{
- flexBasis: (ROW_HEIGHT - 1) * (Math.max(schedules.length, 1) + 1),
- marginTop: 15,
+ flexDirection: 'row',
+ alignItems: 'center',
+ padding: '0 0 15px',
}}
>
- <SchedulesTable
- schedules={schedules}
- filter={filter}
- statuses={statuses}
- allowCompleted={true}
- onSelect={onEdit}
- onAction={onAction}
- style={{ backgroundColor: theme.tableBackground }}
- />
+ <View
+ style={{
+ flex: 1,
+ flexDirection: 'row',
+ justifyContent: 'flex-end',
+ }}
+ >
+ <Search
+ placeholder="Filter schedules…"
+ value={filter}
+ onChange={setFilter}
+ />
+ </View>
</View>
+ <SchedulesTable
+ schedules={schedules}
+ filter={filter}
+ statuses={statuses}
+ allowCompleted={true}
+ onSelect={onEdit}
+ onAction={onAction}
+ style={{ backgroundColor: theme.tableBackground }}
+ />
+
<View
style={{
flexDirection: 'row',
diff --git a/upcoming-release-notes/1729.md b/upcoming-release-notes/1729.md
new file mode 100644
index 0000000000..bb086e559e
--- /dev/null
+++ b/upcoming-release-notes/1729.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [shaankhosla]
+---
+
+Fix bug that makes the schedule search bar shrink when there's many schedules.