-
Notifications
You must be signed in to change notification settings - Fork 0
Add toggle to exclude transfers between on-budget accounts #6
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Create OnBudgetTransfersToggle component similar to OffBudgetToggle - Add state management in App.tsx using localStorage - Update useActualData hook to accept and pass excludeOnBudgetTransfers parameter - Update transformToWrappedData to filter on-budget transfers based on toggle state - Add comprehensive test cases for the new toggle behavior - Transfers from on-budget to off-budget accounts always remain included
✅ Deploy Preview for actual-wrapped ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
- Wrapped OffBudgetToggle, OnBudgetTransfersToggle, and CurrencySelector within a new SettingsMenu component for improved organization. - Adjusted CSS for CurrencySelector, OffBudgetToggle, and OnBudgetTransfersToggle to ensure proper alignment and spacing within the SettingsMenu. - Introduced new SettingsMenu component with toggle functionality and animations for better user experience.
- Introduced OffBudgetTransfersToggle component to manage the inclusion of off-budget transfers in the application. - Updated App component to handle new state management for off-budget transfers, including localStorage integration. - Refactored existing OnBudgetTransfersToggle to align with the new naming convention and functionality. - Adjusted data fetching and transformation logic to accommodate the new toggle state. - Enhanced CSS for OffBudgetTransfersToggle for consistent styling and positioning within the UI.
…ndling - Updated comments for clarity regarding the collection of transfer transactions. - Enhanced logic to exclude starting balance transfers from regular transactions. - Adjusted processing flow to ensure transfers are included in both transfer and regular transactions based on toggle states.
- Renamed OffBudgetTransfersToggle to AllTransfersToggle for clarity and updated its functionality to manage all transfer types. - Adjusted state management in App component to handle the inclusion of all transfers, integrating localStorage for persistence. - Updated OnBudgetTransfersToggle to disable when all transfers are included, ensuring consistent user experience. - Refactored data transformation logic to accommodate the new toggle state, enhancing the handling of transfer transactions. - Enhanced CSS for the new toggle to maintain consistent styling and user interaction.
… and SettingsMenu components - Created comprehensive test cases for OffBudgetTransfersToggle to verify rendering, toggle functionality, and accessibility attributes. - Developed tests for OnBudgetTransfersToggle, including its disabled state behavior and interaction with keyboard events. - Implemented tests for SettingsMenu to ensure proper rendering, toggle functionality, and interaction with child components. - Enhanced data transformation tests to reflect changes in transfer handling based on toggle states, ensuring accurate calculations for on-budget and off-budget transfers.
…ADME.md - Updated `fetchData` and `refreshData` functions to include additional parameters for filtering off-budget transactions, on-budget transfers, and cross-account transfers. - Introduced `retransformData` function to allow re-processing of data with new filter settings without reloading from the file. - Expanded `transformToWrappedData` function to support new filtering options and updated its usage examples. - Enhanced README.md to reflect new flexible filtering capabilities and currency override feature, improving user guidance on application functionality.
- Enhanced transfer handling in `transformToWrappedData` to automatically label transfers with destination account names, improving clarity in categories and payees. - Grouped multiple transfers to the same account together in both categories and payees for better organization. - Updated `AGENTS.md` and `README.md` to reflect new transfer labeling features, enhancing user documentation. - Added unit tests to verify correct transfer labeling and grouping behavior in various scenarios.
- Renamed "On-Budget Transfers" to "Budgeted Transfers" for clarity in the user interface and documentation. - Adjusted default settings in the App component to enable "Include Budgeted Transfers" by default. - Enhanced data transformation logic to ensure accurate filtering of transfer transactions based on updated toggle states. - Updated unit tests to reflect changes in transfer labeling and filtering behavior, ensuring comprehensive coverage of new functionality.
- Renamed "burgerButton" to "settingsButton" for clarity in the UI. - Updated button icon from a burger menu to a cog icon, enhancing visual representation of settings. - Adjusted related test cases to reflect the new button naming and functionality. - Revised documentation in AGENTS.md to align with updated transfer terminology, changing "On-Budget Transfers" to "Budgeted Transfers" for consistency.
- Introduced a Set to track transaction IDs from expense transactions, ensuring transfers already counted are excluded from calculations. - Updated comments for clarity on the handling of transfer transactions, specifically regarding the exclusion of already counted transfers.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds flexible transfer filtering options with a settings menu UI. Users can now control which transfers are included in their wrapped data through intuitive toggles. All settings are organized in a collapsible burger menu for a cleaner interface.
Changes
New UI Components
SettingsMenu: Burger menu component that consolidates all settings (toggles and currency selector) into a collapsible dropdown
OnBudgetTransfersToggle: Toggle to include/exclude transfers between two on-budget accounts
AllTransfersToggle: Toggle to include/exclude transfers between on-budget and off-budget accounts (on→off or off→on)
State Management
includeOnBudgetTransfersstate inApp.tsxusinguseLocalStorage(default:false)includeAllTransfersstate inApp.tsxusinguseLocalStorage(default:false)includeAllTransfersis enabled, automatically enablesincludeOnBudgetTransfersData Flow Updates
useActualDatahook to accept and pass new parameters:includeOnBudgetTransfers- controls on-budget to on-budget transfersincludeAllTransfers- controls on-budget to off-budget transfers (and auto-enables on-budget transfers)fetchData(),retransformData(), andtransformData()functionsFiltering Logic
Enhanced
transformToWrappedData()to filter transfers based on account types:Include On-Budget Transfers (
includeOnBudgetTransfers):true: Includes transfers between two on-budget accountsfalse(default): Excludes transfers between two on-budget accountsInclude All Transfers (
includeAllTransfers):true: Includes transfers between on-budget and off-budget accounts (on→off or off→on)true: Automatically enablesincludeOnBudgetTransfersfalse(default): Excludes transfers between on-budget and off-budget accountsTransfer Types:
includeOffBudgetto be true)includeOffBudgetis trueUI Improvements
Testing
OnBudgetTransfersToggle.test.tsx(12 tests)OffBudgetTransfersToggle.test.tsx(8 tests)SettingsMenu.test.tsx(9 tests)dataTransform.test.tswith new test cases (78 total tests)Documentation
README.mdwith new features and usage instructionsAGENTS.mdwith:Technical Details
The implementation identifies transfers by checking if a payee has a
transfer_acctfield. For each transfer transaction:transfer_acct)includeOnBudgetTransfers(orincludeAllTransfersif enabled)includeAllTransfersWhen toggles are enabled, transfers are included in the main transaction data flow, affecting all pages and calculations.
Files Changed
New Files:
src/components/OnBudgetTransfersToggle.tsxsrc/components/OnBudgetTransfersToggle.module.csssrc/components/OnBudgetTransfersToggle.test.tsxsrc/components/OffBudgetTransfersToggle.tsx(renamed from original, now AllTransfersToggle)src/components/OffBudgetTransfersToggle.module.csssrc/components/OffBudgetTransfersToggle.test.tsxsrc/components/SettingsMenu.tsxsrc/components/SettingsMenu.module.csssrc/components/SettingsMenu.test.tsxModified Files:
src/App.tsx- Added settings menu, new toggle states, and handlerssrc/hooks/useActualData.ts- Updated to accept and pass new parameterssrc/utils/dataTransform.ts- Enhanced filtering logic for transferssrc/utils/dataTransform.test.ts- Added comprehensive test coveragesrc/components/OffBudgetToggle.module.css- Updated for left/right alignmentsrc/components/CurrencySelector.module.css- Updated for left/right alignmentREADME.md- Added features and usage instructionsAGENTS.md- Updated function signatures and documentationTesting
All existing tests pass. New test coverage includes: