Toolkit-for-ynab: [FEATURE REQUEST] Report Screen option "View Zero as Empty" doesn't work for "Toolkit Reports" screen.

Created on 1 Feb 2020  路  5Comments  路  Source: toolkit-for-ynab/toolkit-for-ynab

Describe the bug
Report Screen option "View Zero as Empty" doesn't work for "Toolkit Reports" screen.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Settings'
  2. Click on 'General'
  3. Enable 'Toolkit Reports'
  4. Click on 'Reports Screen'
  5. Enable 'View Zero as Empty'
  6. Go to YNAB 'Toolkit Reports' page
  7. Go to 'Income vs. Expense' tab

Expected behavior
The 'zero' cell are empty, like in the YNAB 'Reports' screen.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version 79

Setting Export
Please replace the text below with your exported Toolkit settings. You can export these by going to the Toolkit Options page, click the Import/Export Settings button at the bottom left and copying the text in the modal which appears.

[{"key":"AccountsDisplayDensity","value":"2"},{"key":"AccountsEmphasizedOutflows","value":true},{"key":"AccountsStripedRows","value":true},{"key":"AutoDistributeSplits","value":false},{"key":"AutoEnableRunningBalance","value":true},{"key":"AutomaticallyMarkAsCleared","value":false},{"key":"BetterScrollbars","value":"0"},{"key":"BudgetCategoryFeatures","value":true},{"key":"BudgetProgressBars","value":"0"},{"key":"BudgetQuickSwitch","value":true},{"key":"BudgetSpendingGoal","value":true},{"key":"BulkManagePayees","value":false},{"key":"CalendarFirstDay","value":"1"},{"key":"CategoryActivityCopy","value":false},{"key":"CategoryActivityPopupWidth","value":"0"},{"key":"CategorySoloMode","value":"0"},{"key":"ChangeEnterBehavior","value":false},{"key":"ChangeMemoEnterBehavior","value":false},{"key":"CheckCreditBalances","value":false},{"key":"CheckNumbers","value":false},{"key":"ClearSelection","value":false},{"key":"CollapseSideMenu","value":false},{"key":"ColourBlindMode","value":false},{"key":"CompactIncomeVsExpense","value":true},{"key":"CreditCardEmoji","value":true},{"key":"CurrentMonthIndicator","value":true},{"key":"CustomFlagNames","value":false},{"key":"DateOfMoney","value":false},{"key":"DaysOfBuffering","value":true},{"key":"DaysOfBufferingDate","value":false},{"key":"DaysOfBufferingHistoryLookup","value":"3"},{"key":"DeselectTransactionsOnSave","value":true},{"key":"DisableToolkit","value":false},{"key":"DisplayTargetGoalAmount","value":"3"},{"key":"DisplayTotalMonthlyGoals","value":true},{"key":"DisplayUpcomingAmount","value":false},{"key":"EasyTransactionApproval","value":false},{"key":"EditAccountButton","value":"0"},{"key":"EnlargeCategoriesDropdown","value":true},{"key":"EnterToMove","value":false},{"key":"FilterCategories","value":true},{"key":"GoalIndicator","value":true},{"key":"GoalWarningColor","value":true},{"key":"GoogleFontsSelector","value":"2"},{"key":"HideAccountBalancesType","value":"0"},{"key":"HideAgeOfMoney","value":true},{"key":"HideClosedAccounts","value":false},{"key":"HideHelp","value":true},{"key":"HideReferralBanner","value":true},{"key":"HideTotalAvailable","value":true},{"key":"HighlightNegatives","value":true},{"key":"ImportNotification","value":"0"},{"key":"IncomeFromLastMonth","value":"1"},{"key":"IncomeVsExpenseHoverHighlight","value":true},{"key":"LargerClickableIcons","value":true},{"key":"LinkToInflows","value":false},{"key":"MonthlyNotesPopupWidth","value":"0"},{"key":"NavDisplayDensity","value":"2"},{"key":"NotesAsMarkdown","value":false},{"key":"POSStyleCurrencyEntryMode","value":false},{"key":"Pacing","value":"0"},{"key":"PrintingImprovements","value":false},{"key":"PrivacyMode","value":"2"},{"key":"QuickBudgetWarning","value":true},{"key":"ReconciledTextColor","value":"0"},{"key":"RemovePositiveHighlight","value":true},{"key":"RemoveZeroCategories","value":false},{"key":"ResizeInspector","value":true},{"key":"ResizeSidebar","value":true},{"key":"RightClickToEdit","value":true},{"key":"RowHeight","value":"0"},{"key":"RowsHeight","value":"3"},{"key":"RunningBalance","value":"1"},{"key":"SeamlessBudgetHeader","value":false},{"key":"SetMultipleFlags","value":false},{"key":"ShowCategoryBalance","value":false},{"key":"SpareChange","value":false},{"key":"SplitKeyboardShortcut","value":true},{"key":"SplitTransactionAutoAdjust","value":true},{"key":"SquareNegativeMode","value":true},{"key":"StealingFromFuture","value":true},{"key":"SwapClearedFlagged","value":false},{"key":"TargetBalanceWarning","value":true},{"key":"ToBeBudgetedWarning","value":true},{"key":"ToggleMasterCategories","value":false},{"key":"ToggleSplits","value":false},{"key":"ToggleTransactionFilters","value":"0"},{"key":"ToolkitReports","value":true},{"key":"TransactionGridFeatures","value":true},{"key":"ViewZeroAsEmpty","value":true},{"key":"l10n","value":"0"},{"key":"options.dark-mode","value":false}]
fixed in master (next release) good first issue

Most helpful comment

I don't think you'd have to worry about whether the reports page is visible or not. In the render for the values, you can just check a global object window.ynabToolKit.options.ViewZeroAsEmpty.

If that's true, we should just render an empty currency cell, if false, do things as we do now.

All 5 comments

This isn't actually a bug since the feature isn't meant for the Toolkit Reports -- it's meant for the normal reports. Though I agree it would make sense to respect the setting in Toolkit Reports.

Relabelled as FEATURE REQUEST after @joshmadewell comment.

Hey @joshmadewell - I wanted to jump in and work on this issue, however, I think there's some assumptions I should validate with you before I start blindly hacking.

I had two approaches in mind:

  1. In the view-zero-as-empty feature, run the same operation to hide cells on the Toolkit Income v Expense report
  2. Check if the view-zero-as-empty feature is active in the MonthlyTransactionTotalsTable component and only render non-zero cells.

Problems with the above:

  1. I can't see a reliable way to determine whether the toolkit report page is active (since it doesn't cause a route change and the url stays the same)
  2. It looks like the user settings are sandboxed away from the toolkit report pages in React.

Let me know how you think this problem could be approached, I'd love to contribute.

I don't think you'd have to worry about whether the reports page is visible or not. In the render for the values, you can just check a global object window.ynabToolKit.options.ViewZeroAsEmpty.

If that's true, we should just render an empty currency cell, if false, do things as we do now.

That's so much better, thank you @3stacks and @joshmadewell

Was this page helpful?
0 / 5 - 0 ratings