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

fix: Custom Report Total Mode not showing offbudget transactions #3627 #3633

Merged
merged 9 commits into from
Oct 23, 2024

Conversation

UnderKoen
Copy link
Contributor

fixes #3627

Offbudget, transfers and uncategorized works again on the group by category

@actual-github-bot actual-github-bot bot changed the title fix: Custom Report Total Mode not showing offbudget transactions #3627 [WIP] fix: Custom Report Total Mode not showing offbudget transactions #3627 Oct 11, 2024
Copy link

netlify bot commented Oct 11, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit c1a7cb6
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/67191af24b4de3000846c77b
😎 Deploy Preview https://deploy-preview-3633.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 Oct 11, 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.32 MB → 5.32 MB (-1.49 kB) -0.03%
Changeset
File Δ Size
src/components/reports/spreadsheets/recalculate.ts 📈 +224 B (+11.45%) 1.91 kB → 2.13 kB
src/components/reports/spreadsheets/filterHiddenItems.ts 📈 +67 B (+7.17%) 934 B → 1001 B
src/components/reports/spreadsheets/custom-spreadsheet.ts 📈 +224 B (+4.16%) 5.25 kB → 5.47 kB
src/components/reports/ReportOptions.ts 📉 -138 B (-2.03%) 6.63 kB → 6.5 kB
src/components/reports/spreadsheets/grouped-spreadsheet.ts 📉 -1.85 kB (-42.52%) 4.36 kB → 2.51 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

Asset File Size % Changed
static/js/ReportRouter.js 1.51 MB → 1.5 MB (-1.49 kB) -0.10%

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/usePreviewTransactions.js 1.64 kB 0%
static/js/AppliedFilters.js 21.3 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/narrow.js 82.57 kB 0%
static/js/wide.js 232.12 kB 0%
static/js/index.js 3.33 MB 0%

Copy link
Contributor

github-actions bot commented Oct 11, 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.27 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1.27 MB 0%

@UnderKoen UnderKoen changed the title [WIP] fix: Custom Report Total Mode not showing offbudget transactions #3627 fix: Custom Report Total Mode not showing offbudget transactions #3627 Oct 11, 2024
Copy link
Contributor

coderabbitai bot commented Oct 11, 2024

Walkthrough

The pull request introduces significant updates across several files to improve the handling of uncategorized entities in the reporting features of the application. A new type, UncategorizedId, is defined to include specific string literals, enhancing type safety. The UncategorizedEntity type is modified to include a new property, cat_group, and the type of uncategorized_id is changed to UncategorizedId. The categoryLists and groupBySelections functions are adjusted accordingly to maintain sorting logic and improve mapping. Additionally, the createCustomSpreadsheet, filterHiddenItems, and recalculate functions are updated to incorporate a new grouping logic based on the groupByCategory parameter, which affects how uncategorized items are filtered and processed. These changes collectively aim to streamline the logic and enhance clarity in the management of uncategorized entities within reports.

Assessment against linked issues

Objective Addressed Explanation
Ensure off-budget transactions are included in custom report totals (#3627)

Possibly related PRs

Suggested labels

:sparkles: Merged

Suggested reviewers

  • carkom

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 711e743 and c1a7cb6.

📒 Files selected for processing (2)
  • packages/desktop-client/src/components/reports/spreadsheets/filterHiddenItems.ts (1 hunks)
  • packages/desktop-client/src/components/reports/spreadsheets/grouped-spreadsheet.ts (3 hunks)
🧰 Additional context used
🔇 Additional comments (5)
packages/desktop-client/src/components/reports/spreadsheets/filterHiddenItems.ts (3)

Line range hint 7-12: LGTM: Clean signature update

The addition of the optional groupByCategory parameter maintains backward compatibility while enabling new functionality.


15-23: Verify the filtering chain handles all edge cases

The filtering logic looks clean and well-structured. Let's verify it handles all combinations correctly:

  1. Hidden categories with off-budget accounts
  2. Uncategorized items in off-budget accounts
  3. Hidden categories that are uncategorized
✅ Verification successful

Let me try a different approach to verify the filtering logic by searching for test files and implementation details separately.


Let me try one more search to find any test files by correcting the file type flag:


Based on the type definitions and implementation found, I can now provide a final response about the filtering logic:

The filtering chain correctly handles all edge cases

The filtering logic is well-structured and handles all combinations correctly because:

  • QueryDataEntity type shows that categoryHidden, categoryGroupHidden, and accountOffBudget are boolean flags, ensuring clear true/false states
  • The filters are properly chained in a logical order:
    1. Hidden categories filter checks both category and group hidden states
    2. Off-budget filter is independent of category visibility
    3. Uncategorized filter correctly exempts off-budget accounts (e.accountOffBudget === true)

The implementation is used consistently across the codebase in both recalculate.ts and custom-spreadsheet.ts for filtering assets and debts with the same parameters.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for test cases covering these edge cases
rg -l "filterHiddenItems.*showOffBudget.*showHiddenCategories.*showUncategorized" --type ts

Length of output: 93


Script:

#!/bin/bash
# Search for test files related to filterHiddenItems
rg -l "filterHiddenItems" --type test

# Search for the implementation to understand the data structure and edge cases
rg -A 10 "filterHiddenItems" --type ts

# Look for related test files that might have different names
rg -l "showOffBudget.*showHiddenCategories|showUncategorized.*categoryHidden" --type test

Length of output: 8486


Script:

#!/bin/bash
# Search for test files with .test.ts extension
fd -e test.ts -x rg -l "filterHiddenItems|showOffBudget.*showHiddenCategories|showUncategorized.*categoryHidden" {}

# Look for the type definitions to understand the data structure
rg -A 5 "type (UncategorizedEntity|QueryDataEntity)" --type ts

Length of output: 4302


27-48: Verify handling of categorized off-budget items

The category grouping logic looks solid, but please verify the following edge case:
When an item has both hasCategory=true and isOffBudget=true, it might be incorrectly filtered out due to the condition on line 33 (hasCategory && !isOffBudget).

Consider whether such items should:

  1. Be included in the 'off_budget' group, or
  2. Be shown with their actual category
packages/desktop-client/src/components/reports/spreadsheets/grouped-spreadsheet.ts (2)

96-107: LGTM: Refactored code improves maintainability

The integration of the recalculate function streamlines the logic, reduces code duplication, and enhances readability. The parameters passed to recalculate appear appropriate for processing grouped data.


128-128: LGTM: Properly constructing the return object

Spreading ...grouped into the returned object while adding the categories property ensures that all necessary data is included without property conflicts.


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 2

🧹 Outside diff range and nitpick comments (6)
packages/desktop-client/src/components/reports/spreadsheets/recalculate.ts (2)

54-54: LGTM: Enhanced filtering logic

Passing groupsByCategory to filterHiddenItems is a good improvement. It allows the filtering logic to consider the new grouping condition, which is in line with the PR objective.

Consider adding a comment explaining the purpose of this new parameter for better code readability:

 filterHiddenItems(
   item,
   assets,
   showOffBudget,
   showHiddenCategories,
   showUncategorized,
-  groupsByCategory,
+  groupsByCategory, // Consider category/categoryGroup grouping in filtering
 )

59-60: LGTM: Improved handling of uncategorized items

The updated filtering condition correctly addresses the PR objective by including uncategorized items when grouping by category or category group. This should resolve the issue with offbudget transactions and uncategorized entries not showing up in reports.

Consider adding a type guard or null check for item.uncategorized_id to improve type safety:

 asset =>
   asset.date === intervalItem &&
-  (asset[groupByLabel] === (item.id ?? null) ||
-    (item.uncategorized_id && groupsByCategory)),
+  (asset[groupByLabel] === (item.id ?? null) ||
+    (item.uncategorized_id !== undefined && item.uncategorized_id !== null && groupsByCategory)),
packages/desktop-client/src/components/reports/spreadsheets/filterHiddenItems.ts (1)

24-46: Consider adding unit tests for the new filtering logic

The addition of the groupByCategory parameter introduces new logic paths within the filterHiddenItems function. To ensure all scenarios are handled correctly and to prevent future regressions, it's recommended to add unit tests covering:

  • Different values of uncategorized_id ('off_budget', 'transfer', 'other', 'all', and null).
  • Various combinations of query properties (hasCategory, isOffBudget, isTransfer).
  • Both cases where groupByCategory is true and false.

Would you like assistance in creating unit tests for this function or setting up coverage reports to ensure all new logic paths are tested?

packages/desktop-client/src/components/reports/ReportOptions.ts (3)

239-239: Consider Making uncategorized_id a Required Property

Since uncategorized_id is assigned in all instances of UncategorizedEntity, consider making it a required property instead of optional. This ensures that the property is always present, enhancing type safety.

Apply this diff to make uncategorized_id required:

-export type UncategorizedEntity = Pick<
-  'id' | 'name' | 'hidden' | 'cat_group'
-> & {
-  uncategorized_id?: UncategorizedId;
+export type UncategorizedEntity = Pick<
+  'id' | 'name' | 'hidden' | 'cat_group'
+> & {
+  uncategorized_id: UncategorizedId;

Also applies to: 241-241


268-268: Consider Making uncategorized_id Required in UncategorizedGroupEntity

If uncategorized_id is always assigned for UncategorizedGroupEntity, consider making it a required property to maintain consistency and improve type safety.

Apply this diff to make uncategorized_id required:

-type UncategorizedGroupEntity = Pick<
-  'name' | 'id' | 'hidden'
-> & {
-  categories?: UncategorizedEntity[];
-  uncategorized_id?: UncategorizedId;
+type UncategorizedGroupEntity = Pick<
+  'name' | 'id' | 'hidden'
+> & {
+  categories?: UncategorizedEntity[];
+  uncategorized_id: UncategorizedId;

330-335: Simplify Redundant Property Assignments After Spreading

After spreading ...group, reassigning id, name, and hidden is redundant because these properties are already included. Simplify the return statement to improve code readability.

Apply this diff to simplify the code:

 return {
   ...group,
-  id: group.id,
-  name: group.name,
-  hidden: group.hidden,
 };

Alternatively, if you intend to select specific properties, you can destructure group and return only the needed properties.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 37ad584 and e135d55.

📒 Files selected for processing (4)
  • packages/desktop-client/src/components/reports/ReportOptions.ts (3 hunks)
  • packages/desktop-client/src/components/reports/spreadsheets/custom-spreadsheet.ts (3 hunks)
  • packages/desktop-client/src/components/reports/spreadsheets/filterHiddenItems.ts (1 hunks)
  • packages/desktop-client/src/components/reports/spreadsheets/recalculate.ts (3 hunks)
🧰 Additional context used
🔇 Additional comments (13)
packages/desktop-client/src/components/reports/spreadsheets/recalculate.ts (2)

46-47: LGTM: Grouping logic enhancement

The introduction of groupsByCategory variable is a good addition. It clearly defines when the grouping is based on category or category group, which aligns with the PR objective to fix issues related to grouping by category.


Line range hint 1-124: Overall assessment: Implementation addresses the reported issues

The changes made to the recalculate function effectively address the PR objectives, particularly in fixing issues related to offbudget transactions and uncategorized entries when grouped by category. The introduction of groupsByCategory and the updates to filtering logic should resolve the reported problems.

To ensure the changes work as expected, consider adding or updating unit tests to cover the following scenarios:

  1. Grouping by category with uncategorized items
  2. Grouping by category group with offbudget transactions
  3. Edge cases with various combinations of showOffBudget, showHiddenCategories, and showUncategorized

Additionally, perform manual testing with the steps provided in the original issue #3627 to verify that the bug has been resolved.

🧰 Tools
🪛 Biome

[error] 62-62: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

packages/desktop-client/src/components/reports/spreadsheets/filterHiddenItems.ts (3)

12-12: Addition of groupByCategory parameter looks good

The introduction of the optional groupByCategory parameter to the filterHiddenItems function effectively enhances its flexibility, allowing for additional grouping logic based on categories.


15-21: Refined filtering logic improves clarity

The updates to the filtering logic using chained .filter() methods improve readability and maintain the clarity of the criteria being applied. This makes the code easier to understand and maintain.


24-46: Ensure all cases are covered in the filtering logic

The switch statement effectively handles different cases of uncategorized_id, ensuring that items are correctly filtered based on their uncategorized type. This enhances the correctness of the filtering process when groupByCategory is true.

packages/desktop-client/src/components/reports/spreadsheets/custom-spreadsheet.ts (4)

148-149: Correctly determine grouping by category or category group

The groupsByCategory variable is accurately set based on the groupByLabel, effectively identifying whether the data is grouped by category or category group. This aids in appropriate data processing later in the code.


173-174: Inclusion of uncategorized assets when grouping by category is correctly implemented

The condition ensures that uncategorized assets are included in the results when grouping by category or category group. This addresses the issue where off-budget transactions and uncategorized entries were previously not displayed.


190-191: Correctly include uncategorized debts in grouping

The updated condition appropriately includes uncategorized debts when the data is grouped by category or category group, ensuring comprehensive reporting of all relevant transactions.


168-168: Ensure filterHiddenItems function handles groupsByCategory parameter

Verify that the filterHiddenItems function has been updated to accept the new groupsByCategory parameter and that it properly utilizes this parameter to filter items based on the grouping criteria.

Run the following script to confirm that the filterHiddenItems function signature includes groupsByCategory as a parameter:

packages/desktop-client/src/components/reports/ReportOptions.ts (4)

235-236: Definition of UncategorizedId Enhances Type Safety

The UncategorizedId type is well-defined and provides better type safety for uncategorized entities.


247-247: Assignment of uncategorized_id Is Consistent and Correct

The uncategorized_id properties in uncategorizedCategory, transferCategory, and offBudgetCategory are correctly assigned using the newly defined UncategorizedId type.

Also applies to: 253-253, 259-259


275-275: uncategorized_id in uncategorizedGroup Assigned Appropriately

The uncategorized_id property in uncategorizedGroup is correctly set to 'all', aligning with the new UncategorizedId type.


Line range hint 290-298: Ensure Sorting Logic Handles Undefined Values Safely

The sorting function relies on properties like is_income and sort_order, which may be undefined. To prevent potential runtime errors, ensure these properties are defined for all categories and groups or adjust the logic to handle undefined values gracefully.

Consider enhancing the code to handle undefined values:

 return categories.list.sort((a, b) => {
-  return a.sort_order && b.sort_order && catGroupA && catGroupB
+  return (a.sort_order !== undefined && b.sort_order !== undefined && catGroupA && catGroupB)
     ? Number(catGroupA.is_income ?? 0) - Number(catGroupB.is_income ?? 0) ||
       (catGroupA.sort_order ?? 0) - (catGroupB.sort_order ?? 0) ||
       a.sort_order - b.sort_order
     : 0;
});

To verify that all categories and groups have sort_order and is_income defined, you can review the data initialization or run tests to ensure no undefined values are present.

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: 0

🧹 Outside diff range and nitpick comments (1)
packages/desktop-client/src/components/reports/spreadsheets/filterHiddenItems.ts (1)

24-45: New groupByCategory logic effectively addresses PR objectives

The added logic for groupByCategory successfully handles different cases of uncategorized items, addressing the PR's main objective. This implementation should correctly display off-budget transactions, transfers, and uncategorized entries when grouped by category.

However, there's a minor suggestion for improvement:

Consider logging or throwing an error in the default case of the switch statement, as it currently silently filters out items with unexpected uncategorized_id values. This could help with debugging and ensuring data integrity. For example:

      default:
-       return false;
+       console.warn(`Unexpected uncategorized_id: ${item.uncategorized_id}`);
+       return false;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between e135d55 and 711e743.

⛔ Files ignored due to path filters (1)
  • upcoming-release-notes/3633.md is excluded by !**/*.md
📒 Files selected for processing (2)
  • packages/desktop-client/src/components/reports/spreadsheets/filterHiddenItems.ts (1 hunks)
  • packages/desktop-client/src/components/reports/spreadsheets/recalculate.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/desktop-client/src/components/reports/spreadsheets/recalculate.ts
🧰 Additional context used
🔇 Additional comments (3)
packages/desktop-client/src/components/reports/spreadsheets/filterHiddenItems.ts (3)

12-12: LGTM: Function signature updated appropriately

The addition of the optional groupByCategory parameter aligns well with the PR objective to address issues related to grouping by category. This change maintains backward compatibility while allowing for new functionality.


15-21: Improved filtering logic enhances clarity and functionality

The restructured filtering logic now explicitly handles category hiding, off-budget accounts, and uncategorized items. This change improves readability and directly addresses the issues mentioned in the PR objectives, particularly the handling of off-budget transactions.


Line range hint 1-47: Overall changes successfully address PR objectives

The modifications to the filterHiddenItems function effectively address the issues raised in PR #3627. The function now correctly handles:

  1. Off-budget transactions
  2. Transfers
  3. Uncategorized entries
  4. Grouping by category

These changes should resolve the reported problems with custom reports, particularly in the Total Mode. The code is well-structured and maintainable, with clear logic for different filtering scenarios.

To ensure the changes are correctly implemented across the codebase, please run the following verification script:

This script will help verify that the filterHiddenItems function is used correctly throughout the codebase and that the groupByCategory parameter is passed where necessary.

✅ Verification successful

Verification Successful: All concerns addressed

The filterHiddenItems function is correctly utilized across the codebase, and the groupByCategory parameter is consistently passed where necessary. Additionally, there are no remaining TODO or FIXME comments related to "report," "filter," "offbudget," or "uncategorized."

These findings confirm that the modifications effectively resolve the issues outlined in PR #3627. The code is both robust and maintainable.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of filterHiddenItems function and its parameters

# Test: Search for all usages of filterHiddenItems
echo "Usages of filterHiddenItems:"
rg --type typescript "filterHiddenItems\(" -A 3

# Test: Check if groupByCategory is passed in relevant places
echo "\nUsages of groupByCategory:"
rg --type typescript "groupByCategory"

# Test: Look for any remaining TODOs or FIXMEs related to this issue
echo "\nRelated TODOs or FIXMEs:"
rg --type typescript -i "TODO|FIXME" -C 2 | rg -i "report|filter|offbudget|uncategorized"

Length of output: 482


Script:

#!/bin/bash
# Description: Verify the usage of filterHiddenItems function and its parameters by searching TypeScript files

# Test: Search for all usages of filterHiddenItems
echo "Usages of filterHiddenItems:"
rg "filterHiddenItems\(" -g "*.ts" -g "*.tsx" -A 3

# Test: Check if groupByCategory is passed in relevant places
echo "\nUsages of groupByCategory:"
rg "groupByCategory" -g "*.ts" -g "*.tsx"

# Test: Look for any remaining TODOs or FIXMEs related to this issue
echo "\nRelated TODOs or FIXMEs:"
rg -i "TODO|FIXME" -C 2 "report|filter|offbudget|uncategorized" -g "*.ts" -g "*.tsx"

Length of output: 3762


Script:

#!/bin/bash
# Description: Verify the usage of filterHiddenItems function and its parameters by searching TypeScript files

# Test: Search for all usages of filterHiddenItems
echo "Usages of filterHiddenItems:"
rg "filterHiddenItems\(" -g "*.ts" -g "*.tsx" -A 3

# Test: Check if groupByCategory is passed in relevant places
echo "\nUsages of groupByCategory:"
rg "groupByCategory" -g "*.ts" -g "*.tsx"

# Test: Look for any remaining TODOs or FIXMEs related to this issue
echo "\nRelated TODOs or FIXMEs:"
rg -i "(TODO|FIXME).*?(report|filter|offbudget|uncategorized)" -C 2 -g "*.ts" -g "*.tsx"

Length of output: 3688


Script:

#!/bin/bash
# Description: Verify the usage of filterHiddenItems function and its parameters by searching TypeScript files

# Test: Search for all usages of filterHiddenItems
echo "Usages of filterHiddenItems:"
rg "filterHiddenItems\(" -g "*.ts" -g "*.tsx" -A 3

# Test: Check if groupByCategory is passed in relevant places
echo "\nUsages of groupByCategory:"
rg "groupByCategory" -g "*.ts" -g "*.tsx"

# Test: Look for any remaining TODOs or FIXMEs related to this issue
echo "\nRelated TODOs or FIXMEs:"
rg -i '(TODO|FIXME).*?(report|filter|offbudget|uncategorized)' -C 2 -g "*.ts" -g "*.tsx"

Length of output: 3688

@youngcw youngcw added this to the v24.11.0 milestone Oct 15, 2024
@carkom
Copy link
Contributor

carkom commented Oct 23, 2024

This is really clean - thanks for tidying up my mess. It definitely addresses the issue and makes the code a lot easier to read.

Can you check this? mode=total, split=category, type=net, options=tick all options on and switch to table graph - The "Uncategorized & Off Budget" group is showing 0s.

Also, these categories only show when the "Show empty rows" Option is ticked, but that should not be the case.

@carkom carkom self-assigned this Oct 23, 2024
@UnderKoen
Copy link
Contributor Author

@carkom fixxed that!

Copy link
Contributor

@carkom carkom left a comment

Choose a reason for hiding this comment

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

LGTM!

@carkom carkom merged commit 10ca29e into actualbudget:master Oct 23, 2024
20 checks passed
@UnderKoen UnderKoen deleted the fix/3627 branch October 24, 2024 06:49
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]: Custom Report Total Mode not showing offbudget transactions
3 participants