-
Notifications
You must be signed in to change notification settings - Fork 802
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
Register preference "Jump behaviour when there are multiple accounts" #1657
base: stable
Are you sure you want to change the base?
Conversation
This is incomplete because the preferences dialog doesn't support enums. I think it should be an enum so that other options could be added later. Proposed "display a menu" behaviour could be one of these options (or become the default). There are no other existing preferences that are handled as real enums. Where there are enums they're implemented as groups of related boolean options where only one is expected to be enabled at any one time. Please advise on how this preference should be implemented:
I'd have to implement support in the preferences dialog for some of these and I don't want to do that until I know which type should be used (because I'm only going to add support for one of them). The preference can be configured manually with |
In some ways this is related to my proposal for a more "aggressive" split-transaction match in reports (instead of just showing "split transaction") in PR #1637, but my logic there goes beyond smaller or bigger. It follows the following selection tree:
Note that this is in addition to the trading account splits which are already ignored (both in the reports as well as here in the Jump feature). Now in my PR I say that while this would be good in a report, we certainly don't want to show that "best guess" matching split as the register transfer account because unlike a report, the register also allows to change the info right in that view. If I have more than one split, it's not safe to change that info in the limited transaction view, it should be done in the split view. Hence why my proposal is for reports only. But here we are not changing but jumping. Yet I think we should ask ourselves whether or not it's risky to allow jumping from a multisplit transaction without the user going in the split view and having a full understanding of the transaction. Since it's not the default option, possibly it's OK to offer it. Regardless, another alternative of doing nothing for the default option would be to at least display a message inviting the user to repeat the jump from the split view. I imagine a new user might be confused with the current situation, as to why some transactions are jumping while others are not, and this message would explain the reason (instead of making it look like it's broken). |
There are two options here:
The second option would be more consistent with how GnuCash normally behaves. |
#2 would be my choice. Consistency is good. |
e909bf6
to
8072026
Compare
I've added remember-able warnings. I've also had to change the existing behaviour. If you expand a transaction and "jump" on a split that refers to the current account, it will now do nothing and not tell you. Previously it would jump to the other account if it was a transaction with only two splits, but that is inconsistent with splits for other accounts and how splits on transactions that have three or more splits behave. |
I need this as my default behaviour because I don't want to have to expand multiple stock transactions to jump to the individual stocks just because there's a third split for fees. Other people will want different default behaviour, which is why it's a preference. |
Yes in the case of the stock transaction with a fee then my decision tree would still be unable to pick it. Still the decision tree is relevant I think. Even for your options, I assume when you say "split with largest/smallest value" you mean split on the opposite side (as it would be with your stock transaction example). I haven't looked at the code yet, just trying to figure out how we want it to behave. So taking this more complex splits; somebody bough a movie ticket and some food with a debit card and also left a tip in cash with the food:
Now when I am on Checking Account and jumping, with "Use the split with the smallest value" selected, I assume you want it to jump to Entertainment, not Cash in Wallet. Hence the "only jump to split to the other side" is probably always true regardless of option. So then we are left with same value. Should that not take priority over "smaller" or "bigger"? Consider this transaction:
When selecting "Use the split with the smallest value" does it make really make sense to jump to Entertainment from Checking considering Dining is a direct match? Same with "Use the split with the largest value", does it really make sense to jump to Dining from Cash in Wallet instead of the exact match in Entertainment? Hence at the end possibly the way you put it together is the rules I have set:
Then what about other options such as matching the closest value instead of smallest or biggest? Doesn't that make more sense in most cases anyway? At the end you are still left with an inability to match when you have 2 or more equals values, either as a direct match or smallest/biggest/closest. I don't see what you would do in these cases.
|
8072026
to
76c4eb3
Compare
No, it must be for a different account; the side is irrelevant.
No, they are the smallest.
No, because this is the "use the [first] split with the largest/smallest value" option. Exact matches and closest value on the opposite side would be a different option. The current account may also have a split on both sides. It is not easy to cover all cases and pick the right split in all cases. Either a menu or a multiple-choice orderable set of preference rules is needed for more complex cases. This change is to add an easily understood option that will work in some scenarios that doesn't change the default behaviour.
I have now added the word "first" to the name to make this clear. That should be the first split in the order displayed. |
Instead of using heuristics to guess the desired target account, how about a keyboard-accessible popup to choose one? See |
The aim is that jump works for these transactions without any extra steps. I know some people want a menu, that's why it's configurable. |
76c4eb3
to
9db14a5
Compare
@Bob-IT Any comments? |
GtkRadioButtons are special GtkToggleButtons. They're boolean. You can write a wrapper class that creates N radio buttons given a set of enums and presents a nice API to return one of the enums when queried. You can with less effort do the same with GtkComboBox. If you really want to do that be sure to write the wrappers so that they'll migrate easily to Gtk4, we'll probably be forced to migrate in the next 2-3 years. The HIG requirement about using a radio group for fewer than 6 choices is I think a good one, so a GtkRadioButton is better for the current PR. Writing code on speculation that it might be useful someday is a waste of time now because it's not used and a waste of time later because it will bitrot and have to be fixed when someone decides to use it. |
Will have a look after Christmas. |
Had a look at this today and it does not work. I am getting the following in the trace file...
The simplest solution would be to add an entry for each radio button in the scheme file just like 'Preference/Accounts/Reverse Balanced Accounts' but it would mean you would have to retrieve a max of 2 entries to know the correct value. As mentioned by @jralls, a |
9db14a5
to
fe39cfc
Compare
If you've selected a split for this account, for consistency with selecting the split of another account we should do nothing. You're already on the account for the split you selected. Previously it would still go to the "other" account but that's going to make the "multiple split" options confusing.
fe39cfc
to
6ad4077
Compare
The "=" in the widget name will separate the pref name from the enum string value that is used when the radio button is activated. When the radio button is deactivated, its preference update is ignored because another button must have been made active.
Make the behaviour when the "Jump" operation encounters a transaction with multiple splits configurable. This can be configured as: * Do nothing (this is the default) * Use the split with the largest value * Use the split with the smallest value This makes it much easier to jump between accounts for stock transactions that include splits for fees and taxes, or dividend transactions that have a zero value split for the stock account.
There may be multiple splits but only one other account. In this scenario we can jump to the first split for that account.
All existing dialogs are either QUESTION or WARNING. Allow INFO, ERROR and OTHER to remember being dismissed without asking a question.
6ad4077
to
1b7e87e
Compare
Configuring the preference hadn't been fully implemented yet. I'm now using
I've been able to map the existing radio buttons to the enum values, so no additional wrapper is needed. |
@Bob-IT this is now ready for review |
Make the behaviour when the "Jump" operation encounters a transaction with multiple splits configurable.
This can be configured as:
This makes it much easier to jump between accounts for stock transactions that include splits for fees and taxes, or dividend transactions that have a zero value split for the stock account.
Edit: The aim is that jump works for these transactions without any extra steps. Making this configurable allows different options to be added in the future (such as a menu, which I don't want to use myself). I will not be implementing those options.
I have also detected the case where there are only splits involving one other account so we can jump to that, added warnings, and now prevent all jumping to the current register by selecting one of its splits.
Example expanded transaction register rows for: