-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add Reconcile button on the account page. #3684
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey 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
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey 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
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
Does the menu still need to have the reconcile option if there is a big button for it now? |
I guess not! :) I will update code as soon I'm back from work |
Seems good to me. Just need to get the conflicts taken care of. Could you add in the translation to the button? It looks like that file was ready for translation, so we need to keep that. |
One quick question, any reason to have a big primary button instead of an icon button? Just thinking that not everyone uses reconciliation, and it fits better with the existing icon buttons. I could imagine a lock-and-key icon, for example? Then it could also be inline with the other buttons instead of floating above |
I'll edit the translation as soon as possible and check for the conflicts |
bf75d56
to
0d9528e
Compare
WalkthroughThe pull request introduces modifications to the Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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/accounts/Header.jsx (2)
262-264
: Enhance accessibility by managing focus within the Reconcile popoverWhen the
Popover
opens, setting the initial focus to the first interactive element withinReconcileMenu
improves keyboard navigation and accessibility for users.Ensure that the
ReconcileMenu
component handles focus appropriately, possibly by adding anInitialFocus
wrapper:<Popover /* existing props */ > <InitialFocus> <ReconcileMenu account={account} onClose={() => setReconcileOpen(false)} onReconcile={onReconcile} /> </InitialFocus> </Popover>
318-318
: Maintain consistent styling by avoiding inline stylesThe inline
style={{ padding: 6 }}
on the<Button>
component may lead to inconsistent styling across the application.Consider using a predefined style or class to maintain consistency:
- style={{ padding: 6 }} + className="button-padding"And define the style in your stylesheet:
.button-padding { padding: 6px; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (44)
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/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/reports.test.js-snapshots/Reports-loads-net-worth-and-cash-flow-reports-1-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
upcoming-release-notes/3684.md
is excluded by!**/*.md
📒 Files selected for processing (1)
- packages/desktop-client/src/components/accounts/Header.jsx (5 hunks)
🧰 Additional context used
🔇 Additional comments (1)
packages/desktop-client/src/components/accounts/Header.jsx (1)
274-279
: Verify theonOpenChange
handler in thePopover
componentThe
onOpenChange
prop may receive the new open state as an argument. To correctly update thereconcileOpen
state, ensure the handler accounts for this.Check the
Popover
component's API to confirm. IfonOpenChange
provides the new state, update the handler as follows:- onOpenChange={() => setReconcileOpen(false)} + onOpenChange={(open) => setReconcileOpen(open)}This change ensures that the
reconcileOpen
state accurately reflects the popover's open status.
@@ -256,6 +259,31 @@ export function AccountHeader({ | |||
onChange={onSearch} | |||
inputRef={searchInput} | |||
/> | |||
<View style={{ marginLeft: 16 }} title={t('Reconcile')}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the title
attribute to the Button
component for correct tooltip display
The title
attribute on the <View>
component may not render a tooltip as expected. To ensure the tooltip appears when a user hovers over the button, move the title
attribute to the <Button>
component.
Apply this diff to fix the issue:
- <View style={{ marginLeft: 16 }} title={t('Reconcile')}>
+ <View style={{ marginLeft: 16 }}>
<Button
+ title={t('Reconcile')}
ref={reconcileRef}
variant="bare"
aria-label={t('Reconcile')}
onPress={() => {
setReconcileOpen(true);
}}
>
<SvgLockClosed width={13} height={13} />
</Button>
Alternatively, consider using a Tooltip
component if available in your UI library for better consistency and flexibility.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
<View style={{ marginLeft: 16 }} title={t('Reconcile')}> | |
<View style={{ marginLeft: 16 }}> | |
<Button | |
title={t('Reconcile')} | |
ref={reconcileRef} | |
variant="bare" | |
aria-label={t('Reconcile')} | |
onPress={() => { | |
setReconcileOpen(true); | |
}} | |
> | |
<SvgLockClosed width={13} height={13} /> | |
</Button> |
There was a problem hiding this 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/loot-core/src/server/budget/actions.ts (1)
34-37
: LGTM! Consider using template literals for SQL query.The SQL query formatting improvement enhances readability. For consistency with other parts of the codebase, consider using template literals for the SQL query.
You could refactor the SQL query to use template literals like this:
- const budgetType = db.firstSync( - `SELECT value FROM preferences WHERE id = ?`, - ['budgetType'], - ); + const budgetType = db.firstSync(` + SELECT value FROM preferences WHERE id = ? + `, ['budgetType']);
sorry for this other mistake! I don't use those pages often and totally missed it. now should all be fixed :) |
Looks great now! |
There was a problem hiding this 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 (2)
packages/desktop-client/src/components/accounts/Header.tsx (2)
372-403
: Enhance accessibility for the Reconcile buttonEnsure that the
aria-label
andtitle
attributes for the Reconcile button use localized strings and provide clear descriptions for assistive technologies.Consider updating the button as follows:
<Button ref={reconcileRef} variant="bare" aria-label={t('Reconcile account')} style={{ padding: 6, marginLeft: 10 }} onPress={() => { setReconcileOpen(true); }} > <View title={t('Reconcile account')}> <SvgLockClosed width={14} height={14} /> </View> </Button>
412-412
: Maintain consistency in inline stylesThe inline style
{ padding: 6 }
added to the button should be consistent with other style definitions in the component. Consider extracting this into a shared style or using theme variables for consistency.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- packages/desktop-client/src/components/accounts/Header.tsx (6 hunks)
🧰 Additional context used
🔇 Additional comments (8)
packages/desktop-client/src/components/accounts/Header.tsx (8)
185-185
: Initialization ofreconcileOpen
state is appropriateThe state variable
reconcileOpen
is correctly initialized usinguseState(false)
. This manages the visibility of the reconciliation popover efficiently.
188-188
:reconcileRef
is properly set upThe
reconcileRef
is correctly initialized withuseRef(null)
to reference the reconciliation button trigger. This will help in associating the popover with the trigger element.
372-403
: UpdateonOpenChange
to accurately reflect popover stateThe
onOpenChange
handler currently setsreconcileOpen
tofalse
regardless of the popover's new state. It's better to use theisOpen
parameter provided byonOpenChange
to keepreconcileOpen
in sync with the popover.-onOpenChange={() => setReconcileOpen(false)} +onOpenChange={(isOpen) => setReconcileOpen(isOpen)}This change ensures that
reconcileOpen
accurately reflects whether the popover is open or closed.
703-703
: Ensure no unintended changes inAccountMenu
renderingAt line 703, verify that the
return
statement inAccountMenu
hasn't been altered unintentionally. Ensure that any modifications are intentional and do not affect the rendering logic.
706-706
:onMenuSelect
handler is correctly passedThe
onMenuSelect
function is properly passed down to theMenu
component. This ensures that menu actions are handled appropriately.
96-96
: Confirm the type ofonReconcile
propThe
onReconcile
prop inAccountHeaderProps
is typed asComponentProps<typeof ReconcileMenu>['onReconcile']
. Ensure that this type aligns with the expected function signature and that all usages match this type definition.#!/bin/bash # Description: Check the definition and usage of the onReconcile prop # Find the type definition in ReconcileMenu rg 'type.*ReconcileMenuProps' packages/desktop-client/src/components/accounts/Reconcile.tsx -A 10 # Search for all usages of onReconcile rg 'onReconcile' packages/desktop-client/src/components/accounts/
372-403
: Verify the Reconcile button does not appear on aggregate account viewsWhile the Reconcile button is conditionally rendered with
{account && (...)}
, ensure thataccount
is undefined or null for aggregate views like "All accounts" or "For budget". This prevents the button from appearing where it shouldn't.#!/bin/bash # Description: Ensure account prop is null on aggregate views # Find where AccountHeader is used and check the account prop rg '<AccountHeader' packages/desktop-client/src/ -A 5 # Verify that in aggregate views, the account prop is not passed or is null
27-27
: Ensure imported icons are utilizedYou've imported
SvgLockClosed
andSvgPencil1
from the icons module. Please verify that both icons are used within this component to avoid unnecessary imports.✅ Verification successful
Imported icons are utilized as expected
Both
SvgLockClosed
andSvgPencil1
are used withinHeader.tsx
.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify usage of SvgLockClosed and SvgPencil1 in Header.tsx # Check for usage of SvgLockClosed rg 'SvgLockClosed' packages/desktop-client/src/components/accounts/Header.tsx # Check for usage of SvgPencil1 rg 'SvgPencil1' packages/desktop-client/src/components/accounts/Header.tsxLength of output: 2674
Script:
#!/bin/bash # Description: Verify usage of SvgLockClosed and SvgPencil1 in Header.tsx # Check for usage of SvgLockClosed rg 'SvgLockClosed' packages/desktop-client/src/components/accounts/Header.tsx # Check for usage of SvgPencil1 rg 'SvgPencil1' packages/desktop-client/src/components/accounts/Header.tsxLength of output: 268
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Looks good to me now, will let @youngcw take a look before we merge
…560) When I setup my actual account, I noticed that there was no reconciliation button as described in documentation. Found out after hunting, that the UI has changed resulting in this issue. I have created this PR to update that. Let me know if the language or images need to be changed. Caused because of: actualbudget/actual#3684
As mentioned on discord, it is a small quality of life feature that adds the Reconcile button directly on the account page instead of having to go to the menu.