Skip to content

Conversation

@MatissJanis
Copy link
Member

@MatissJanis MatissJanis commented Jan 2, 2026

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

    • Click outside to close
    • Smooth animations for open/close
    • Accessible with proper ARIA attributes
  • OnBudgetTransfersToggle: Toggle to include/exclude transfers between two on-budget accounts

    • Supports disabled state (when "Include All Transfers" is enabled)
    • Left-aligned label, right-aligned switch
  • AllTransfersToggle: Toggle to include/exclude transfers between on-budget and off-budget accounts (on→off or off→on)

    • Automatically enables "Include On-Budget Transfers" when enabled
    • Left-aligned label, right-aligned switch

State Management

  • Added includeOnBudgetTransfers state in App.tsx using useLocalStorage (default: false)
  • Added includeAllTransfers state in App.tsx using useLocalStorage (default: false)
  • State persists across page reloads via localStorage
  • When includeAllTransfers is enabled, automatically enables includeOnBudgetTransfers

Data Flow Updates

  • Updated useActualData hook to accept and pass new parameters:
    • includeOnBudgetTransfers - controls on-budget to on-budget transfers
    • includeAllTransfers - controls on-budget to off-budget transfers (and auto-enables on-budget transfers)
  • Updated fetchData(), retransformData(), and transformData() functions
  • Transfers are now included in the main transaction data when toggles are enabled (affects all pages)

Filtering Logic

Enhanced transformToWrappedData() to filter transfers based on account types:

  • Include On-Budget Transfers (includeOnBudgetTransfers):

    • When true: Includes transfers between two on-budget accounts
    • When false (default): Excludes transfers between two on-budget accounts
  • Include All Transfers (includeAllTransfers):

    • When true: Includes transfers between on-budget and off-budget accounts (on→off or off→on)
    • When true: Automatically enables includeOnBudgetTransfers
    • When false (default): Excludes transfers between on-budget and off-budget accounts
  • Transfer Types:

    • On-budget → On-budget: Controlled by "Include On-Budget Transfers" toggle
    • On-budget → Off-budget: Controlled by "Include All Transfers" toggle
    • Off-budget → On-budget: Controlled by "Include All Transfers" toggle (requires includeOffBudget to be true)
    • Off-budget → Off-budget: Included when includeOffBudget is true

UI Improvements

  • All toggles and currency selector consolidated into a settings menu
  • Left-aligned labels, right-aligned controls for better readability
  • Consistent styling across all toggle components
  • Improved spacing and layout

Testing

  • Added comprehensive unit tests for all new components:
    • OnBudgetTransfersToggle.test.tsx (12 tests)
    • OffBudgetTransfersToggle.test.tsx (8 tests)
    • SettingsMenu.test.tsx (9 tests)
  • Updated dataTransform.test.ts with new test cases (78 total tests)
  • All tests passing (237 total tests)

Documentation

  • Updated README.md with new features and usage instructions
  • Updated AGENTS.md with:
    • New function signatures and parameters
    • Detailed filtering behavior documentation
    • Updated examples showing new parameters

Technical Details

The implementation identifies transfers by checking if a payee has a transfer_acct field. For each transfer transaction:

  1. Determines source account (from transaction)
  2. Determines destination account (from payee's transfer_acct)
  3. Checks account types (on-budget vs off-budget)
  4. Applies filtering based on toggle states:
    • On-budget → On-budget: Uses includeOnBudgetTransfers (or includeAllTransfers if enabled)
    • On-budget ↔ Off-budget: Uses includeAllTransfers

When toggles are enabled, transfers are included in the main transaction data flow, affecting all pages and calculations.

Files Changed

New Files:

  • src/components/OnBudgetTransfersToggle.tsx
  • src/components/OnBudgetTransfersToggle.module.css
  • src/components/OnBudgetTransfersToggle.test.tsx
  • src/components/OffBudgetTransfersToggle.tsx (renamed from original, now AllTransfersToggle)
  • src/components/OffBudgetTransfersToggle.module.css
  • src/components/OffBudgetTransfersToggle.test.tsx
  • src/components/SettingsMenu.tsx
  • src/components/SettingsMenu.module.css
  • src/components/SettingsMenu.test.tsx

Modified Files:

  • src/App.tsx - Added settings menu, new toggle states, and handlers
  • src/hooks/useActualData.ts - Updated to accept and pass new parameters
  • src/utils/dataTransform.ts - Enhanced filtering logic for transfers
  • src/utils/dataTransform.test.ts - Added comprehensive test coverage
  • src/components/OffBudgetToggle.module.css - Updated for left/right alignment
  • src/components/CurrencySelector.module.css - Updated for left/right alignment
  • README.md - Added features and usage instructions
  • AGENTS.md - Updated function signatures and documentation

Testing

All existing tests pass. New test coverage includes:

  • Component rendering and interactions
  • Toggle state management
  • Keyboard navigation
  • Disabled state handling
  • Menu open/close behavior
  • Click outside handling
  • Transfer filtering logic across all scenarios

- 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
@netlify
Copy link

netlify bot commented Jan 2, 2026

Deploy Preview for actual-wrapped ready!

Name Link
🔨 Latest commit f61b576
🔍 Latest deploy log https://app.netlify.com/projects/actual-wrapped/deploys/69584e5d46c1ad0008deed8c
😎 Deploy Preview https://deploy-preview-6--actual-wrapped.netlify.app
📱 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 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.
@MatissJanis MatissJanis marked this pull request as ready for review January 2, 2026 22:58
- 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.
@MatissJanis MatissJanis merged commit ca9477c into main Jan 3, 2026
8 checks passed
@MatissJanis MatissJanis deleted the matiss/add-on-budget-transfers-toggle branch January 3, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants