Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction Table Resize #3309

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open

Conversation

lelemm
Copy link
Contributor

@lelemm lelemm commented Aug 23, 2024

Created a transaction table resize on this PR.

check this comment #3309 (comment) for a video of it working

Copy link

netlify bot commented Aug 23, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 6ac5a5c
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/673f91e4ab964f00086cbfda
😎 Deploy Preview https://deploy-preview-3309.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

github-actions bot commented Aug 23, 2024

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
9 5.35 MB → 5.38 MB (+30.71 kB) +0.56%
Changeset
File Δ Size
node_modules/@react-aria/interactions/dist/useMove.mjs 🆕 +11.1 kB 0 B → 11.1 kB
src/components/ColumnWidthContext.jsx 🆕 +4.98 kB 0 B → 4.98 kB
src/components/Resizer.tsx 🆕 +1.6 kB 0 B → 1.6 kB
src/components/table.tsx 📈 +3.73 kB (+15.42%) 24.17 kB → 27.9 kB
src/components/transactions/TransactionsTable.jsx 📈 +7.18 kB (+10.71%) 67.1 kB → 74.28 kB
src/components/FixedSizeList.tsx 📈 +683 B (+5.70%) 11.7 kB → 12.37 kB
src/style/styles.ts 📈 +244 B (+5.24%) 4.55 kB → 4.79 kB
src/components/payees/PayeeTable.tsx 📈 +53 B (+3.54%) 1.46 kB → 1.51 kB
home/runner/work/actual/actual/packages/loot-core/src/client/constants.ts 📈 +22 B (+1.57%) 1.37 kB → 1.39 kB
src/components/accounts/Header.tsx 📈 +264 B (+1.41%) 18.34 kB → 18.6 kB
src/components/accounts/Account.tsx 📈 +605 B (+1.33%) 44.53 kB → 45.12 kB
src/components/transactions/SimpleTransactionsTable.jsx 📈 +81 B (+1.25%) 6.35 kB → 6.43 kB
src/components/modals/SelectLinkedAccountsModal.jsx 📈 +65 B (+0.88%) 7.19 kB → 7.25 kB
src/components/schedules/DiscoverSchedules.tsx 📈 +62 B (+0.82%) 7.38 kB → 7.44 kB
src/components/schedules/SchedulesTable.tsx 📈 +59 B (+0.49%) 11.81 kB → 11.87 kB
src/components/autocomplete/PayeeAutocomplete.tsx 📈 +34 B (+0.22%) 14.87 kB → 14.9 kB
src/components/Resizer.css +0 B (0%) 0 B → 0 B
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/wide.js 242.64 kB → 263.37 kB (+20.73 kB) +8.54%
static/js/index.js 3.37 MB → 3.38 MB (+9.98 kB) +0.29%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/workbox-window.prod.es5.js 5.69 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/narrow.js 82.76 kB 0%
static/js/AppliedFilters.js 21.3 kB 0%
static/js/ReportRouter.js 1.49 MB 0%

Copy link
Contributor

github-actions bot commented Aug 23, 2024

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
1 1.31 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1.31 MB 0%

@shawalli
Copy link

Is this going to solve for #536? 🤞

@lelemm
Copy link
Contributor Author

lelemm commented Aug 30, 2024

Is this going to solve for #536? 🤞

it should since you can expand the column.
It's kinda hard feature to implement, this may take time

@lelemm lelemm changed the title Testing dynamic table resize to make room for more information Table resize Sep 2, 2024
@lelemm lelemm changed the title Table resize [WIP] Table resize Sep 2, 2024
@lelemm lelemm marked this pull request as ready for review September 3, 2024 22:27
@lelemm
Copy link
Contributor Author

lelemm commented Oct 24, 2024

Found bugs on the new transaction row using this code, will work on it

Fixed.
For the table resize be possible, I had to change where on the table the headers are shown. After changing the location, the new transaction line would go over the header.
I created a new home for the new transaction line in the table named "subheader". before, the new transaction line was sort of part of the header.

This change may impact Visual Regression ( didn't test it locally), tomorrow I will check.

I feel like this is near the finish. If more people can test this will be nice.

@lelemm
Copy link
Contributor Author

lelemm commented Oct 25, 2024

Found 2 more inconsistencies. After these two probably this will be ready for review

lelemm and others added 5 commits October 25, 2024 15:26
….tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
….tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@lelemm lelemm changed the title [WIP] Table resize Transaction Table Resize Oct 25, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between edca1fa and fff2153.

⛔ Files ignored due to path filters (41)
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-Import-Transactions-import-csv-file-twice-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-Import-Transactions-import-csv-file-twice-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-Import-Transactions-import-csv-file-twice-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-Import-Transactions-imports-transactions-from-a-CSV-file-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-Import-Transactions-imports-transactions-from-a-CSV-file-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-5-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-6-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-creates-a-new-account-and-views-the-initial-balance-transaction-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-creates-a-new-account-and-views-the-initial-balance-transaction-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-creates-a-new-account-and-views-the-initial-balance-transaction-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-5-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-6-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-checks-the-page-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-checks-the-page-visuals-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-checks-the-page-visuals-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-split-test-transaction-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-split-test-transaction-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-split-test-transaction-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-test-transaction-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-test-transaction-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-test-transaction-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-5-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-6-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-7-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-8-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-9-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-7-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-8-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-9-chromium-linux.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • packages/desktop-client/e2e/transactions.test.js (1 hunks)
  • packages/desktop-client/src/components/ColumnWidthContext.jsx (1 hunks)
🧰 Additional context used
📓 Learnings (1)
packages/desktop-client/src/components/ColumnWidthContext.jsx (1)
Learnt from: lelemm
PR: actualbudget/actual#3309
File: packages/desktop-client/src/components/ColumnWidthContext.jsx:17-17
Timestamp: 2024-10-25T18:30:24.287Z
Learning: In `packages/desktop-client/src/components/ColumnWidthContext.jsx`, replacing `useState` with `useRef` for `positionAccumulator` causes the resize action to become unpredictable. Therefore, it's preferable to keep using `useState` for `positionAccumulator` in this context.
🔇 Additional comments (4)
packages/desktop-client/e2e/transactions.test.js (1)

53-55: Verify the intention behind changing the assertion method.

The change from toHaveText to toContainText makes the test less precise. While this might be necessary to accommodate the new resizable table implementation, consider:

  1. If possible, maintain the stricter toHaveText assertion to ensure exact matches
  2. If toContainText is required, please document why the less strict assertion is necessary
✅ Verification successful

Change from toHaveText to toContainText is appropriate

The change to toContainText is justified because:

  1. The "No transactions" text is rendered within nested components (as seen in Account.tsx and TransactionList.jsx)
  2. The text appears with additional markup and styling elements around it
  3. The assertion needs to be flexible enough to work with both desktop and mobile views, which render the message differently

The less strict assertion is necessary here and doesn't compromise test reliability since "No transactions" is a unique, specific message that wouldn't appear in other contexts.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the "No transactions" text structure has changed
# Look for the implementation of the empty state message in the new table component

# Search for "No transactions" text rendering
rg -l "No transactions"

# Search for TableResizable component implementation
ast-grep --pattern 'const TableResizable = $_'

Length of output: 4255


Script:

#!/bin/bash
# Let's check how "No transactions" is rendered in the Account component and transaction list
rg -A 5 "No transactions" packages/desktop-client/src/components/accounts/Account.tsx packages/desktop-client/src/components/mobile/transactions/TransactionList.jsx

# Also check the implementation around the transaction table in the test file
rg -B 5 -A 5 "transactionTable" packages/desktop-client/e2e/transactions.test.js

Length of output: 2508

packages/desktop-client/src/components/ColumnWidthContext.jsx (3)

190-196: LGTM! Well-implemented context hook.

The hook follows React best practices with proper error handling for usage outside the provider context.


67-69: Ensure proper sanitization of columnName in querySelectorAll.

The columnName parameter is used directly in a querySelectorAll selector. While this is within a controlled context, it's good practice to sanitize the input.


10-10: Verify the AUTO_SIZE constant value.

The AUTO_SIZE constant is used to replace the magic number -1. Please ensure it's properly defined in the constants file.

✅ Verification successful

AUTO_SIZE constant is correctly defined and used

The AUTO_SIZE constant is properly defined in loot-core/src/client/constants.ts with a value of -1 and is correctly imported and used in ColumnWidthContext.jsx for auto-sizing columns. The constant is also consistently used across other components like table.tsx for the same purpose.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for AUTO_SIZE constant definition
rg -A 1 "AUTO_SIZE.*=.*" "loot-core/client/constants"

Length of output: 120


Script:

#!/bin/bash
# Let's try to find the constants file with a broader search
fd "constants.js|constants.ts" --type f

# Also search for AUTO_SIZE usage across the codebase to understand its definition
rg "AUTO_SIZE" --type js --type jsx --type ts --type tsx

Length of output: 229


Script:

#!/bin/bash
# Check the content of both constants files and search for AUTO_SIZE
cat "packages/loot-core/src/client/constants.ts"
cat "packages/desktop-client/src/components/reports/constants.ts"

# Search for AUTO_SIZE with correct file extensions
rg "AUTO_SIZE" -t js -t ts

Length of output: 2433

@lelemm
Copy link
Contributor Author

lelemm commented Oct 25, 2024

Fixed all the problems that I found

lelemm and others added 2 commits October 25, 2024 16:53
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
packages/desktop-client/src/components/ColumnWidthContext.jsx (1)

64-88: Consider documenting the setTimeout delay.

The 100ms delay in handleDoubleClick is a magic number. Consider adding a comment explaining why this specific delay is necessary for DOM measurements.

-    }, 100);
+    // Wait for the DOM to update after setting AUTO_SIZE
+    }, 100);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between fff2153 and 6e3fb4e.

📒 Files selected for processing (1)
  • packages/desktop-client/src/components/ColumnWidthContext.jsx (1 hunks)
🧰 Additional context used
📓 Learnings (1)
packages/desktop-client/src/components/ColumnWidthContext.jsx (1)
Learnt from: lelemm
PR: actualbudget/actual#3309
File: packages/desktop-client/src/components/ColumnWidthContext.jsx:17-17
Timestamp: 2024-10-25T18:30:24.287Z
Learning: In `packages/desktop-client/src/components/ColumnWidthContext.jsx`, replacing `useState` with `useRef` for `positionAccumulator` causes the resize action to become unpredictable. Therefore, it's preferable to keep using `useState` for `positionAccumulator` in this context.
🔇 Additional comments (4)
packages/desktop-client/src/components/ColumnWidthContext.jsx (4)

1-15: LGTM! Well-organized imports and context creation.

The imports are comprehensive and properly structured, with a clear separation between React core imports, constants, and custom hooks.


192-198: LGTM! Well-implemented context hook.

The useColumnWidth hook follows React best practices by:

  • Properly consuming the context
  • Providing a descriptive error message when used outside the provider

92-134: 🛠️ Refactor suggestion

Reuse memoized width calculations.

The updateColumnWidth function recalculates currentTotalWidth and otherColumnsWidth which are already memoized at the component level.

   const updateColumnWidth = useCallback(
     (columnName, accumulatedDelta) => {
       const existingColumnWidth = columnWidths[columnName] || 0;
       const newWidth = accumulatedDelta;

       if (newWidth === AUTO_SIZE) {
         const newObj = {
           ...columnWidths,
           [columnName]: newWidth,
         };
         setColumnWidths(newObj);
         return newObj;
       }

-      const currentTotalWidth = Object.values(columnWidths).reduce(
-        (acc, width) => acc + width,
-        0,
-      );
-      const otherColumnsWidth = Object.values(fixedSizedColumns).reduce(
-        (acc, width) => acc + width + 10,
-        0,
-      );

       const proposedTotalWidth =
         currentTotalWidth - existingColumnWidth + newWidth + otherColumnsWidth;

Likely invalid or redundant comment.


69-71: Ensure columnName is properly sanitized.

Using template literals in querySelectorAll could be vulnerable to XSS if columnName contains malicious content. Consider implementing input validation or using a safer DOM querying approach.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (5)
packages/desktop-client/src/style/styles.ts (2)

164-171: LGTM: Improved selector scoping with documentation suggestion.

The updated scrollbar styles use proper nesting with the & selector and maintain a clean visual appearance with transparent backgrounds.

Consider adding a comment explaining the purpose of these specific styles, especially how they relate to the table resizing feature.

+ // These styles provide a minimal scrollbar appearance for better visual integration
+ // with the resizable table feature
   styles.horizontalScrollbar = !hiddenScrollbars && {

173-180: Consider dark mode compatibility for table scrollbars.

The table-specific horizontal scrollbar styles look good, but consider adding dark mode variants to ensure visibility across themes. The current background color (rgba(200, 200, 200, .5)) might not provide sufficient contrast in dark mode.

   styles.horizontalScrollbarTable = !hiddenScrollbars && {
     '& ::-webkit-scrollbar:horizontal': {
       height: 11,
       backgroundColor: 'rgba(0, 0, 0, 0)',
     },
     '& ::-webkit-scrollbar-thumb:horizontal': {
-      backgroundColor: 'rgba(200, 200, 200, .5)',
+      backgroundColor: theme.mode === 'dark' 
+        ? 'rgba(200, 200, 200, .7)'
+        : 'rgba(200, 200, 200, .5)',
     },
   };
packages/desktop-client/src/components/table.tsx (3)

Line range hint 164-295: Fix duplicate dependency in Cell component's useMemo hook

The useMemo hook's dependency array includes exposed twice, which is unnecessary and could potentially cause unnecessary re-renders.

Apply this diff to fix the dependency array:

    [
      privacyFilter,
      focused,
      exposed,
      children,
      plain,
-     exposed,
      valueStyle,
      onExpose,
      name,
      unexposedContent,
      value,
      formatter,
    ]

1307-1314: Consider optimizing scroll synchronization

The current implementation makes multiple scroll calls in the onScroll handler. Consider combining the scroll updates for better performance.

Consider refactoring to:

-                            subHeaderRef?.current.scrollTo({
-                              left: scrollContainer.current.scrollLeft,
-                              behavior: 'instant',
-                            });
-                            scrollContainerHeader?.current.scrollTo({
-                              left: scrollContainer.current.scrollLeft,
-                              behavior: 'instant',
-                            });
+                            const scrollLeft = scrollContainer.current.scrollLeft;
+                            [subHeaderRef, scrollContainerHeader].forEach(ref => {
+                              ref?.current?.scrollTo({
+                                left: scrollLeft,
+                                behavior: 'instant'
+                              });
+                            });

1020-1024: Add documentation for subHeader offset calculation

The subHeader offset calculation logic would benefit from documentation explaining its purpose and when it's recalculated.

Consider adding a comment like:

+    // Calculate and update the subHeader's offset height whenever it changes
+    // This offset is used to adjust the main content area's height
     useEffect(() => {
       if (subHeaderRef.current) {
         setSubHeaderOffset(subHeaderRef.current.offsetHeight);
       }
     }, [subHeaders, subHeaderRef]);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6e3fb4e and 3da670b.

📒 Files selected for processing (3)
  • packages/desktop-client/src/components/FixedSizeList.tsx (8 hunks)
  • packages/desktop-client/src/components/table.tsx (19 hunks)
  • packages/desktop-client/src/style/styles.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/desktop-client/src/components/FixedSizeList.tsx
🔇 Additional comments (6)
packages/desktop-client/src/style/styles.ts (2)

150-150: LGTM: New style variable follows established patterns.

The new horizontalScrollbarTable variable is properly typed and follows the existing naming conventions.


Line range hint 208-219: Verify horizontal scrollbar detection.

The testScrollbars function only checks vertical scrollbar visibility. Consider extending it to verify horizontal scrollbar visibility as well, since the new table resizing feature relies heavily on horizontal scrolling.

packages/desktop-client/src/components/table.tsx (4)

23-24: LGTM: New imports support resizable columns feature

The added imports for AUTO_SIZE, useMergedRefs, and ColumnWidthProvider are appropriate for implementing the resizable columns functionality.

Also applies to: 25-25, 36-36


415-434: LGTM: InputCell component refactoring

The InputCell component has been properly refactored to use forwardRef and maintains clean prop handling.


459-513: LGTM: CustomCell component refactoring

The CustomCell component has been properly refactored to use forwardRef with good state management and event handling.


1333-1339: LGTM: TableResizable component implementation

The TableResizable component correctly wraps the Table component with ColumnWidthProvider for column width management.

packages/desktop-client/src/components/table.tsx Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (2)
packages/desktop-client/src/components/table.tsx (2)

1207-1207: Document the magic number for scrollbar width.

The hardcoded value 11 for scrollbar width should be documented or extracted into a named constant for better maintainability.

+// Default width of the vertical scrollbar in pixels
+const SCROLLBAR_WIDTH = 11;
+
 <View
   style={{
-    width: `${totalWidth() + 11 /* 11 = vertical scrollbar width */}px`,
+    width: `${totalWidth() + SCROLLBAR_WIDTH}px`,
   }}
 >

1304-1314: Consider optimizing scroll synchronization.

The scroll synchronization between header, subheader, and content could benefit from debouncing to improve performance, especially during rapid scrolling.

Consider using a debounced version of the scroll handler:

import { debounce } from 'lodash';

// Create a debounced scroll handler
const debouncedScrollSync = debounce((scrollLeft) => {
  subHeaderRef?.current.scrollTo({
    left: scrollLeft,
    behavior: 'instant',
  });
  scrollContainerHeader?.current.scrollTo({
    left: scrollLeft,
    behavior: 'instant',
  });
}, 16); // 16ms = 1 frame at 60fps

// Use in onScroll
onScroll={config => {
  onScroll?.();
  debouncedScrollSync(scrollContainer.current.scrollLeft);
}}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 3da670b and 0fc422c.

📒 Files selected for processing (1)
  • packages/desktop-client/src/components/table.tsx (19 hunks)
🔇 Additional comments (3)
packages/desktop-client/src/components/table.tsx (3)

23-24: LGTM: New imports support resizable columns feature.

The added imports for AUTO_SIZE, useMergedRefs, and column width management utilities are appropriate for implementing the resizable columns feature.

Also applies to: 36-36


164-184: LGTM: Components properly refactored to use forwardRef.

The refactoring of Cell, InputCell, and CustomCell components to use forwardRef improves ref handling and TypeScript type safety. The implementation follows React best practices.

Also applies to: 415-434, 459-513


1189-1216: LGTM: Robust AutoSizer integration with proper edge case handling.

The AutoSizer integration is well implemented with:

  • Proper handling of zero width/height cases
  • Correct width calculations for headers and content
  • Appropriate resize event handling

Also applies to: 1249-1323

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (10)
packages/desktop-client/src/components/transactions/SimpleTransactionsTable.jsx (2)

Line range hint 179-248: Implement column flexibility requirements

According to the PR discussion:

  • The NOTES column should be flexible while others have fixed sizes
  • Resizing non-NOTES columns should affect the NOTES column's remaining space

Consider adding these configurations:

 <TableResizable
   prefName="simple-transactions-column-sizes"
   style={style}
   items={serializedTransactions}
   renderEmpty={renderEmpty}
   autoSizer={false}
+  flexibleColumns={['notes']}
   headers={

Line range hint 179-248: Consider implementing a column management system

To address the various UX concerns raised in the PR discussion, consider implementing a comprehensive column management system that includes:

  1. A column configuration context to manage column states
  2. A user preferences service to persist column settings
  3. A UI component for column management (reset, visibility, order)
  4. Documentation for column resize features

This would provide a more maintainable and user-friendly solution for handling column-related functionality.

packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx (1)

150-151: Add column reset functionality

Based on the PR objectives, users have requested the ability to reset column sizes. Consider:

  1. Adding a reset button in the modal header
  2. Including tooltip or documentation about the right-click reset feature mentioned in the PR comments

Example implementation:

<ModalHeader
  title={t('Link Accounts')}
  rightContent={
    <View style={{ display: 'flex', gap: 8 }}>
      <Button
        variant="secondary"
        title={t('Reset column sizes')}
        onPress={() => {
          // Add reset logic here
        }}
      />
      <ModalCloseButton onPress={close} />
    </View>
  }
/>
packages/desktop-client/src/components/table.tsx (2)

1304-1314: Consider optimizing scroll synchronization performance.

The current scroll synchronization implementation might cause performance issues:

  1. Multiple scroll event handlers firing on each scroll
  2. No debouncing of scroll events
  3. Instant scroll behavior might cause visual jank

Consider these improvements:

+ const handleScroll = useCallback(
+   debounce(() => {
+     const { scrollLeft } = scrollContainer.current;
+     requestAnimationFrame(() => {
+       if (subHeaderRef?.current) {
+         subHeaderRef.current.scrollTo({ left: scrollLeft });
+       }
+       if (scrollContainerHeader?.current) {
+         scrollContainerHeader.current.scrollTo({ left: scrollLeft });
+       }
+     });
+     onScroll?.();
+   }, 16),
+   [onScroll]
+ );

  <FixedSizeList
    // ...other props
-   onScroll={() => {
-     onScroll?.();
-     subHeaderRef?.current.scrollTo({
-       left: scrollContainer.current.scrollLeft,
-       behavior: 'instant',
-     });
-     scrollContainerHeader?.current.scrollTo({
-       left: scrollContainer.current.scrollLeft,
-       behavior: 'instant',
-     });
-   }}
+   onScroll={handleScroll}
  />

1189-1220: Simplify AutoSizer header implementation.

The current implementation has unnecessary conditional logic and nested views. Consider simplifying it for better maintainability.

- let encapsulatedHeaders: ReactNode | TableHeaderProps['headers'] =
-   autoSizer && (
-     <AutoSizer disableHeight={true}>
-       {({ width }) => {
-         if (width === 0) {
-           return null;
-         }
-         return (
-           <View
-             ref={scrollContainerHeader}
-             style={{
-               width: `${width}px`,
-               overflow: 'hidden',
-             }}
-           >
-             <View
-               style={{
-                 width: `${totalWidth() + 11}px`,
-               }}
-             >
-               {headers}
-             </View>
-           </View>
-         );
-       }}
-     </AutoSizer>
-   );
-
- if (!autoSizer) {
-   encapsulatedHeaders = headers;
- }

+ const HeaderContent = ({ width }) => (
+   width === 0 ? null : (
+     <View
+       ref={scrollContainerHeader}
+       style={{
+         width: `${width}px`,
+         overflow: 'hidden',
+       }}
+     >
+       <View style={{ width: `${totalWidth() + 11}px` }}>
+         {headers}
+       </View>
+     </View>
+   )
+ );
+
+ const encapsulatedHeaders = autoSizer ? (
+   <AutoSizer disableHeight>{HeaderContent}</AutoSizer>
+ ) : headers;
packages/desktop-client/src/components/accounts/Account.tsx (1)

730-732: Fix typo in method name

The method name contains a typo: "Toogle" should be "Toggle".

Apply this diff to fix the typo:

-  onToogleColumnEdit = () => {
+  onToggleColumnEdit = () => {
     this.props.toggleColumnEditMode();
   };

   onMenuSelect = async (
     item:
       | 'link'
       | 'unlink'
       | 'close'
       | 'reopen'
       | 'export'
       | 'toggle-balance'
       | 'remove-sorting'
       | 'toggle-cleared'
       | 'toggle-reconciled'
-      | 'toogle-column-edit',
+      | 'toggle-column-edit',
   ) => {
     // ...
     switch (item) {
       // ...
-      case 'toogle-column-edit':
+      case 'toggle-column-edit':
-        this.onToogleColumnEdit();
+        this.onToggleColumnEdit();
         break;

Also applies to: 833-835

packages/desktop-client/src/components/transactions/TransactionsTable.jsx (4)

2050-2070: Consider memoizing the column width configuration

The column width configuration is recreated on every render due to the useEffect dependency on columnWidths and columnWidths.current. This could lead to unnecessary re-renders.

Consider memoizing the fixed column widths configuration:

- useEffect(() => {
+ const fixedColumnConfig = useMemo(() => ({
+   notes: 'flex',
+   selected: 20,
+   date: 110,
+   debit: 100,
+   credit: 100,
+   payee: 200,
+   account: 200,
+   category: 110,
+   balance: props.showBalance ? 103 : 0,
+   cleared: props.showCleared ? 38 : 0,
+ }), [props.showBalance, props.showCleared]);
+
+ useEffect(() => {
-   setFixedSizedColumns({
-     notes: 'flex',
-     selected: 20,
-     date: 110,
-     debit: 100,
-     credit: 100,
-     payee: 200,
-     account: 200,
-     category: 110,
-     balance: props.showBalance ? 103 : 0,
-     cleared: props.showCleared ? 38 : 0,
-   });
+   setFixedSizedColumns(fixedColumnConfig);
  }, [columnWidths, columnWidths.current]);

Line range hint 234-343: Refactor ref assignments to improve code clarity

Multiple instances of ref assignments in expressions were flagged by static analysis. While functional, this pattern can make the code harder to maintain and understand.

Consider refactoring the ref assignments to be more explicit:

- ref={el => (refs.current['date'] = el)}
+ ref={el => {
+   refs.current['date'] = el;
+ }}

This pattern should be applied to all similar ref assignments in the code.

Also applies to: 1286-1737

🧰 Tools
🪛 Biome

[error] 295-295: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 315-315: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


1387-1421: Consider extracting PayeeCell rendering logic

The PayeeCell rendering logic is complex and could impact performance. Consider extracting it into a separate component to improve maintainability and enable better optimization.

Extract the PayeeCell rendering logic into a separate component:

const PayeeCellRenderer = memo(({ transaction, columnWidths, ...props }) => {
  return (
    <>
      <PayeeCell
        id={transaction.id}
        width={columnWidths.payee}
        {...props}
      />
      <Field
        width={10}
        style={{
          width: 10,
        }}
      />
    </>
  );
});

This would allow for better memoization and reduce unnecessary re-renders.

🧰 Tools
🪛 Biome

[error] 1392-1392: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


Line range hint 2188-2268: Add error boundaries for transaction table rendering

The transaction table handles complex state and rendering logic but lacks error boundaries to gracefully handle rendering failures.

Consider adding an error boundary component:

class TransactionTableErrorBoundary extends React.Component {
  state = { hasError: false };

  static getDerivedStateFromError(error) {
    return { hasError: true };
  }

  render() {
    if (this.state.hasError) {
      return <div>Error loading transaction table. Please refresh the page.</div>;
    }
    return this.props.children;
  }
}

// Wrap the table content
<TransactionTableErrorBoundary>
  <View
    style={{
      flex: 1,
      overflowX: 'hidden',
      position: 'relative',
    }}
    data-testid="transaction-table"
  >
    {/* ... existing content ... */}
  </View>
</TransactionTableErrorBoundary>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 0fc422c and 79e51a3.

📒 Files selected for processing (12)
  • packages/desktop-client/src/components/FixedSizeList.tsx (8 hunks)
  • packages/desktop-client/src/components/accounts/Account.tsx (10 hunks)
  • packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx (2 hunks)
  • packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx (2 hunks)
  • packages/desktop-client/src/components/payees/PayeeTable.tsx (2 hunks)
  • packages/desktop-client/src/components/schedules/SchedulesTable.tsx (2 hunks)
  • packages/desktop-client/src/components/table.tsx (18 hunks)
  • packages/desktop-client/src/components/transactions/SimpleTransactionsTable.jsx (2 hunks)
  • packages/desktop-client/src/components/transactions/TransactionsTable.jsx (36 hunks)
  • packages/desktop-client/src/components/transactions/TransactionsTable.test.jsx (4 hunks)
  • packages/desktop-client/src/style/styles.ts (3 hunks)
  • packages/loot-core/src/types/prefs.d.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx
  • packages/desktop-client/src/components/payees/PayeeTable.tsx
  • packages/desktop-client/src/components/schedules/SchedulesTable.tsx
  • packages/desktop-client/src/components/transactions/TransactionsTable.test.jsx
  • packages/desktop-client/src/style/styles.ts
  • packages/loot-core/src/types/prefs.d.ts
🧰 Additional context used
📓 Learnings (1)
packages/desktop-client/src/components/accounts/Account.tsx (3)
Learnt from: joel-jeremy
PR: actualbudget/actual#3685
File: packages/desktop-client/src/components/accounts/Account.tsx:655-665
Timestamp: 2024-11-10T16:45:31.225Z
Learning: The Account component in 'packages/desktop-client/src/components/accounts/Account.tsx' is being rewritten in a separate PR.
Learnt from: jfdoming
PR: actualbudget/actual#3402
File: packages/desktop-client/src/components/accounts/Account.tsx:8-8
Timestamp: 2024-11-10T16:45:25.627Z
Learning: In the `AllTransactions` component of `Account.tsx`, the `useLayoutEffect` hook is appropriately used to dispatch an action that closes splits for parent transactions when `prependTransactions` changes, ensuring this occurs synchronously before the component is painted.
Learnt from: jfdoming
PR: actualbudget/actual#3402
File: packages/desktop-client/src/components/accounts/Account.tsx:8-8
Timestamp: 2024-11-10T16:45:31.225Z
Learning: In the `AllTransactions` component of `Account.tsx`, the `useLayoutEffect` hook is appropriately used to dispatch an action that closes splits for parent transactions when `prependTransactions` changes, ensuring this occurs synchronously before the component is painted.
🪛 Biome
packages/desktop-client/src/components/transactions/TransactionsTable.jsx

[error] 234-234: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 249-249: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 267-267: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 280-280: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 295-295: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 315-315: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 328-328: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 343-343: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 1286-1286: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 1334-1334: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 1392-1392: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 1425-1425: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 1452-1452: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 1546-1546: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 1576-1576: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 1657-1657: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 1692-1692: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 1737-1737: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

🔇 Additional comments (11)
packages/desktop-client/src/components/transactions/SimpleTransactionsTable.jsx (2)

23-23: LGTM: Import change aligns with resize functionality

The change from Table to TableResizable is consistent with the PR's objective to add column resizing capabilities.


179-184: Consider adding column reset functionality

Based on the PR discussion, users need a way to reset column sizes. While right-click reset is mentioned, consider:

  1. Adding a visible reset button or menu item
  2. Documenting the reset functionality in tooltips or help text

Verify horizontal scrolling behavior

Setting autoSizer={false} might contribute to the horizontal scrolling issues mentioned in the PR comments.

packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx (3)

21-21: LGTM: Clean import change

The import statement correctly includes the new TableResizable component while maintaining the existing imports.


Line range hint 152-174: LGTM: Clean integration with existing functionality

The TableResizable component maintains all the necessary props and functionality from the original implementation:

  • Proper key handling for list items
  • Consistent rendering of TableRow components
  • Preserved account linking/unlinking logic

150-151: Consider potential layout issues with fixed widths

The table is contained within a modal of fixed width (800px) and includes columns with fixed widths (200px + 80px) plus two flex columns. This combination might:

  1. Cause horizontal scrolling if columns are resized beyond the modal width
  2. Create layout issues when the two flex columns compete for remaining space

Let's verify the column width calculations:

packages/desktop-client/src/components/table.tsx (2)

23-24: LGTM: New imports are well-organized.

The new imports are properly structured and necessary for implementing the resizable columns feature.

Also applies to: 25-25, 36-36


164-184: LGTM: Components properly refactored with forwardRef.

The Cell, InputCell, and CustomCell components have been correctly refactored to use forwardRef, improving their reusability and following React best practices. The type definitions are properly maintained.

Also applies to: 415-434, 459-513

packages/desktop-client/src/components/accounts/Account.tsx (3)

72-72: LGTM: Column width management integration

The addition of column width management through context and hooks is well-structured and follows React best practices.

Also applies to: 288-288


1851-1851: LGTM: Column width hook integration

The column width management hook is properly integrated into the component hierarchy.

Also applies to: 1861-1861


1868-1873: LGTM with a note about potential conflicts

The column width context integration is well-structured and follows React best practices. However, be aware that this component is being rewritten in a separate PR, which might lead to merge conflicts.

Let's verify the status of the rewrite PR:

Also applies to: 1875-1916, 1953-1953

packages/desktop-client/src/components/FixedSizeList.tsx (1)

273-273: Consider consistent unit handling and clarify subtraction of 16 pixels

The width calculation subtracts 16 pixels: ${Math.max(totalWidth || 0, width || 0) - 16}px. This approach might lead to negative widths if both totalWidth and width are less than 16. Additionally, the reason for subtracting 16 pixels is unclear.

Previous comment still applies: ensure consistent unit handling for width and totalWidth, and consider explaining or adjusting the subtraction of 16 pixels to prevent potential issues.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (1)
packages/desktop-client/src/components/table.tsx (1)

1020-1024: Consider using ResizeObserver instead of useEffect for header height.

The current implementation uses useEffect to measure subHeader height, which could cause layout shifts. Consider using ResizeObserver for more reliable measurements.

-useEffect(() => {
-  if (subHeaderRef.current) {
-    setSubHeaderOffset(subHeaderRef.current.offsetHeight);
-  }
-}, [subHeaders, subHeaderRef]);
+useEffect(() => {
+  if (subHeaderRef.current) {
+    const resizeObserver = new ResizeObserver(entries => {
+      for (const entry of entries) {
+        setSubHeaderOffset(entry.contentRect.height);
+      }
+    });
+    resizeObserver.observe(subHeaderRef.current);
+    return () => resizeObserver.disconnect();
+  }
+}, []);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 79e51a3 and 76838be.

⛔ Files ignored due to path filters (51)
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-Import-Transactions-import-csv-file-twice-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-Import-Transactions-import-csv-file-twice-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-Import-Transactions-import-csv-file-twice-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-Import-Transactions-imports-transactions-from-a-CSV-file-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-Import-Transactions-imports-transactions-from-a-CSV-file-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-Import-Transactions-imports-transactions-from-a-CSV-file-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-5-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-6-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-5-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-6-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-checks-the-page-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-checks-the-page-visuals-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-checks-the-page-visuals-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-10-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-11-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-12-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-5-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-6-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-7-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-8-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-9-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-checks-the-page-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-checks-the-page-visuals-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-checks-the-page-visuals-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-split-test-transaction-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-split-test-transaction-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-split-test-transaction-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-test-transaction-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-test-transaction-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-test-transaction-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-5-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-creates-a-transfer-test-transaction-6-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-7-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-8-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-9-chromium-linux.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • packages/desktop-client/src/components/table.tsx (18 hunks)
🔇 Additional comments (5)
packages/desktop-client/src/components/table.tsx (5)

23-24: LGTM: New imports support column resizing functionality.

The added imports are appropriate for implementing the resizable columns feature:

  • AUTO_SIZE constant for dynamic column sizing
  • useMergedRefs hook for ref management
  • ColumnWidthProvider and useColumnWidth for column width management

Also applies to: 25-25, 36-36


Line range hint 164-295: LGTM: Cell component refactored with proper ref forwarding.

The Cell component has been properly refactored to:

  • Use forwardRef for better ref handling
  • Include comprehensive TypeScript types
  • Implement proper ref merging with useMergedRefs

415-434: LGTM: InputCell component refactored with proper ref forwarding.

The InputCell component refactoring looks good with:

  • Proper ref forwarding implementation
  • Clean TypeScript types
  • Consistent props handling

459-513: LGTM: CustomCell component refactored with proper ref forwarding.

The CustomCell component refactoring is well done with:

  • Proper ref forwarding
  • Clear state management
  • Consistent event handling

1331-1341: LGTM: TableResizable component implementation.

The TableResizable component is well implemented:

  • Properly wraps Table with ColumnWidthProvider
  • Correctly forwards refs
  • Has appropriate TypeScript generics

@lelemm
Copy link
Contributor Author

lelemm commented Nov 21, 2024

/update-vrt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Resizable columns
5 participants