Filter Categories by Transaction Type in Forms #2082
Reference in New Issue
Block a user
Delete Branch "fix/separate-income-expense-categories"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #2016
This PR fixes a bug where transaction forms were showing all categories regardless of transaction type (income or expense).
Changes
Account::TransactionsControllerto filter categories appropriatelyImplementation Details
The implementation filters categories in the controller layer while maintaining a clean user interface for navigating between different transaction types. By moving the filtering logic to the controller and creating a shared navigation component, we've addressed the issue while also maintaining code quality.
Testing
I've manually tested the changes to verify:
https://github.com/user-attachments/assets/b3cb258e-aa21-436f-8da1-862623b5df62
Note: There were some failing tests in the suite when running the tests on my dev container, but these failures are also present on the main branch before doing any changes; therefore I assume they are unrelated to the changes in this PR.
For Discussion: Potential UI Improvements
While working on this fix, I noticed some opportunities for further improving the transaction forms:
I'd be happy to implement these improvements in a follow-up PR if you think they'd be beneficial. Great work on the app by the way!
Hey @D-Gaspa thanks for the PR! Sorry for the delayed response; we've been pretty busy prepping for launch coming up.
I think this code looks good. If you can fix those merge conflicts and get the tests passing I can get this merged.
As far as the additional improvements with the badges in the form fields, we're not quite ready for that yet. That will come down the road when we starting introducing ViewComponent into the codebase.
Hey @zachgoll! I've resolved the merge conflicts and adapted my changes to the new codebase structure.
Note: Noticed that there might need to be some tweaking done for dark mode support, but I didn't want to introduce more changes for now.