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

Undoable auto transfer notes + auto notes for cover #3411

Merged
merged 8 commits into from
Sep 19, 2024

Conversation

joel-jeremy
Copy link
Contributor

Resolves #3404

@actual-github-bot actual-github-bot bot changed the title Undo auto transfer notes + auto notes for cover [WIP] Undo auto transfer notes + auto notes for cover Sep 9, 2024
Copy link

netlify bot commented Sep 9, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 7a7c74a
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/66ea641b949c7600082b3a8d
😎 Deploy Preview https://deploy-preview-3411.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 Sep 9, 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.18 MB → 5.18 MB (-4.3 kB) -0.08%
Changeset
File Δ Size
src/components/budget/util.ts 📈 +386 B (+12.31%) 3.06 kB → 3.44 kB
src/components/budget/rollover/TransferMenu.tsx 📈 +235 B (+9.47%) 2.42 kB → 2.65 kB
src/components/modals/TransferModal.tsx 📈 +151 B (+3.92%) 3.76 kB → 3.91 kB
src/components/Modals.tsx 📈 +46 B (+0.30%) 14.93 kB → 14.98 kB
src/components/mobile/budget/BudgetTable.jsx 📈 +33 B (+0.06%) 52.14 kB → 52.17 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/rules.ts 📉 -73 B (-1.10%) 6.48 kB → 6.41 kB
src/components/modals/EditRuleModal.jsx 📉 -1.67 kB (-4.29%) 38.94 kB → 37.27 kB
src/components/settings/Experimental.tsx 📉 -233 B (-4.80%) 4.74 kB → 4.51 kB
src/hooks/useFeatureFlag.ts 📉 -27 B (-7.28%) 371 B → 344 B
src/components/rules/ActionExpression.tsx 📉 -375 B (-9.12%) 4.01 kB → 3.65 kB
src/components/budget/rollover/CoverMenu.tsx 📉 -227 B (-10.41%) 2.13 kB → 1.91 kB
src/components/modals/CoverModal.tsx 📉 -327 B (-10.42%) 3.06 kB → 2.74 kB
src/components/budget/rollover/BalanceMovementMenu.tsx 📉 -1.41 kB (-50.24%) 2.81 kB → 1.4 kB
src/icons/v1/Code.tsx 🔥 -448 B (-100%) 448 B → 0 B
src/icons/v1/AlignLeft.tsx 🔥 -387 B (-100%) 387 B → 0 B
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/narrow.js 80.62 kB → 80.65 kB (+33 B) +0.04%

Smaller

Asset File Size % Changed
static/js/index.js 3.21 MB → 3.2 MB (-4.33 kB) -0.13%

Unchanged

Asset File Size % Changed
static/js/resize-observer.js 18.37 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/usePreviewTransactions.js 1.59 kB 0%
static/js/AppliedFilters.js 20.97 kB 0%
static/js/wide.js 225.21 kB 0%
static/js/ReportRouter.js 1.5 MB 0%

Copy link
Contributor

github-actions bot commented Sep 9, 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.26 MB → 1.19 MB (-73.57 kB) -5.69%
Changeset
File Δ Size
packages/loot-core/src/server/budget/actions.ts 📈 +1.73 kB (+16.86%) 10.28 kB → 12.01 kB
packages/loot-core/src/server/notes/app.ts 📈 +31 B (+14.49%) 214 B → 245 B
packages/loot-core/src/server/db/index.ts 📈 +659 B (+3.48%) 18.49 kB → 19.13 kB
packages/loot-core/src/shared/rules.ts 📉 -83 B (-0.92%) 8.8 kB → 8.72 kB
packages/loot-core/src/server/accounts/rules.ts 📉 -2.85 kB (-8.45%) 33.74 kB → 30.88 kB
node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js 🔥 -200.84 kB (-100%) 200.84 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js 🔥 -118.53 kB (-100%) 118.53 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js 🔥 -56.75 kB (-100%) 56.75 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/runtime.js 🔥 -43.72 kB (-100%) 43.72 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js 🔥 -22.62 kB (-100%) 22.62 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js 🔥 -18.76 kB (-100%) 18.76 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js 🔥 -15.51 kB (-100%) 15.51 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js 🔥 -12.33 kB (-100%) 12.33 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/utils.js 🔥 -10.07 kB (-100%) 10.07 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/helpers/each.js 🔥 -9.64 kB (-100%) 9.64 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/base.js 🔥 -9.41 kB (-100%) 9.41 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js 🔥 -8.29 kB (-100%) 8.29 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/exception.js 🔥 -5.81 kB (-100%) 5.81 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars.js 🔥 -4.79 kB (-100%) 4.79 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars.runtime.js 🔥 -4.5 kB (-100%) 4.5 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/helpers/if.js 🔥 -4.35 kB (-100%) 4.35 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/compiler/base.js 🔥 -3.83 kB (-100%) 3.83 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/helpers.js 🔥 -3.82 kB (-100%) 3.82 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/logger.js 🔥 -3.79 kB (-100%) 3.79 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js 🔥 -3.74 kB (-100%) 3.74 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/helpers/with.js 🔥 -3.67 kB (-100%) 3.67 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js 🔥 -3.34 kB (-100%) 3.34 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js 🔥 -2.63 kB (-100%) 2.63 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/helpers/log.js 🔥 -2.45 kB (-100%) 2.45 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/no-conflict.js 🔥 -2.45 kB (-100%) 2.45 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js 🔥 -2.14 kB (-100%) 2.14 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js 🔥 -1.97 kB (-100%) 1.97 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js 🔥 -1.74 kB (-100%) 1.74 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js 🔥 -1.21 kB (-100%) 1.21 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/safe-string.js 🔥 -1.14 kB (-100%) 1.14 kB → 0 B
node_modules/handlebars/dist/cjs/handlebars/decorators.js 🔥 -1000 B (-100%) 1000 B → 0 B
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

Asset File Size % Changed
kcab.worker.js 1.26 MB → 1.19 MB (-73.57 kB) -5.69%

Unchanged

No assets were unchanged

@joel-jeremy joel-jeremy changed the title [WIP] Undo auto transfer notes + auto notes for cover Undo auto transfer notes + auto notes for cover Sep 9, 2024
@joel-jeremy joel-jeremy changed the title Undo auto transfer notes + auto notes for cover Undoable auto transfer notes + auto notes for cover Sep 9, 2024
@youngcw
Copy link
Member

youngcw commented Sep 11, 2024

Seems to work well. @Teprifer do you see anything else that needs fixed here?

@Teprifer
Copy link

Seems to work well. @Teprifer do you see anything else that needs fixed here?

I feel bad not picking up on it before. :(

There's something a bit weird with the undo, it needs to be done twice if the note is viewed, this isn't the case in a few days old edge.

To reproduce:

  1. Do a transfer
  2. Click to check note
  3. Click outside to dismiss note
  4. ctrl+z (nothing happens)
  5. ctrl+z again (action is undone)

This stacks:

  1. Do a transfer
  2. Click to check note
  3. Click outside to dismiss note
  4. Do a transfer
  5. Click to check note
  6. Click outside to dismiss note
  7. ctrl+z (nothing happens)
  8. ctrl+z again (second action is undone)
  9. ctrl+z (nothing happens)
  10. ctrl+z again (first action is undone)

If not clicking the note in between, then only one ctrl+z is required.

  1. Do a transfer
  2. ctrl+z (action is undone)

Fairly minor overall, but could be come across as ctrl+z not working in niche cases?

@Teprifer
Copy link

Cheers for fixing the ctrl+z.

I, uh, mis-clicked when testing and found a difference in transfer behaviour to Edge:

In Edge if you click a category to assign the funds to another category and select the source category as the destination category nothing happens. In this PR it'll allocate the transfer value again to that category, pulling from To Budget (obviously).

This PR:
image

Transfer food to food:
image

Result:
image

@joel-jeremy joel-jeremy force-pushed the undoable-auto-transfer-notes branch 2 times, most recently from d04d5af to 906b218 Compare September 15, 2024 23:04
@joel-jeremy
Copy link
Contributor Author

Cheers for fixing the ctrl+z.

I, uh, mis-clicked when testing and found a difference in transfer behaviour to Edge:

In Edge if you click a category to assign the funds to another category and select the source category as the destination category nothing happens. In this PR it'll allocate the transfer value again to that category, pulling from To Budget (obviously).

This PR: image

Transfer food to food: image

Result: image

Nice catch! I've hidden the source category in the transfer menu and cover menus.

@Teprifer
Copy link

@joel-jeremy Has that change been pushed to github? Or has the netlify build not updated? The source category is still showing for me.

Food (transfer)
image

I checked cover too, but trying to cover a negative with itself doesn't result in any note or change in budget, so this menu option is as expected.
Clothing (cover)
image

@joel-jeremy
Copy link
Contributor Author

@joel-jeremy Has that change been pushed to github? Or has the netlify build not updated? The source category is still showing for me.

Food (transfer) image

I checked cover too, but trying to cover a negative with itself doesn't result in any note or change in budget, so this menu option is as expected. Clothing (cover) image

Thank you for the testing it out! Sorry, I missed an if condition on the new utility method. Should be fixed now.

@Teprifer
Copy link

All good, familiar with the "oh that one other bit". Checks out functionality wise so should be good for a code review I think?

@joel-jeremy
Copy link
Contributor Author

All good, familiar with the "oh that one other bit". Checks out functionality wise so should be good for a code review I think?

Had to rebase to resolve a conflict. Should be good for code review :)

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 17fd068 and 7a7c74a.

Files selected for processing (13)
  • packages/desktop-client/src/components/Modals.tsx (2 hunks)
  • packages/desktop-client/src/components/budget/rollover/BalanceMovementMenu.tsx (3 hunks)
  • packages/desktop-client/src/components/budget/rollover/CoverMenu.tsx (2 hunks)
  • packages/desktop-client/src/components/budget/rollover/TransferMenu.tsx (3 hunks)
  • packages/desktop-client/src/components/budget/util.ts (2 hunks)
  • packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx (2 hunks)
  • packages/desktop-client/src/components/modals/CoverModal.tsx (1 hunks)
  • packages/desktop-client/src/components/modals/TransferModal.tsx (2 hunks)
  • packages/loot-core/src/client/state-types/modals.d.ts (1 hunks)
  • packages/loot-core/src/server/budget/actions.ts (5 hunks)
  • packages/loot-core/src/server/db/index.ts (3 hunks)
  • packages/loot-core/src/server/notes/app.ts (1 hunks)
  • upcoming-release-notes/3411.md (1 hunks)
Additional context used
LanguageTool
upcoming-release-notes/3411.md

[uncategorized] ~6-~6: It appears that a hyphen is missing (if ‘auto’ is not used in the context of ‘cars’).
Context: ...emy] --- Undoable auto tranfer notes + auto notes for cover

(AUTO_HYPHEN)

Additional comments not posted (37)
packages/loot-core/src/server/notes/app.ts (2)

9-11: LGTM!

The updateNotes function is a clear and concise implementation of a database update operation. The use of async/await and object destructuring is appropriate and follows best practices.


13-13: Nice refactoring!

Extracting the database update logic into a separate updateNotes function improves code readability and maintainability. The notes-save method now has a clear and focused responsibility.

packages/desktop-client/src/components/budget/rollover/BalanceMovementMenu.tsx (2)

47-47: LGTM!

The direct passing of categoryId to the TransferMenu component looks good. The removal of the useBudgetTransferNotes hook and its associated functionality seems to be intentional, as per the AI-generated summary.


63-63: LGTM!

The direct passing of categoryId to the CoverMenu component looks good.

packages/desktop-client/src/components/budget/rollover/CoverMenu.tsx (4)

3-3: LGTM!

The import path update for CategoryEntity type is correct and does not affect the component's functionality.


10-10: LGTM!

The import statement for the utility functions addToBeBudgetedGroup and removeCategoriesFromGroups is correct and will be used within the component.


14-15: LGTM!

The changes to the CoverMenuProps are improvements:

  • Renaming category to categoryId enhances clarity and consistency.
  • Explicitly specifying the parameter type for onSubmit improves type safety and readability.

21-21: LGTM!

The changes related to categoryId, fromCategoryId, and the CategoryAutocomplete component are well-implemented:

  • Using categoryId instead of category maintains consistency.
  • Introducing fromCategoryId state allows for better management of the selected category.
  • Updating filteredCategoryGroups to use categoryId and fromCategoryId ensures correct recalculation.
  • Using fromCategoryId in the submit function ensures the correct category is submitted.
  • Setting value to null in CategoryAutocomplete aligns with the expected prop type.
  • Updating fromCategoryId in the onSelect prop ensures the state is correctly updated.

Also applies to: 27-27, 29-37, 40-41, 53-53, 55-55

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

5-5: LGTM!

The import statement for the CategoryEntity type is correct and necessary for using it in the file.


9-12: LGTM!

The import statements for the addToBeBudgetedGroup and removeCategoriesFromGroups utility functions are correct and necessary for using them in the file.


28-61: LGTM!

The changes to the CoverModal component are consistent with the AI-generated summary and the changes to the CoverModalProps interface. The categoryId prop is used correctly to filter the categoryGroups using the removeCategoriesFromGroups utility function, and the onCategoryClick function is updated to use the filtered categoryGroups.


20-23: Verify the impact of the breaking changes in the codebase.

The changes to the CoverModalProps interface are breaking changes:

  • The categoryId prop is now optional, which could affect the usage of the CoverModal component in other parts of the codebase.
  • The onSubmit prop now accepts categoryId instead of category, which could affect the usage of the CoverModal component in other parts of the codebase.

Run the following script to verify the usage of the CoverModal component:

Verification successful

CoverModal usage is consistent with the updated interface

The verification process has confirmed that the usage of the CoverModal component in the codebase is consistent with the updated interface:

  • The categoryId prop is used instead of category.
  • The onSubmit prop is correctly implemented.
  • All other props are present and used as expected.

No issues or inconsistencies were found in the usage of the CoverModal component.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the `CoverModal` component in the codebase.

# Test: Search for the usage of the `CoverModal` component. Expect: No usage of the old `category` prop or the old `onSubmit` prop signature.
rg --type typescript -A 5 $'<CoverModal'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify the usage of the `CoverModal` component in the codebase.

# Find TypeScript files and search for CoverModal usage
fd -e ts -e tsx | xargs rg -i -A 5 '<CoverModal'

Length of output: 575


Script:

#!/bin/bash
# Description: Search for the complete CoverModal usage, including the onSubmit prop.

# Find the CoverModal usage in Modals.tsx with more context
rg -i -A 15 '<CoverModal' packages/desktop-client/src/components/Modals.tsx

Length of output: 593

packages/desktop-client/src/components/budget/rollover/TransferMenu.tsx (6)

16-16: LGTM!

The addition of the optional categoryId prop enhances the component's flexibility by allowing it to filter categories based on a specific ID. The prop is correctly typed and marked as optional, ensuring backward compatibility.


31-41: LGTM!

The use of useMemo to memoize the filtered category groups is a good performance optimization. The filtering logic correctly handles the inclusion/exclusion of categories based on the provided props (categoryId, originalCategoryGroups, and showToBeBudgeted). This ensures that the component receives a relevant subset of categories, enhancing its efficiency and maintainability.


45-45: LGTM!

The renaming of the state variable from categoryId to toCategoryId improves code readability and maintainability. It clarifies the purpose of the variable as the target category for the transfer, reducing potential confusion. This change enhances code clarity without introducing any functional changes.


64-64: LGTM!

The modification of the onEnter callback to pass the toCategoryId state variable to the _onSubmit function maintains consistency with the renaming of the state variable. This change ensures that the correct target category ID is passed when the enter key is pressed, preserving the expected behavior of the component.


71-74: LGTM!

The changes to the CategoryAutocomplete component enhance its usability and flexibility:

  • Passing the filteredCategoryGroups as the categoryGroups prop ensures that the component receives the relevant subset of categories based on the filtering logic.
  • Setting the value prop to null allows the component to handle its own state internally, promoting a more modular design.
  • The onSelect callback correctly updates the toCategoryId state variable when a category is selected, maintaining the state of the selected target category in the parent component.

These modifications improve the component's integration and state management within the TransferMenu.


19-19: Verify the impact on the parent component.

The change in the onSubmit prop's categoryId parameter type from string to CategoryEntity['id'] enhances type safety. However, ensure that the parent component or wherever the onSubmit callback is defined has been updated to match the new type signature.

Run the following script to verify the onSubmit prop usage:

packages/desktop-client/src/components/modals/TransferModal.tsx (5)

5-5: LGTM!

The import statement for the CategoryEntity type is correct and necessary for using it in the file.


9-12: LGTM!

The import statements for the addToBeBudgetedGroup and removeCategoriesFromGroups utility functions are correct and necessary for using them in the file.


22-22: LGTM!

The addition of the optional categoryId prop of type CategoryEntity['id'] to the TransferModalProps type is correct and allows the component to receive a specific category identifier.


26-26: LGTM!

The modification of the onSubmit prop in the TransferModalProps type to accept a toCategoryId parameter of type CategoryEntity['id'] is correct and ensures type consistency.


31-51: LGTM!

The modifications to the category group and category filtering logic within the useMemo hook are correct and align with the requirements. The use of the categoryId prop to conditionally filter categories provides flexibility in rendering the available categories for transfer. The useMemo hook is correctly used to memoize the computed values based on the dependencies.

packages/desktop-client/src/components/budget/util.ts (1)

38-53: LGTM!

The removeCategoriesFromGroups function is well-implemented and follows best practices:

  • It handles edge cases like empty category IDs and groups becoming empty after removal.
  • It uses a set for efficient lookup of category IDs.
  • It uses modern JavaScript features like the spread operator and optional chaining for concise and readable code.
  • The logic is correct and the code is clean and maintainable.

Great job!

packages/loot-core/src/client/state-types/modals.d.ts (2)

228-228: LGTM!

The addition of the optional categoryId property to the transfer modal object is a good enhancement. It allows associating a specific category with the transfer, enabling better categorization and tracking of financial transfers. The type of CategoryEntity['id'] ensures that the categoryId is a valid category ID.


236-236: Looks good!

The addition of the optional categoryId property to the cover modal object is a nice improvement. It allows associating a specific category with the cover, enabling better categorization and tracking of financial covers. The type of CategoryEntity['id'] ensures that the categoryId is a valid category ID.

packages/loot-core/src/server/budget/actions.ts (4)

374-387: LGTM!

The changes to wrap the budget update and note addition within a batchMessages call ensure that both operations are treated as a single transaction, improving data consistency.


419-428: LGTM!

The changes to wrap the budget update and note addition within a batchMessages call ensure that both operations are treated as a single transaction, improving data consistency.


445-461: LGTM!

The changes to wrap the budget updates and note addition within a batchMessages call ensure that all operations are treated as a single transaction, improving data consistency.


487-530: Excellent addition of the addMovementNotes function!

This function greatly enhances the tracking of budget movements by logging detailed notes for each transfer. It captures the essential information, such as the amount, source and destination categories, and the date of the transaction.

By retrieving the existing notes and appending the new note, it maintains a comprehensive history of budget movements, which will be valuable for auditing and understanding the flow of funds over time.

packages/loot-core/src/server/db/index.ts (3)

285-291: Approve the changes to the getCategories function.

The updates to the getCategories function enhance its flexibility by allowing optional filtering of categories based on their IDs. The use of the toSqlQueryParameters utility function improves code maintainability and readability by dynamically generating the SQL query parameters.

The changes are localized to the function and do not appear to have any negative impact on the rest of the codebase.


293-314: Approve the changes to the getCategoriesGrouped function.

The updates to the getCategoriesGrouped function enhance its flexibility by allowing optional filtering of category groups based on their IDs. The use of the toSqlQueryParameters utility function improves code maintainability and readability by dynamically generating the SQL query parameters.

The changes are localized to the function and do not appear to have any negative impact on the rest of the codebase.


698-700: Approve the addition of the toSqlQueryParameters utility function.

The toSqlQueryParameters function is a useful utility that generates a comma-separated string of placeholders (?) for use in SQL queries. It is used in the getCategories and getCategoriesGrouped functions to dynamically generate the SQL query parameters based on the provided ids array.

The function is generic and can be reused in other parts of the codebase where similar functionality is required. It improves code maintainability and readability by abstracting the placeholder generation logic into a separate function.

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

500-500: LGTM!

The addition of the categoryId prop to the TransferModal component enhances its functionality by allowing it to work with category-specific data. This change aligns with the AI-generated summary and seems to be a logical enhancement to the modal's capabilities.


513-513: LGTM!

The addition of the categoryId prop and the removal of the category prop in the CoverModal component streamline the data flow and potentially improve performance. The CoverModal can now fetch or interact with category data based on the identifier, rather than relying on the entire category object. These changes align with the AI-generated summary and seem to be logical enhancements to the modal's implementation.

packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx (2)

396-396: LGTM!

The renaming of the category parameter to categoryId in the modal function calls improves code clarity and maintainability. The changes are consistent with the list of alterations provided in the summary and do not alter the overall logic or behavior of the component.

Also applies to: 430-430


Line range hint 1-1: No action required.

The BudgetTable function itself has not been modified. The changes made in the child ExpenseCategory component are minor and do not require any action in this function.

@Teprifer
Copy link

All good, familiar with the "oh that one other bit". Checks out functionality wise so should be good for a code review I think?

Had to rebase to resolve a conflict. Should be good for code review :)

Haha, well, I'm sure a code review would've picked that up - I was more indicating to others as you don't want me pretending I can code review. :)

@actualbudget actualbudget deleted a comment from coderabbitai bot Sep 19, 2024
Copy link
Contributor

@matt-fidd matt-fidd left a comment

Choose a reason for hiding this comment

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

LGTM from both a code and functionality perspective

@joel-jeremy joel-jeremy merged commit e6bf6da into master Sep 19, 2024
20 checks passed
@joel-jeremy joel-jeremy deleted the undoable-auto-transfer-notes branch September 19, 2024 23:13
a-gradina pushed a commit to a-gradina/actual that referenced this pull request Sep 24, 2024
* Undo auto transfer notes + auto notes for cover

* Release notes

* Fix notes

* Fix notes undo

* Do not show clicked category on transfer or cover menus

* Fix typecheck error

* typecheck

* Fix removeCategoriesFromGroups
matt-fidd added a commit that referenced this pull request Oct 3, 2024
* marked files for translation

* added release note

* fixed linting warnings

* 🐛 fix account filters being overridden (#3441)

* :electron: Reduce package size  (#3443)

* reduce package size of all packages

* release notes

* Update beforePackHook.ts

* [Maintenance] Cleanup react aria packages and dedupe (#3450)

* Cleanup react aria packages and dedupe

* Release notes

* ♻️ (synced-prefs) moving the prefs from metadata.json to the db (#3423)

* :electron: Restart server silently when adding self signed cert and add some logs (#3431)

* restart server silently on add self signed cert and add some logging

* release notes

* fix name

* updating names to be more specific

* removing setloading

* feedback

* ♻️ (synced-prefs) move budget type to synced prefs (#3427)

* update synced account balance in db if available (#3452)

* 🐛 (synced-prefs) fix bulk-reading not working in import modal (#3460)

* fix: csv import deduplication (#3456)

* ✨ release simplefin as a first-party feature (#3459)

Closes #2272

* Do not allow renaming to an empty category or group name (#3463)

* Do not allow renaming to an emoty category or group name

* Release notes

* [Mobile] Fix #3214 - Pull down to refresh triggering clicks on budget cells (#3374)

* Fix #3214

* Fix rollover indicator

* VRT

* Fix typecheck error

* VRT

* Release notes

* VRT

* Update style

* Fix budgeted

* VRT

* VRT

* Revert VRT

* VRT

* Fix style

* Revert usePreviewTransactions

* Fix error

* Fix reports form submit handlers (#3462)

* Fix form submit handlers

* Release notes

* :electron: Remove some old updater code (#3468)

* remove some old updater code

* remove old updater logic

* CSV import e2e tests (#3467)

* Fix React Aria Button hover styles  (#3453)

* Fiox hover styles and use className instead of inline to prepare for future css migration

* Release notes

* Cleanup

* Update edit rule hover style

* Undoable auto transfer notes + auto notes for cover (#3411)

* Undo auto transfer notes + auto notes for cover

* Release notes

* Fix notes

* Fix notes undo

* Do not show clicked category on transfer or cover menus

* Fix typecheck error

* typecheck

* Fix removeCategoriesFromGroups

* 🐛 (reports) deleting custom report should remove it from the dashboard (#3469)

* Revert "CSV import e2e tests (#3467)" (#3474)

This reverts commit 5e12d40.

* ♻️ (synced-prefs) separate metadata and local prefs out (#3458)

* :electron: Replace deprecated file protocol registration (#3475)

* replace deprecated file handler in electron

* release notes

* types eh

* types

* update sql regexp to default to empty string when field is null (#3480)

* ♻️ rename report/rollover budget to tracking/envelope (#3483)

* 🐛 (import) fix csv import checkboxes not working (#3478)

* Update tooltip and themes with better visibility (#3298)

* Update tooltip and themes with better visibility

* Rename merge request # into release notes

* rename release note

* update VRT

* tweak light theme

* dont put border on autocomplete menus

* update VRT

* tweak popover style

* simplify

* update VRT

* update VRT

---------

Co-authored-by: Dustin Conlon <dustin@dustinconlon.com>
Co-authored-by: Dustin Conlon <58367364+VoltaicGRiD@users.noreply.github.com>
Co-authored-by: youngcw <calebyoung94@gmail.com>

* fix modals on mobile BudgetTable (#3487)

* Fix privacy filter (#3472)

* Fix privacy filter

* Release notes

* Coderabbit suggestion

* VRT

* VRT

* Revert VRT

* VRT

* VRT

* VRT

* VRT

* Delete VRT

* VRT

* Revert VRT

* 🐛 fix custom reports crashing when opening table (#3484)

* 🧪 (tests) adding custom report e2e tests (#3493)

* ✨ (dashboards) ability to save filters & timeframes on spending widgets (#3432)

* marked files for translation

* Revert ":bug: fix account filters being overridden (#3441)"

This reverts commit 7336bad.

* Revert "Revert ":bug: fix account filters being overridden (#3441)""

This reverts commit 5cbadc4.

* Revert changes due to failed rebase

* removed import of t

* fixed lint warning

* added PayeeTableRow.tsx

* needed changes

* bugfix: pluralization

* variables adjustments

* removed doubled trans

---------

Co-authored-by: Matiss Janis Aboltins <matiss@mja.lv>
Co-authored-by: Michael Clark <5285928+MikesGlitch@users.noreply.github.com>
Co-authored-by: Joel Jeremy Marquez <joeljeremy.marquez@gmail.com>
Co-authored-by: Matt Fiddaman <github@m.fiddaman.uk>
Co-authored-by: Koen van Staveren <koenvanstaveren@hotmail.com>
Co-authored-by: Ryan Bianchi <1435081+qedi-r@users.noreply.github.com>
Co-authored-by: Robert Dyer <rdyer@unl.edu>
Co-authored-by: Dustin Conlon <dustin@dustinconlon.com>
Co-authored-by: Dustin Conlon <58367364+VoltaicGRiD@users.noreply.github.com>
Co-authored-by: youngcw <calebyoung94@gmail.com>
Co-authored-by: Tim <hello@timsmart.co>
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.

[Bug]: Money moves tracking isn't undone on ctrl+z
4 participants