-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[WIP] Auto-fill empty split transaction with outstanding amount on click. #1271
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey 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
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey 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
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
I'm not 100% sure why some of the tests are failing, certainly the function shouldn't even be getting called for |
Would it be simpler to just initialize the amount to the remaining split balance when the row is created? The user can always overwrite it with a different amount, so there's no added work if that's not the amount they wanted there. |
Interesting idea! I'll give that a try but I think that there might be a situation where it thinks you're done and saved the transaction, e.g. if you click away and back into the box, and some people might click 'add add add' if they know they want three splits in which case we'd have to handle that somehow Because the add split and save button are the same and switch according to when you've totalled it |
You're right about the button location being overloaded; that might be a problem. This would require entering splits one at a time, unless both the Add Split and Save buttons remained visible. Maybe instead, since you've already made the Remaining Amount clickable, it could function as Add Split with the amount pre-populated? Clicking away from a split in-progress doesn't seem to be an issue in simple testing; since there's no Category assigned on the new line yet, it doesn't automatically save it. |
I'll give that way a go too! (hopefully get a chance this weekend). But i will say i'm hesitant to 'change' the function of existing add/save buttons (due to muscle memory) and also as there is no way to 'undo' a split i'd he hesitant for that new button to add one for you, as the button won't say that its about to do that. At the moment its quite 'safe' as it wont overwrite a value you've input, won't add a new split for you, so the worst it can do is fill a value you dont want, |
Didnt even clock that button! I was thinking about the other issue where you can't unselect the split category. But I certainly like the sound of the hybrid approach!! That could be the winner, I will try that out later 👍 |
@j-f1 Any thoughts? |
May I suggest an extension of this that I've wanted for a long time and actually have started implementing myself: Instead of only filling the last one, I think it should automatically distribute between all the splits that are zero. So, if, for a 20€ transaction, I want to split 3€ to category A, and then the remaining balance 50/50, I'd add three splits, fill the first with 3€ (so the other two splits are still 0) and then click the label to have the two empty splits be auto-filled with 8.50€ each. My use case, which I assume is quite common, is splitting bills with friends or partners. I have a lot of transactions that I split 50/50 to a reimbursement category, and I always have to calculate the amounts in my head and then manually fill them in, which is very tedious. The mechanic would then work like this:
|
Good idea! Sorry I haven't had a chance to work on this PR this week, hopefully tomorrow i'll get some time. But I really like this approach, as it covers off most scenarios you could want. |
Most of the time I try to click the button to add the remainder, the shown value stays at 0. The value was added, it just still shows zero in the cell. If the transaction is added then the right values are shown. It has worked for me if I wasn't currently editing the amount cell. |
I thought I fixed that issue!… I’ll double check yes if you’re currently inside a cell it doesn’t refresh the value unless you cancel that edit or click away from it! But it does update under the surface. I need to figure out a way to push the update through to the GUI |
} | ||
|
||
// cancel focused field | ||
tableNavigator.onEdit(null, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seemed to work in my initial tests.....
Looks like |
} | ||
|
||
// cancel focused field | ||
tableNavigator.onEdit(null, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of doing tableNavigator.onEdit(null, null);
, could you try passing an error: null
on the above onSave
call? I imaging that should prevent the TransactionError
split component to render.
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This PR was closed because it has been stalled for 5 days with no activity. |
I quite liked this idea suggested on the discord so i had a go at it.
The idea is if you've entered a bunch of splits and have X amount left, you can click that value to fill the amount for your final split.
Disclaimer: This doesn't work,I'm not sure how to get the editor/cell to 'refresh' with my value once i've set it!I'll also see about adding a tooltip to explain what it does when you hover over it.
Help much appreciated!!