Skip to content

Bulk importer for Fava #1944

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Bulk importer for Fava #1944

wants to merge 2 commits into from

Conversation

umangv
Copy link

@umangv umangv commented Jan 7, 2025

This is my first pass at making a bulk importer for Fava.

I find that one of the slowest parts of importing multiple transactions is that there's a lot of visual jumping. You have to look at the payee/narration, then jump to the postings, see if those make sense, sometimes you may need other hints (like the date or the amounts) before you're sure. Once you click next, you start over.

By grouping transactions by their "target account" (i.e., the "interesting" posting, where the "uninteresting" posting is the one that involves the account you are importing into), it's much easier to visually scan through the importer, catch problems, and make changes.

Known issues that I will address before converting from "draft" to "ready":

  • lint/test issues

Known issues that I hope to address (either in this PR or in a follow up):

  • Check boxes don't honor shift-clicks to select a range
  • Doesn't use Svelte v5 runes. I tried migrating the current code to Svelte runes but it got nasty because the imports grouped by target account objects had references to items in the original entries array and the runes magic broke those references. This might be fixable with $state.raw() but I haven't experimented.

Nice to haves that I also hope to work on in the future:

  • A drag and drop interface for moving transactions (either individually, or all selected transactions) to different sections.

umangv and others added 2 commits January 6, 2025 21:09
This is my first pass at making a bulk importer for Fava.

Known issues that I hope to address:
 * Checkboxes don't honor shift-clicks to select a range
 * Doesn't use Svelte v5 runes.

Nice to haves that I also hope to work on in the future:
 * A drag and drop interface for moving transactions (either
   individually, or all selected transactions).
@yagebu
Copy link
Member

yagebu commented May 26, 2025

Hi, thanks for creating a PR. The import modal gradually evolved from a time when there wasn't a whole lot of frontend-rendered code and we IMHO do not stick to that "a single dialog with a single entry at once". So I'd be fine with switching to an UI that renders them in bulk.

Do you still plan to get this PR into a reviewable state?

Doesn't use Svelte v5 runes. I tried migrating the current code to Svelte runes but it got nasty because the imports grouped by target account objects had references to items in the original entries array and the runes magic broke those references. This might be fixable with $state.raw() but I haven't experimented.

When migrating the other entry components to runes mode, I had to rework them quite a bit but now this should be feasible without that sort of breakage.

@umangv
Copy link
Author

umangv commented May 27, 2025

The import modal gradually evolved from a time when there wasn't a whole lot of frontend-rendered code and we IMHO do not stick to that "a single dialog with a single entry at once".

I've been using my branch for the past couple of months and my personal experience has been that bulk import as a concept makes importing entries much smoother but I don't love the fact that I made this is a modal (mostly because vertical scrolling has been a little janky inside a modal) and maybe it deserves a whole page. With my limited experience with Svelte, I'll probably have to learn more about how state is maintained between pages to get that working.

Do you still plan to get this PR into a reviewable state?

I meant to follow up on this a long time back and life caught up with me. So thanks for the nudge, I had totally forgotten! I think I should be able to take another shot at this in a week or two.

When migrating the other entry components to runes mode, I had to rework them quite a bit but now this should be feasible without that sort of breakage

Great. I had not used Svelte before hacking at this, so it was especially confusing to be working with two paradigms while getting up to speed on the basics. Given that it's been a few months since I touched this, I'll probably have to do that again but I'll try to get everything working with runes mode.

Thanks, @yagebu!

@yagebu
Copy link
Member

yagebu commented May 27, 2025

I've been using my branch for the past couple of months and my personal experience has been that bulk import as a concept makes importing entries much smoother but I don't love the fact that I made this is a modal (mostly because vertical scrolling has been a little janky inside a modal) and maybe it deserves a whole page. With my limited experience with Svelte, I'll probably have to learn more about how state is maintained between pages to get that working.

Making it full-page (or just a full-screen modal?) doesn't need to have any impact on the state, it can still be rendered from the same Import.svelte component.

Great. I had not used Svelte before hacking at this, so it was especially confusing to be working with two paradigms while getting up to speed on the basics. Given that it's been a few months since I touched this, I'll probably have to do that again but I'll try to get everything working with runes mode.

Yeah, that was a confusing mix of paradigms - let me know if you run into any problems with getting it working with runes, I also still run into weird things there, e.g. d16a84e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants