-
-
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
🐛 (dashboards) save cash flow balance setting #3745
base: master
Are you sure you want to change the base?
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
|
WalkthroughThe pull request introduces modifications to the Assessment against linked issues
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: 0
🧹 Outside diff range and nitpick comments (2)
packages/loot-core/src/types/models/dashboard.d.ts (1)
40-40
: LGTM! Consider adding JSDoc documentation.The type definition is correct and properly integrated. The optional boolean property aligns with the PR's objective to persist the balance line setting.
Consider adding JSDoc documentation to describe the property's purpose:
+ /** Whether to show the balance line in the cash flow graph */ showBalance?: boolean;
packages/desktop-client/src/components/reports/reports/CashFlow.tsx (1)
163-163
: LGTM! Consider adding type safety.The addition of
showBalance
to widget metadata correctly implements the persistence requirement. However, consider adding runtime type checking for the metadata object to prevent potential issues.meta: { - ...(widget.meta ?? {}), + ...(widget?.meta ?? {}), conditions, conditionsOp, timeFrame: { start, end, mode, }, showBalance, },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
upcoming-release-notes/3745.md
is excluded by!**/*.md
📒 Files selected for processing (2)
- packages/desktop-client/src/components/reports/reports/CashFlow.tsx (2 hunks)
- packages/loot-core/src/types/models/dashboard.d.ts (1 hunks)
🔇 Additional comments (2)
packages/desktop-client/src/components/reports/reports/CashFlow.tsx (2)
93-95
: LGTM! State initialization aligns with PR objective.The initialization of
showBalance
from widget metadata with a fallback totrue
is well-implemented, ensuring backward compatibility while fixing the persistence issue.
93-95
: Verify implementation completeness.The changes implement a complete cycle of reading and writing the
showBalance
setting, addressing the core issue. Let's verify there are no other instances that need similar updates.Also applies to: 163-163
✅ Verification successful
Let me gather more information about the widget metadata updates to ensure completeness.
Implementation is complete and consistent with other widgets
The verification confirms that:
- The
showBalance
setting follows the same pattern as other widget metadata persistence (e.g., conditions, timeFrame, name)- The implementation is consistent with similar features in other widgets (NetWorth, Spending) that also use
widget?.meta?.
pattern- The metadata updates are properly handled through the 'dashboard-update-widget' action
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for other potential places where widget settings might need similar persistence updates # Test 1: Look for other useState initializations that might need similar metadata persistence echo "Checking for other potential widget settings that might need persistence..." rg "useState\(true\)" --type ts # Test 2: Look for other widget metadata updates to ensure consistent patterns echo "Checking for other widget metadata update patterns..." rg "dashboard-update-widget.*meta:" --type ts # Test 3: Look for CashFlow related types to ensure they're updated echo "Checking CashFlow related type definitions..." rg "type.*CashFlow.*Widget" --type tsLength of output: 1770
Script:
#!/bin/bash # Look for widget metadata handling patterns in CashFlow related files echo "Checking CashFlow widget metadata handling..." rg "meta" -A 3 -B 3 packages/desktop-client/src/components/reports/reports/CashFlow.tsx # Look for dashboard widget update patterns echo "Checking dashboard widget update patterns..." ast-grep --pattern 'dispatch($$$"dashboard-update-widget"$$$)' # Check for other widget state persistence patterns echo "Checking other widget state persistence..." rg "widget\?\.meta\?\." --type tsLength of output: 3194
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.
LGTM!
Closes #3671
It doesn't actually affect the widget in the dashboard page though... but now the state of it will be saved in the "inner" pages.